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

Go to the source code of this file.

Classes

struct  tagCREATEMRULIST
 
struct  _PSXA
 
struct  _PSXA_CALL
 
struct  UxSubclassInfo
 

Macros

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

Typedefs

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

Functions

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

Variables

static LPUNKNOWN SHELL32_IExplorerInterface =0
 

Macro Definition Documentation

◆ _INC_WINDOWS

#define _INC_WINDOWS

Definition at line 26 of file shellord.c.

◆ COBJMACROS

#define COBJMACROS

Definition at line 27 of file shellord.c.

◆ MRUF_BINARY_LIST

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

Definition at line 66 of file shellord.c.

◆ MRUF_DELAYED_SAVE

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

Definition at line 67 of file shellord.c.

◆ MRUF_STRING_LIST

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

Definition at line 65 of file shellord.c.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 25 of file shellord.c.

Typedef Documentation

◆ CREATEMRULISTA

◆ LPCREATEMRULISTA

◆ PPSXA

typedef struct _PSXA * PPSXA

◆ PPSXA_CALL

◆ PSXA

typedef struct _PSXA PSXA

◆ PSXA_CALL

◆ UxSubclassInfo

Function Documentation

◆ AddMRUData()

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

Definition at line 465 of file comctl32undoc.c.

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

Referenced by SHADD_create_add_mru_data(), and SHAddToRecentDocs().

◆ ArrangeWindows()

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

Definition at line 611 of file shellord.c.

613{
614 /* Unimplemented in WinXP SP3 */
615 TRACE("(%p 0x%08x %p 0x%04x %p):stub.\n",
616 hwndParent, dwReserved, lpRect, cKids, lpKids);
617 return 0;
618}
static HWND hwndParent
Definition: cryptui.c:300
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
Definition: mswsock.h:95

◆ CIDLData_CreateFromIDArray()

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

Definition at line 2213 of file shellord.c.

2218{
2219 UINT i;
2220 HWND hwnd = 0; /*FIXME: who should be hwnd of owner? set to desktop */
2221 HRESULT hResult;
2222
2223 TRACE("(%p, %d, %p, %p)\n", pidlFolder, cpidlFiles, lppidlFiles, ppdataObject);
2224 if (TRACE_ON(pidl))
2225 {
2226 pdump (pidlFolder);
2227 for (i=0; i<cpidlFiles; i++) pdump (lppidlFiles[i]);
2228 }
2229 hResult = IDataObject_Constructor(hwnd, pidlFolder, lppidlFiles, cpidlFiles, FALSE, ppdataObject);
2230 return hResult;
2231}
HRESULT IDataObject_Constructor(HWND hwndOwner, PCIDLIST_ABSOLUTE pMyPidl, PCUIDLIST_RELATIVE_ARRAY apidl, UINT cidl, BOOL bExtendedObject, IDataObject **dataObject)
void pdump(LPCITEMIDLIST pidl)
Definition: debughlp.cpp:311
#define FALSE
Definition: types.h:117
#define TRACE_ON(x)
Definition: compat.h:75
unsigned int UINT
Definition: ndis.h:50
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023

Referenced by _CDataObject_CreateInstance(), CZipFolder::GetUIObjectOf(), 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 1539 of file shellord.c.

1540{
1541 FIXME("hwnd = %p %p %p\n",hwnd,samples,pt);
1542 return FALSE;
1543}
#define FIXME(fmt,...)
Definition: debug.h:111
#define pt(x, y)
Definition: drawing.c:79
GLsizei samples
Definition: glext.h:7006

◆ DAD_DragEnter()

BOOL WINAPI DAD_DragEnter ( HWND  hwnd)

Definition at line 1548 of file shellord.c.

1549{
1550 FIXME("hwnd = %p\n",hwnd);
1551 return FALSE;
1552}

◆ DAD_DragEnterEx()

BOOL WINAPI DAD_DragEnterEx ( HWND  hwnd,
POINT  p 
)

Definition at line 1557 of file shellord.c.

1558{
1559 FIXME("hwnd = %p (%d,%d)\n",hwnd,p.x,p.y);
1560 return FALSE;
1561}
GLfloat GLfloat p
Definition: glext.h:8902

◆ DAD_DragLeave()

BOOL WINAPI DAD_DragLeave ( VOID  )

Definition at line 1575 of file shellord.c.

1576{
1577 FIXME("\n");
1578 return FALSE;
1579}

◆ DAD_DragMove()

BOOL WINAPI DAD_DragMove ( POINT  p)

Definition at line 1566 of file shellord.c.

1567{
1568 FIXME("(%d,%d)\n",p.x,p.y);
1569 return FALSE;
1570}

◆ DAD_SetDragImage()

BOOL WINAPI DAD_SetDragImage ( HIMAGELIST  himlTrack,
LPPOINT  lppt 
)

Definition at line 1586 of file shellord.c.

1589{
1590 FIXME("%p %p stub\n",himlTrack, lppt);
1591 return FALSE;
1592}

◆ DAD_ShowDragImage()

BOOL WINAPI DAD_ShowDragImage ( BOOL  bShow)

Definition at line 1599 of file shellord.c.

1600{
1601 FIXME("0x%08x stub\n",bShow);
1602 return FALSE;
1603}

◆ DoEnvironmentSubstA()

DWORD WINAPI DoEnvironmentSubstA ( LPSTR  pszString,
UINT  cchString 
)

Definition at line 1805 of file shellord.c.

1806{
1807 LPSTR dst;
1808 BOOL res = FALSE;
1809 DWORD len = cchString;
1810
1811 TRACE("(%s, %d)\n", debugstr_a(pszString), cchString);
1812 if (pszString == NULL) /* Really return 0? */
1813 return 0;
1814 if ((dst = (LPSTR)HeapAlloc(GetProcessHeap(), 0, cchString * sizeof(CHAR))))
1815 {
1817 /* len includes the terminating 0 */
1818 if (len && len < cchString)
1819 {
1820 res = TRUE;
1822 }
1823 else
1824 len = cchString;
1825
1827 }
1828 return MAKELONG(len, res);
1829}
#define TRUE
Definition: types.h:120
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
DWORD WINAPI ExpandEnvironmentStringsA(IN LPCSTR lpSrc, IN LPSTR lpDst, IN DWORD nSize)
Definition: environ.c:399
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint res
Definition: glext.h:9613
GLenum GLenum dst
Definition: glext.h:6340
GLenum GLsizei len
Definition: glext.h:6722
#define debugstr_a
Definition: kernel32.h:31
#define MAKELONG(a, b)
Definition: typedefs.h:249
_In_ DWORD _In_ DWORD _Out_writes_to_opt_ pcchString LPSTR pszString
Definition: wincrypt.h:4505
char * LPSTR
Definition: xmlstorage.h:182
char CHAR
Definition: xmlstorage.h:175

Referenced by DoEnvironmentSubstAW(), and test_DoEnvironmentSubst().

◆ DoEnvironmentSubstAW()

DWORD WINAPI DoEnvironmentSubstAW ( LPVOID  x,
UINT  y 
)

Definition at line 1880 of file shellord.c.

1881{
1882 if (SHELL_OsIsUnicode())
1883 return DoEnvironmentSubstW(x, y);
1884 return DoEnvironmentSubstA(x, y);
1885}
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:140
DWORD WINAPI DoEnvironmentSubstW(LPWSTR pszString, UINT cchString)
Definition: shellord.c:1850
DWORD WINAPI DoEnvironmentSubstA(LPSTR pszString, UINT cchString)
Definition: shellord.c:1805

◆ DoEnvironmentSubstW()

DWORD WINAPI DoEnvironmentSubstW ( LPWSTR  pszString,
UINT  cchString 
)

Definition at line 1850 of file shellord.c.

1851{
1852 LPWSTR dst;
1853 BOOL res = FALSE;
1854 DWORD len = cchString;
1855
1856 TRACE("(%s, %d)\n", debugstr_w(pszString), cchString);
1857
1858 if ((cchString < MAXLONG) && (dst = HeapAlloc(GetProcessHeap(), 0, cchString * sizeof(WCHAR))))
1859 {
1861 /* len includes the terminating 0 */
1862 if (len && len <= cchString)
1863 {
1864 res = TRUE;
1865 memcpy(pszString, dst, len * sizeof(WCHAR));
1866 }
1867 else
1868 len = cchString;
1869
1871 }
1872 return MAKELONG(len, res);
1873}
DWORD WINAPI ExpandEnvironmentStringsW(IN LPCWSTR lpSrc, IN LPWSTR lpDst, IN DWORD nSize)
Definition: environ.c:519
#define debugstr_w
Definition: kernel32.h:32
#define MAXLONG
Definition: umtypes.h:116
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by DoEnvironmentSubstAW(), and test_DoEnvironmentSubst().

◆ DoSanitizeClipboard()

static void DoSanitizeClipboard ( HWND  hwnd,
UxSubclassInfo pInfo 
)
static

Definition at line 2655 of file shellord.c.

2656{
2657 HGLOBAL hData;
2658 LPWSTR pszText, pszSanitized;
2659 DWORD cbData;
2660
2662 return;
2663 if (!OpenClipboard(hwnd))
2664 return;
2665
2667 pszText = GlobalLock(hData);
2668 if (!pszText)
2669 {
2671 return;
2672 }
2673 SHStrDupW(pszText, &pszSanitized);
2674 GlobalUnlock(hData);
2675
2676 if (pszSanitized &&
2677 DoSanitizeText(pszSanitized, pInfo->pwszInvalidChars, pInfo->pwszValidChars))
2678 {
2679 MessageBeep(0xFFFFFFFF);
2680
2681 /* Update clipboard text */
2682 cbData = (lstrlenW(pszSanitized) + 1) * sizeof(WCHAR);
2683 hData = GlobalAlloc(GMEM_MOVEABLE | GMEM_SHARE, cbData);
2684 pszText = GlobalLock(hData);
2685 if (pszText)
2686 {
2687 CopyMemory(pszText, pszSanitized, cbData);
2688 GlobalUnlock(hData);
2689
2691 }
2692 }
2693
2694 CoTaskMemFree(pszSanitized);
2696}
#define CF_UNICODETEXT
Definition: constants.h:408
#define lstrlenW
Definition: compat.h:750
HRESULT WINAPI SHStrDupW(LPCWSTR src, LPWSTR *dest)
Definition: string.c:2012
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
Definition: heapmem.c:755
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
Definition: heapmem.c:1190
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:368
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
#define ES_READONLY
Definition: pedump.c:675
static BOOL DoSanitizeText(LPWSTR pszSanitized, LPCWSTR pszInvalidChars, LPCWSTR pszValidChars)
Definition: shellord.c:2622
LPWSTR pwszValidChars
Definition: shellord.c:2601
LPWSTR pwszInvalidChars
Definition: shellord.c:2602
#define CopyMemory
Definition: winbase.h:1710
#define GMEM_MOVEABLE
Definition: winbase.h:294
#define GMEM_SHARE
Definition: winbase.h:305
#define GetWindowLongPtrW
Definition: winuser.h:4829
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:852

Referenced by LimitEditWindowProc().

◆ DoSanitizeText()

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

Definition at line 2622 of file shellord.c.

2623{
2624 LPWSTR pch1, pch2;
2625 BOOL bFound = FALSE;
2626
2627 for (pch1 = pch2 = pszSanitized; *pch1; ++pch1)
2628 {
2629 if (pszInvalidChars)
2630 {
2631 if (wcschr(pszInvalidChars, *pch1) != NULL)
2632 {
2633 bFound = TRUE;
2634 continue;
2635 }
2636 }
2637 else if (pszValidChars)
2638 {
2639 if (wcschr(pszValidChars, *pch1) == NULL)
2640 {
2641 bFound = TRUE;
2642 continue;
2643 }
2644 }
2645
2646 *pch2 = *pch1;
2647 ++pch2;
2648 }
2649 *pch2 = 0;
2650
2651 return bFound;
2652}
#define wcschr
Definition: compat.h:17

Referenced by DoSanitizeClipboard().

◆ DriveType()

int WINAPI DriveType ( int  DriveType)

Definition at line 1723 of file shellord.c.

1724{
1725 WCHAR root[] = L"A:\\";
1726 root[0] = L'A' + DriveType;
1727 return GetDriveTypeW(root);
1728}
UINT DriveType
UINT WINAPI GetDriveTypeW(IN LPCWSTR lpRootPathName)
Definition: disk.c:497
#define L(x)
Definition: ntvdm.h:50

◆ EnumMRUListA()

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

Definition at line 863 of file comctl32undoc.c.

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

Referenced by SHAddToRecentDocs().

◆ FileIconInit()

BOOL WINAPI FileIconInit ( BOOL  bFullInit)

Definition at line 1683 of file shellord.c.

1684{
1685 return SIC_Initialize();
1686}
BOOL SIC_Initialize(void)
Definition: iconcache.cpp:481

Referenced by DisplayImageList(), and StartWithDesktop().

◆ FindMRUData()

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

Definition at line 391 of file comctl32undoc.c.

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

Referenced by SHAddToRecentDocs().

◆ FreeMRUList()

VOID WINAPI FreeMRUList ( HANDLE  hMRUList)

Definition at line 351 of file comctl32undoc.c.

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

Referenced by SHAddToRecentDocs().

◆ GetFileNameFromBrowse()

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

Definition at line 154 of file shellord.c.

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

◆ GUIDFromStringA()

BOOL WINAPI GUIDFromStringA ( LPCSTR  str,
LPGUID  guid 
)

Definition at line 1890 of file shellord.c.

1891{
1892 ANSI_STRING ansi_str;
1893 WCHAR szWide[40];
1894 UNICODE_STRING guid_str = { 0, sizeof(szWide), szWide };
1895 if (*str != '{')
1896 return FALSE;
1897 RtlInitAnsiString(&ansi_str, str);
1898 return !RtlAnsiStringToUnicodeString(&guid_str, &ansi_str, FALSE) &&
1899 !RtlGUIDFromString(&guid_str, guid);
1900}
NTSYSAPI NTSTATUS WINAPI RtlGUIDFromString(PUNICODE_STRING, GUID *)
const GUID * guid
NTSYSAPI NTSTATUS NTAPI RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, PANSI_STRING SourceString, BOOLEAN AllocateDestinationString)
NTSYSAPI VOID NTAPI RtlInitAnsiString(PANSI_STRING DestinationString, PCSZ SourceString)
const WCHAR * str

Referenced by TEST_GUIDFromStringA().

◆ GUIDFromStringW()

BOOL WINAPI GUIDFromStringW ( LPCWSTR  str,
LPGUID  guid 
)

Definition at line 1905 of file shellord.c.

1906{
1907 UNICODE_STRING guid_str;
1908 if (!str || *str != L'{')
1909 return FALSE;
1910 RtlInitUnicodeString(&guid_str, str);
1911 return !RtlGUIDFromString(&guid_str, guid);
1912}
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)

◆ InvalidateDriveType()

int WINAPI InvalidateDriveType ( int  u)

Definition at line 1733 of file shellord.c.

1734{
1735 TRACE("0x%08x stub\n",u);
1736 return 0;
1737}
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 2586 of file shellord.c.

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

Referenced by CStartMenuBtnCtxMenu::AddStartContextMenuItems().

◆ LimitEditWindowProc()

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

Definition at line 2699 of file shellord.c.

2700{
2701 WNDPROC fnWndProc;
2702 WCHAR wch;
2703 UxSubclassInfo *pInfo = GetPropW(hwnd, L"UxSubclassInfo");
2704 if (!pInfo)
2705 return DefWindowProcW(hwnd, uMsg, wParam, lParam);
2706
2707 fnWndProc = pInfo->fnWndProc;
2708
2709 switch (uMsg)
2710 {
2711 case WM_KEYDOWN:
2712 if (GetKeyState(VK_SHIFT) < 0 && wParam == VK_INSERT)
2713 DoSanitizeClipboard(hwnd, pInfo);
2714 else if (GetKeyState(VK_CONTROL) < 0 && wParam == L'V')
2715 DoSanitizeClipboard(hwnd, pInfo);
2716
2717 return CallWindowProcW(fnWndProc, hwnd, uMsg, wParam, lParam);
2718
2719 case WM_PASTE:
2720 DoSanitizeClipboard(hwnd, pInfo);
2721 return CallWindowProcW(fnWndProc, hwnd, uMsg, wParam, lParam);
2722
2723 case WM_CHAR:
2724 if (GetKeyState(VK_CONTROL) < 0 && wParam == L'V')
2725 break;
2726
2727 if (pInfo->pwszInvalidChars)
2728 {
2729 if (wcschr(pInfo->pwszInvalidChars, (WCHAR)wParam) != NULL)
2730 {
2731 MessageBeep(0xFFFFFFFF);
2732 break;
2733 }
2734 }
2735 else if (pInfo->pwszValidChars)
2736 {
2737 if (wcschr(pInfo->pwszValidChars, (WCHAR)wParam) == NULL)
2738 {
2739 MessageBeep(0xFFFFFFFF);
2740 break;
2741 }
2742 }
2743 return CallWindowProcW(fnWndProc, hwnd, uMsg, wParam, lParam);
2744
2745 case WM_UNICHAR:
2746 if (wParam == UNICODE_NOCHAR)
2747 return TRUE;
2748
2749 /* FALL THROUGH */
2750
2751 case WM_IME_CHAR:
2752 wch = (WCHAR)wParam;
2753 if (GetKeyState(VK_CONTROL) < 0 && wch == L'V')
2754 break;
2755
2756 if (!IsWindowUnicode(hwnd) && HIBYTE(wch) != 0)
2757 {
2758 CHAR data[] = {HIBYTE(wch), LOBYTE(wch)};
2759 MultiByteToWideChar(CP_ACP, 0, data, 2, &wch, 1);
2760 }
2761
2762 if (pInfo->pwszInvalidChars)
2763 {
2764 if (wcschr(pInfo->pwszInvalidChars, wch) != NULL)
2765 {
2766 MessageBeep(0xFFFFFFFF);
2767 break;
2768 }
2769 }
2770 else if (pInfo->pwszValidChars)
2771 {
2772 if (wcschr(pInfo->pwszValidChars, wch) == NULL)
2773 {
2774 MessageBeep(0xFFFFFFFF);
2775 break;
2776 }
2777 }
2778 return CallWindowProcW(fnWndProc, hwnd, uMsg, wParam, lParam);
2779
2780 case WM_NCDESTROY:
2782 return CallWindowProcW(fnWndProc, hwnd, uMsg, wParam, lParam);
2783
2784 default:
2785 return CallWindowProcW(fnWndProc, hwnd, uMsg, wParam, lParam);
2786 }
2787
2788 return 0;
2789}
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define MultiByteToWideChar
Definition: compat.h:110
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define LOBYTE(W)
Definition: jmemdos.c:487
#define HIBYTE(W)
Definition: jmemdos.c:486
#define WM_UNICHAR
Definition: richedit.h:67
static void DoSanitizeClipboard(HWND hwnd, UxSubclassInfo *pInfo)
Definition: shellord.c:2655
static void UxSubclassInfo_Destroy(UxSubclassInfo *pInfo)
Definition: shellord.c:2606
WNDPROC fnWndProc
Definition: shellord.c:2600
#define WM_PASTE
Definition: winuser.h:1863
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define VK_CONTROL
Definition: winuser.h:2203
BOOL WINAPI IsWindowUnicode(_In_ HWND)
#define WM_IME_CHAR
Definition: winuser.h:1834
#define WM_CHAR
Definition: winuser.h:1717
HANDLE WINAPI GetPropW(_In_ HWND, _In_ LPCWSTR)
#define WM_NCDESTROY
Definition: winuser.h:1684
#define VK_SHIFT
Definition: winuser.h:2202
#define WM_KEYDOWN
Definition: winuser.h:1715
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2906
LRESULT WINAPI CallWindowProcW(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define VK_INSERT
Definition: winuser.h:2232
SHORT WINAPI GetKeyState(_In_ int)

Referenced by UxSubclassInfo_Create().

◆ LinkWindow_RegisterClass()

BOOL WINAPI LinkWindow_RegisterClass ( void  )

Definition at line 2414 of file shellord.c.

2415{
2416 FIXME("()\n");
2417 return TRUE;
2418}

◆ LinkWindow_UnregisterClass()

BOOL WINAPI LinkWindow_UnregisterClass ( DWORD  dwUnused)

Definition at line 2423 of file shellord.c.

2424{
2425 FIXME("()\n");
2426 return TRUE;
2427}

◆ ParseFieldA()

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

Definition at line 83 of file shellord.c.

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

Referenced by HCR_RegGetIconA(), and ParseFieldAW().

◆ ParseFieldAW()

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

Definition at line 143 of file shellord.c.

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

◆ ParseFieldW()

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

Definition at line 117 of file shellord.c.

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

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

◆ PathIsTemporaryA()

BOOL WINAPI PathIsTemporaryA ( LPSTR  Str)

Definition at line 1921 of file shellord.c.

1923{
1924#ifdef __REACTOS__
1925 WCHAR szWide[MAX_PATH];
1926
1927 TRACE("(%s)\n", debugstr_a(Str));
1928
1929 SHAnsiToUnicode(Str, szWide, _countof(szWide));
1930 return PathIsTemporaryW(szWide);
1931#else
1932 FIXME("(%s)stub\n", debugstr_a(Str));
1933 return FALSE;
1934#endif
1935}
#define MAX_PATH
Definition: compat.h:34
DWORD WINAPI SHAnsiToUnicode(LPCSTR lpSrcStr, LPWSTR lpDstStr, int iLen)
Definition: string.c:2667
BOOL WINAPI PathIsTemporaryW(LPWSTR Str)
Definition: shellord.c:1944
#define _countof(array)
Definition: sndvol32.h:68

Referenced by Test_PathIsTemporaryA().

◆ PathIsTemporaryW()

BOOL WINAPI PathIsTemporaryW ( LPWSTR  Str)

Definition at line 1944 of file shellord.c.

1946{
1947#ifdef __REACTOS__
1948 WCHAR szLongPath[MAX_PATH], szTempPath[MAX_PATH];
1949 DWORD attrs;
1950 LPCWSTR pszTarget = Str;
1951
1952 TRACE("(%s)\n", debugstr_w(Str));
1953
1954 attrs = GetFileAttributesW(Str);
1955 if (attrs != INVALID_FILE_ATTRIBUTES && (attrs & FILE_ATTRIBUTE_TEMPORARY))
1956 return TRUE;
1957
1960 {
1961 return FALSE;
1962 }
1963
1964 if (GetLongPathNameW(Str, szLongPath, _countof(szLongPath)))
1965 pszTarget = szLongPath;
1966
1967 return (PathIsEqualOrSubFolder(szTempPath, pszTarget) ||
1970#else
1971 FIXME("(%s)stub\n", debugstr_w(Str));
1972 return FALSE;
1973#endif
1974}
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:652
DWORD WINAPI GetTempPathW(IN DWORD count, OUT LPWSTR path)
Definition: path.c:2080
DWORD WINAPI GetLongPathNameW(IN LPCWSTR lpszShortPath, OUT LPWSTR lpszLongPath, IN DWORD cchBuffer)
Definition: path.c:1456
EXTERN_C BOOL WINAPI PathIsEqualOrSubFolder(_In_ LPCWSTR pszPath1OrCSIDL, _In_ LPCWSTR pszPath2)
Definition: utils.cpp:1219
#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:2189
#define CSIDL_CDBURN_AREA
Definition: shlobj.h:2213
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

Referenced by PathIsTemporaryA(), and Test_PathIsTemporaryW().

◆ PsxaCall()

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

Definition at line 1992 of file shellord.c.

1993{
1995
1996 if (Call != NULL)
1997 {
1998 if ((Call->bMultiple || !Call->bCalled) &&
1999 Call->lpfnAddReplaceWith(hpage, Call->lParam))
2000 {
2001 Call->bCalled = TRUE;
2002 Call->uiCount++;
2003 return TRUE;
2004 }
2005 }
2006
2007 return FALSE;
2008}
struct _PSXA_CALL * PPSXA_CALL
LPFNADDPROPSHEETPAGE lpfnAddReplaceWith
Definition: shellord.c:1985
LPARAM lParam
Definition: shellord.c:1986
BOOL bCalled
Definition: shellord.c:1987
BOOL bMultiple
Definition: shellord.c:1988
UINT uiCount
Definition: shellord.c:1989

Referenced by SHAddFromPropSheetExtArray(), and SHReplaceFromPropSheetExtArray().

◆ ReadCabinetState()

BOOL WINAPI ReadCabinetState ( CABINETSTATE cs,
int  length 
)

Definition at line 1609 of file shellord.c.

1610{
1611 HKEY hkey = 0;
1612 DWORD type, r;
1613
1614 TRACE("%p %d\n", cs, length);
1615
1616 if( (cs == NULL) || (length < (int)sizeof(*cs)) )
1617 return FALSE;
1618
1619 r = RegOpenKeyW( HKEY_CURRENT_USER, L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\CabinetState", &hkey );
1620 if( r == ERROR_SUCCESS )
1621 {
1622 type = REG_BINARY;
1623 r = RegQueryValueExW( hkey, L"Settings",
1624 NULL, &type, (LPBYTE)cs, (LPDWORD)&length );
1625 RegCloseKey( hkey );
1626
1627 }
1628
1629 /* if we can't read from the registry, create default values */
1630 if ( (r != ERROR_SUCCESS) || (cs->cLength < sizeof(*cs)) ||
1631 (cs->cLength != length) )
1632 {
1633 TRACE("Initializing shell cabinet settings\n");
1634 memset(cs, 0, sizeof(*cs));
1635 cs->cLength = sizeof(*cs);
1636 cs->nVersion = 2;
1637 cs->fFullPathTitle = FALSE;
1638 cs->fSaveLocalView = TRUE;
1639 cs->fNotShell = FALSE;
1640 cs->fSimpleDefault = TRUE;
1641 cs->fDontShowDescBar = FALSE;
1642 cs->fNewWindowMode = FALSE;
1643 cs->fShowCompColor = FALSE;
1644 cs->fDontPrettyNames = FALSE;
1645 cs->fAdminsCreateCommonGroups = TRUE;
1646 cs->fMenuEnumFilter = 96;
1647 }
1648
1649 return TRUE;
1650}
#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 REG_BINARY
Definition: nt_native.h:1496
unsigned char * LPBYTE
Definition: typedefs.h:53
uint32_t * LPDWORD
Definition: typedefs.h:59
#define HKEY_CURRENT_USER
Definition: winreg.h:11

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

◆ RegisterShellHook()

BOOL WINAPI RegisterShellHook ( HWND  hWnd,
DWORD  dwType 
)

Definition at line 312 of file shellord.c.

315{
316 if (dwType == 3)
317 {
320 }
321 else if (dwType == 0)
322 {
324 }
325
326 ERR("Unsupported argument");
327 return FALSE;
328}
HWND hWnd
Definition: settings.c:17
#define ERR(fmt,...)
Definition: debug.h:110
HWND WINAPI SetTaskmanWindow(HWND)
Definition: window.c:1908
BOOL WINAPI DeregisterShellHookWindow(_In_ HWND)
BOOL WINAPI RegisterShellHookWindow(_In_ HWND)

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

◆ RLBuildListOfPaths()

DWORD WINAPI RLBuildListOfPaths ( void  )

Definition at line 1786 of file shellord.c.

1787{ FIXME("stub\n");
1788 return 0;
1789}

◆ SetAppStartingCursor()

HRESULT WINAPI SetAppStartingCursor ( HWND  u,
DWORD  v 
)

Definition at line 1691 of file shellord.c.

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

◆ SHAbortInvokeCommand()

HRESULT WINAPI SHAbortInvokeCommand ( void  )

Definition at line 1742 of file shellord.c.

1743{ FIXME("stub\n");
1744 return 1;
1745}

◆ SHADD_compare_mru()

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

Definition at line 690 of file shellord.c.

691{
692#ifdef __REACTOS__
693 LPCWSTR psz1, psz2;
694 INT iCmp = lstrcmpiW(data1, data2);
695 if (iCmp != 0)
696 return iCmp;
697 psz1 = data1;
698 psz2 = data2;
699 psz1 += lstrlenW(psz1) + 1;
700 psz2 += lstrlenW(psz2) + 1;
701 return lstrcmpiW(psz1, psz2);
702#else
703 return lstrcmpiA(data1, data2);
704#endif
705}
int WINAPI lstrcmpiA(LPCSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:42
int WINAPI lstrcmpiW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:194
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 758 of file shellord.c.

760{
761 LPSTR ptr;
762 INT wlen;
763
764 /*FIXME: Document:
765 * RecentDocs MRU data structure seems to be:
766 * +0h document file name w/ terminating 0h
767 * +nh short int w/ size of remaining
768 * +n+2h 02h 30h, or 01h 30h, or 00h 30h - unknown
769 * +n+4h 10 bytes zeros - unknown
770 * +n+eh shortcut file name w/ terminating 0h
771 * +n+e+nh 3 zero bytes - unknown
772 */
773
774 /* Create the MRU data structure for "RecentDocs"
775 */
776 ptr = buffer;
777 lstrcpyA(ptr, doc_name);
778 ptr += (lstrlenA(buffer) + 1);
779 wlen= lstrlenA(new_lnk_name) + 1 + 12;
780 *((short int*)ptr) = wlen;
781 ptr += 2; /* step past the length */
782 *(ptr++) = 0x30; /* unknown reason */
783 *(ptr++) = 0; /* unknown, but can be 0x00, 0x01, 0x02 */
784 memset(ptr, 0, 10);
785 ptr += 10;
786 lstrcpyA(ptr, new_lnk_name);
787 ptr += (lstrlenA(new_lnk_name) + 1);
788 memset(ptr, 0, 3);
789 ptr += 3;
790 *len = ptr - buffer;
791
792 /* Add the new entry into the MRU list
793 */
794 return AddMRUData(mruhandle, buffer, *len);
795}
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 649 of file shellord.c.

650{
651 HKEY Policy_basekey;
652 INT ret;
653
654 /* Get the key for the policies location in the registry
655 */
657 "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",
658 0, KEY_READ, &Policy_basekey)) {
659
661 "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",
662 0, KEY_READ, &Policy_basekey)) {
663 TRACE("No Explorer Policies location exists. Policy wanted=%s\n",
664 policy);
665 *len = 0;
667 }
668 }
669
670 /* Retrieve the data if it exists
671 */
672 ret = SHQueryValueExA(Policy_basekey, policy, 0, type, buffer, len);
673 RegCloseKey(Policy_basekey);
674 return ret;
675}
LONG WINAPI RegOpenKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD ulOptions, _In_ REGSAM samDesired, _Out_ PHKEY phkResult)
Definition: reg.c:3298
DWORD WINAPI SHQueryValueExA(HKEY hKey, LPCSTR lpszValue, LPDWORD lpReserved, LPDWORD pwType, LPVOID pvData, LPDWORD pcbData)
Definition: reg.c:1402
WDF_INTERRUPT_POLICY policy
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
#define KEY_READ
Definition: nt_native.h:1023
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by SHAddToRecentDocs().

◆ SHAddFromPropSheetExtArray()

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

Definition at line 2013 of file shellord.c.

2014{
2015 PSXA_CALL Call;
2016 UINT i;
2017 PPSXA psxa = (PPSXA)hpsxa;
2018
2019 TRACE("(%p,%p,%08lx)\n", hpsxa, lpfnAddPage, lParam);
2020
2021 if (psxa)
2022 {
2023 ZeroMemory(&Call, sizeof(Call));
2024 Call.lpfnAddReplaceWith = lpfnAddPage;
2025 Call.lParam = lParam;
2026 Call.bMultiple = TRUE;
2027
2028 /* Call the AddPage method of all registered IShellPropSheetExt interfaces */
2029 for (i = 0; i != psxa->uiCount; i++)
2030 {
2031 psxa->pspsx[i]->lpVtbl->AddPages(psxa->pspsx[i], PsxaCall, (LPARAM)&Call);
2032 }
2033
2034 return Call.uiCount;
2035 }
2036
2037 return 0;
2038}
HRESULT AddPages([in] LPFNSVADDPROPSHEETPAGE pfnAddPage, [in] LPARAM lParam)
static BOOL CALLBACK PsxaCall(HPROPSHEETPAGE hpage, LPARAM lParam)
Definition: shellord.c:1992
struct _PSXA * PPSXA
UINT uiCount
Definition: shellord.c:1978
IShellPropSheetExt * pspsx[1]
Definition: shellord.c:1980
#define ZeroMemory
Definition: winbase.h:1712
LONG_PTR LPARAM
Definition: windef.h:208

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

◆ SHAddToRecentDocs()

void WINAPI SHAddToRecentDocs ( UINT  uFlags,
LPCVOID  pv 
)

Definition at line 813 of file shellord.c.

814{
815#ifdef __REACTOS__
816 INT ret;
817 WCHAR szTargetPath[MAX_PATH], szLinkDir[MAX_PATH], szLinkFile[MAX_PATH], szDescription[80];
819 DWORD cbBuffer;
820 HANDLE hFind;
822 HKEY hExplorerKey;
823 LONG error;
824 LPWSTR pchDotExt, pchTargetTitle, pchLinkTitle;
825 MRUINFOW mru;
826 HANDLE hMRUList = NULL;
827 IShellLinkW *psl = NULL;
828 IPersistFile *pPf = NULL;
829 HRESULT hr;
830 BYTE Buffer[(MAX_PATH + 64) * sizeof(WCHAR)];
831
832 TRACE("%04x %p\n", uFlags, pv);
833
834 /* check policy */
836 TRACE("policy value for NoRecentDocsHistory = %08x\n", ret);
837 if (ret != 0)
838 return;
839
840 /* store to szTargetPath */
841 szTargetPath[0] = 0;
842 if (pv)
843 {
844 switch (uFlags)
845 {
846 case SHARD_PATHA:
847 MultiByteToWideChar(CP_ACP, 0, pv, -1, szLinkDir, ARRAYSIZE(szLinkDir));
848 GetFullPathNameW(szLinkDir, ARRAYSIZE(szTargetPath), szTargetPath, NULL);
849 break;
850
851 case SHARD_PATHW:
852 GetFullPathNameW(pv, ARRAYSIZE(szTargetPath), szTargetPath, NULL);
853 break;
854
855 case SHARD_PIDL:
856 SHGetPathFromIDListW(pv, szLinkDir);
857 GetFullPathNameW(szLinkDir, ARRAYSIZE(szTargetPath), szTargetPath, NULL);
858 break;
859
860 default:
861 FIXME("Unsupported flags: %u\n", uFlags);
862 return;
863 }
864 }
865
866 /* get recent folder */
868 {
869 ERR("serious issues 1\n");
870 return;
871 }
872 TRACE("Users Recent dir %S\n", szLinkDir);
873
874 /* open Explorer key */
875 error = RegCreateKeyExW(HKEY_CURRENT_USER, L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer",
876 0, NULL, 0,
877 KEY_READ | KEY_WRITE, NULL, &hExplorerKey, NULL);
878 if (error)
879 {
880 ERR("Failed to RegCreateKeyExW: 0x%08X\n", error);
881 return;
882 }
883
884 if (!pv)
885 {
886 TRACE("pv is NULL, so delete all shortcut files in %S\n", szLinkDir);
887
888 lstrcpynW(szLinkFile, szLinkDir, ARRAYSIZE(szLinkFile));
889 PathAppendW(szLinkFile, L"*.lnk");
890
891 hFind = FindFirstFileW(szLinkFile, &find);
892 if (hFind != INVALID_HANDLE_VALUE)
893 {
894 do
895 {
896 lstrcpynW(szLinkFile, szLinkDir, ARRAYSIZE(szLinkFile));
897 PathAppendW(szLinkFile, find.cFileName);
898 DeleteFileW(szLinkFile);
899 } while (FindNextFile(hFind, &find));
900 FindClose(hFind);
901 }
902
903 SHDeleteKeyW(hExplorerKey, L"RecentDocs");
904 RegCloseKey(hExplorerKey);
905 return;
906 }
907
908 if (szTargetPath[0] == 0 || !PathFileExistsW(szTargetPath) ||
909 PathIsDirectoryW(szTargetPath))
910 {
911 /* path is not normal file */
912 RegCloseKey(hExplorerKey);
913 return;
914 }
915
917 if (FAILED(hr))
918 {
919 ERR("CoInitialize: %08X\n", hr);
920 RegCloseKey(hExplorerKey);
921 return;
922 }
923
924 /* check if file is a shortcut */
925 ret = 0;
926 pchDotExt = PathFindExtensionW(szTargetPath);
927 while (lstrcmpiW(pchDotExt, L".lnk") == 0)
928 {
929 hr = IShellLink_ConstructFromPath(szTargetPath, &IID_IShellLinkW, (LPVOID*)&psl);
930 if (FAILED(hr))
931 {
932 ERR("IShellLink_ConstructFromPath: 0x%08X\n", hr);
933 goto Quit;
934 }
935
936 IShellLinkW_GetPath(psl, szPath, ARRAYSIZE(szPath), NULL, 0);
937 IShellLinkW_Release(psl);
938 psl = NULL;
939
940 lstrcpynW(szTargetPath, szPath, ARRAYSIZE(szTargetPath));
941 pchDotExt = PathFindExtensionW(szTargetPath);
942
943 if (++ret >= 8)
944 {
945 ERR("Link loop?\n");
946 goto Quit;
947 }
948 }
949 if (!lstrcmpiW(pchDotExt, L".exe"))
950 {
951 /* executables are not added */
952 goto Quit;
953 }
954
955 /* *** JOB 0: Build strings *** */
956
957 pchTargetTitle = PathFindFileNameW(szTargetPath);
958
959 lstrcpyW(szDescription, L"Shortcut to ");
961
962 lstrcpynW(szLinkFile, szLinkDir, ARRAYSIZE(szLinkFile));
963 PathAppendW(szLinkFile, pchTargetTitle);
964 StrCatBuffW(szLinkFile, L".lnk", ARRAYSIZE(szLinkFile));
965 pchLinkTitle = PathFindFileNameW(szLinkFile);
966
967 /* *** JOB 1: Update registry for ...\Explorer\RecentDocs list *** */
968
969 /* store MRU data */
970 cbBuffer = sizeof(Buffer);
971 ret = DoStoreMRUData(Buffer, &cbBuffer, pchTargetTitle, szTargetPath, pchLinkTitle);
972 if (!ret)
973 {
974 ERR("DoStoreMRUData failed: %d\n", ret);
975 goto Quit;
976 }
977
978 /* create MRU list */
979 mru.cbSize = sizeof(mru);
980 mru.uMax = 16;
982 mru.hKey = hExplorerKey;
983 mru.lpszSubKey = L"RecentDocs";
984 mru.lpfnCompare = (MRUCMPPROCW)SHADD_compare_mru;
985 hMRUList = CreateMRUListW(&mru);
986 if (!hMRUList)
987 {
988 ERR("CreateMRUListW failed\n");
989 goto Quit;
990 }
991
992 /* already exists? */
993 ret = FindMRUData(hMRUList, Buffer, cbBuffer, NULL);
994 if (ret >= 0)
995 {
996 /* Just touch for speed */
1001 {
1002 TRACE("Just touch file '%S'.\n", szLinkFile);
1004 goto Quit;
1005 }
1006 }
1007
1008 /* add MRU data */
1009 ret = AddMRUData(hMRUList, Buffer, cbBuffer);
1010 if (ret < 0)
1011 {
1012 ERR("AddMRUData failed: %d\n", ret);
1013 goto Quit;
1014 }
1015
1016 /* *** JOB 2: Create shortcut in user's "Recent" directory *** */
1017
1018 hr = CoCreateInstance(&CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER,
1019 &IID_IShellLinkW, (LPVOID *)&psl);
1020 if (FAILED(hr))
1021 {
1022 ERR("CoInitialize for IID_IShellLinkW: %08X\n", hr);
1023 goto Quit;
1024 }
1025
1026 hr = IShellLinkW_QueryInterface(psl, &IID_IPersistFile, (LPVOID *)&pPf);
1027 if (FAILED(hr))
1028 {
1029 ERR("IShellLinkW_QueryInterface: %08X\n", hr);
1030 goto Quit;
1031 }
1032
1033 if (uFlags == SHARD_PIDL)
1034 hr = IShellLinkW_SetIDList(psl, pv);
1035 else
1036 hr = IShellLinkW_SetPath(psl, pv);
1037
1038 IShellLinkW_SetDescription(psl, szDescription);
1039
1040 hr = IPersistFile_Save(pPf, szLinkFile, TRUE);
1041 if (FAILED(hr))
1042 {
1043 ERR("IPersistFile_Save: 0x%08X\n", hr);
1044 }
1045
1046 hr = IPersistFile_SaveCompleted(pPf, szLinkFile);
1047 if (FAILED(hr))
1048 {
1049 ERR("IPersistFile_SaveCompleted: 0x%08X\n", hr);
1050 }
1051
1052Quit:
1053 if (hMRUList)
1054 FreeMRUList(hMRUList);
1055 if (pPf)
1056 IPersistFile_Release(pPf);
1057 if (psl)
1058 IShellLinkW_Release(psl);
1060 RegCloseKey(hExplorerKey);
1061#else
1062/* If list is a string list lpfnCompare has the following prototype
1063 * int CALLBACK MRUCompareString(LPCSTR s1, LPCSTR s2)
1064 * for binary lists the prototype is
1065 * int CALLBACK MRUCompareBinary(LPCVOID data1, LPCVOID data2, DWORD cbData)
1066 * where cbData is the no. of bytes to compare.
1067 * Need to check what return value means identical - 0?
1068 */
1069
1070
1071 UINT olderrormode;
1072 HKEY HCUbasekey;
1073 CHAR doc_name[MAX_PATH];
1074 CHAR link_dir[MAX_PATH];
1075 CHAR new_lnk_filepath[MAX_PATH];
1076 CHAR new_lnk_name[MAX_PATH];
1077 CHAR * ext;
1078 IMalloc *ppM;
1079 LPITEMIDLIST pidl;
1080 HWND hwnd = 0; /* FIXME: get real window handle */
1081 INT ret;
1082 DWORD data[64], datalen, type;
1083
1084 TRACE("%04x %p\n", uFlags, pv);
1085
1086 /*FIXME: Document:
1087 * RecentDocs MRU data structure seems to be:
1088 * +0h document file name w/ terminating 0h
1089 * +nh short int w/ size of remaining
1090 * +n+2h 02h 30h, or 01h 30h, or 00h 30h - unknown
1091 * +n+4h 10 bytes zeros - unknown
1092 * +n+eh shortcut file name w/ terminating 0h
1093 * +n+e+nh 3 zero bytes - unknown
1094 */
1095
1096 /* See if we need to do anything.
1097 */
1098 datalen = 64;
1099 ret=SHADD_get_policy( "NoRecentDocsHistory", &type, data, &datalen);
1100 if ((ret > 0) && (ret != ERROR_FILE_NOT_FOUND)) {
1101 ERR("Error %d getting policy \"NoRecentDocsHistory\"\n", ret);
1102 return;
1103 }
1104 if (ret == ERROR_SUCCESS) {
1105 if (!( (type == REG_DWORD) ||
1106 ((type == REG_BINARY) && (datalen == 4)) )) {
1107 ERR("Error policy data for \"NoRecentDocsHistory\" not formatted correctly, type=%d, len=%d\n",
1108 type, datalen);
1109 return;
1110 }
1111
1112 TRACE("policy value for NoRecentDocsHistory = %08x\n", data[0]);
1113 /* now test the actual policy value */
1114 if ( data[0] != 0)
1115 return;
1116 }
1117
1118 /* Open key to where the necessary info is
1119 */
1120 /* FIXME: This should be done during DLL PROCESS_ATTACH (or THREAD_ATTACH)
1121 * and the close should be done during the _DETACH. The resulting
1122 * key is stored in the DLL global data.
1123 */
1125 "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer",
1126 0, 0, 0, KEY_READ, 0, &HCUbasekey, 0)) {
1127 ERR("Failed to create 'Software\\Microsoft\\Windows\\CurrentVersion\\Explorer'\n");
1128 return;
1129 }
1130
1131 /* Get path to user's "Recent" directory
1132 */
1133 if(SUCCEEDED(SHGetMalloc(&ppM))) {
1135 &pidl))) {
1136 SHGetPathFromIDListA(pidl, link_dir);
1137 IMalloc_Free(ppM, pidl);
1138 }
1139 else {
1140 /* serious issues */
1141 link_dir[0] = 0;
1142 ERR("serious issues 1\n");
1143 }
1144 IMalloc_Release(ppM);
1145 }
1146 else {
1147 /* serious issues */
1148 link_dir[0] = 0;
1149 ERR("serious issues 2\n");
1150 }
1151 TRACE("Users Recent dir %s\n", link_dir);
1152
1153 /* If no input, then go clear the lists */
1154 if (!pv) {
1155 /* clear user's Recent dir
1156 */
1157
1158 /* FIXME: delete all files in "link_dir"
1159 *
1160 * while( more files ) {
1161 * lstrcpyA(old_lnk_name, link_dir);
1162 * PathAppendA(old_lnk_name, filenam);
1163 * DeleteFileA(old_lnk_name);
1164 * }
1165 */
1166 FIXME("should delete all files in %s\\\n", link_dir);
1167
1168 /* clear MRU list
1169 */
1170 /* MS Bug ?? v4.72.3612.1700 of shell32 does the delete against
1171 * HKEY_LOCAL_MACHINE version of ...CurrentVersion\Explorer
1172 * and naturally it fails w/ rc=2. It should do it against
1173 * HKEY_CURRENT_USER which is where it is stored, and where
1174 * the MRU routines expect it!!!!
1175 */
1176 RegDeleteKeyA(HCUbasekey, "RecentDocs");
1177 RegCloseKey(HCUbasekey);
1178 return;
1179 }
1180
1181 /* Have data to add, the jobs to be done:
1182 * 1. Add document to MRU list in registry "HKCU\Software\
1183 * Microsoft\Windows\CurrentVersion\Explorer\RecentDocs".
1184 * 2. Add shortcut to document in the user's Recent directory
1185 * (CSIDL_RECENT).
1186 * 3. Add shortcut to Start menu's Documents submenu.
1187 */
1188
1189 /* Get the pure document name from the input
1190 */
1191 switch (uFlags)
1192 {
1193 case SHARD_PIDL:
1194 if (!SHGetPathFromIDListA(pv, doc_name))
1195 {
1196 WARN("can't get path from PIDL\n");
1197 return;
1198 }
1199 break;
1200
1201 case SHARD_PATHA:
1202 lstrcpynA(doc_name, pv, MAX_PATH);
1203 break;
1204
1205 case SHARD_PATHW:
1206 WideCharToMultiByte(CP_ACP, 0, pv, -1, doc_name, MAX_PATH, NULL, NULL);
1207 break;
1208
1209 default:
1210 FIXME("Unsupported flags: %u\n", uFlags);
1211 return;
1212 }
1213
1214 TRACE("full document name %s\n", debugstr_a(doc_name));
1215
1216 PathStripPathA(doc_name);
1217 TRACE("stripped document name %s\n", debugstr_a(doc_name));
1218
1219
1220 /* *** JOB 1: Update registry for ...\Explorer\RecentDocs list *** */
1221
1222 { /* on input needs:
1223 * doc_name - pure file-spec, no path
1224 * link_dir - path to the user's Recent directory
1225 * HCUbasekey - key of ...Windows\CurrentVersion\Explorer" node
1226 * creates:
1227 * new_lnk_name- pure file-spec, no path for new .lnk file
1228 * new_lnk_filepath
1229 * - path and file name of new .lnk file
1230 */
1231 CREATEMRULISTA mymru;
1232 HANDLE mruhandle;
1233 INT len, pos, bufused, err;
1234 INT i;
1235 DWORD attr;
1236 CHAR buffer[2048];
1237 CHAR *ptr;
1238 CHAR old_lnk_name[MAX_PATH];
1239 short int slen;
1240
1241 mymru.cbSize = sizeof(CREATEMRULISTA);
1242 mymru.nMaxItems = 15;
1244 mymru.hKey = HCUbasekey;
1245 mymru.lpszSubKey = "RecentDocs";
1246 mymru.lpfnCompare = SHADD_compare_mru;
1247 mruhandle = CreateMRUListA(&mymru);
1248 if (!mruhandle) {
1249 /* MRU failed */
1250 ERR("MRU processing failed, handle zero\n");
1251 RegCloseKey(HCUbasekey);
1252 return;
1253 }
1254 len = lstrlenA(doc_name);
1255 pos = FindMRUData(mruhandle, doc_name, len, 0);
1256
1257 /* Now get the MRU entry that will be replaced
1258 * and delete the .lnk file for it
1259 */
1260 if ((bufused = EnumMRUListA(mruhandle, (pos == -1) ? 14 : pos,
1261 buffer, 2048)) != -1) {
1262 ptr = buffer;
1263 ptr += (lstrlenA(buffer) + 1);
1264 slen = *((short int*)ptr);
1265 ptr += 2; /* skip the length area */
1266 if (bufused >= slen + (ptr-buffer)) {
1267 /* buffer size looks good */
1268 ptr += 12; /* get to string */
1269 len = bufused - (ptr-buffer); /* get length of buf remaining */
1270 if (ptr[0] && (lstrlenA(ptr) <= len-1)) {
1271 /* appears to be good string */
1272 lstrcpyA(old_lnk_name, link_dir);
1273 PathAppendA(old_lnk_name, ptr);
1274 if (!DeleteFileA(old_lnk_name)) {
1275 if ((attr = GetFileAttributesA(old_lnk_name)) == INVALID_FILE_ATTRIBUTES) {
1276 if ((err = GetLastError()) != ERROR_FILE_NOT_FOUND) {
1277 ERR("Delete for %s failed, err=%d, attr=%08x\n",
1278 old_lnk_name, err, attr);
1279 }
1280 else {
1281 TRACE("old .lnk file %s did not exist\n",
1282 old_lnk_name);
1283 }
1284 }
1285 else {
1286 ERR("Delete for %s failed, attr=%08x\n",
1287 old_lnk_name, attr);
1288 }
1289 }
1290 else {
1291 TRACE("deleted old .lnk file %s\n", old_lnk_name);
1292 }
1293 }
1294 }
1295 }
1296
1297 /* Create usable .lnk file name for the "Recent" directory
1298 */
1299 wsprintfA(new_lnk_name, "%s.lnk", doc_name);
1300 lstrcpyA(new_lnk_filepath, link_dir);
1301 PathAppendA(new_lnk_filepath, new_lnk_name);
1302 i = 1;
1303 olderrormode = SetErrorMode(SEM_FAILCRITICALERRORS);
1304 while (GetFileAttributesA(new_lnk_filepath) != INVALID_FILE_ATTRIBUTES) {
1305 i++;
1306 wsprintfA(new_lnk_name, "%s (%u).lnk", doc_name, i);
1307 lstrcpyA(new_lnk_filepath, link_dir);
1308 PathAppendA(new_lnk_filepath, new_lnk_name);
1309 }
1310 SetErrorMode(olderrormode);
1311 TRACE("new shortcut will be %s\n", new_lnk_filepath);
1312
1313 /* Now add the new MRU entry and data
1314 */
1315 pos = SHADD_create_add_mru_data(mruhandle, doc_name, new_lnk_name,
1316 buffer, &len);
1317 FreeMRUList(mruhandle);
1318 TRACE("Updated MRU list, new doc is position %d\n", pos);
1319 }
1320
1321 /* *** JOB 2: Create shortcut in user's "Recent" directory *** */
1322
1323 { /* on input needs:
1324 * doc_name - pure file-spec, no path
1325 * new_lnk_filepath
1326 * - path and file name of new .lnk file
1327 * uFlags[in] - flags on call to SHAddToRecentDocs
1328 * pv[in] - document path/pidl on call to SHAddToRecentDocs
1329 */
1330 IShellLinkA *psl = NULL;
1331 IPersistFile *pPf = NULL;
1332 HRESULT hres;
1334 WCHAR widelink[MAX_PATH];
1335
1336 CoInitialize(0);
1337
1338 hres = CoCreateInstance( &CLSID_ShellLink,
1339 NULL,
1340 CLSCTX_INPROC_SERVER,
1341 &IID_IShellLinkA,
1342 (LPVOID )&psl);
1343 if(SUCCEEDED(hres)) {
1344
1345 hres = IShellLinkA_QueryInterface(psl, &IID_IPersistFile,
1346 (LPVOID *)&pPf);
1347 if(FAILED(hres)) {
1348 /* bombed */
1349 ERR("failed QueryInterface for IPersistFile %08x\n", hres);
1350 goto fail;
1351 }
1352
1353 /* Set the document path or pidl */
1354 if (uFlags == SHARD_PIDL) {
1355 hres = IShellLinkA_SetIDList(psl, pv);
1356 } else {
1357 hres = IShellLinkA_SetPath(psl, pv);
1358 }
1359 if(FAILED(hres)) {
1360 /* bombed */
1361 ERR("failed Set{IDList|Path} %08x\n", hres);
1362 goto fail;
1363 }
1364
1365 lstrcpyA(desc, "Shortcut to ");
1366 lstrcatA(desc, doc_name);
1367 hres = IShellLinkA_SetDescription(psl, desc);
1368 if(FAILED(hres)) {
1369 /* bombed */
1370 ERR("failed SetDescription %08x\n", hres);
1371 goto fail;
1372 }
1373
1374 MultiByteToWideChar(CP_ACP, 0, new_lnk_filepath, -1,
1375 widelink, MAX_PATH);
1376 /* create the short cut */
1377 hres = IPersistFile_Save(pPf, widelink, TRUE);
1378 if(FAILED(hres)) {
1379 /* bombed */
1380 ERR("failed IPersistFile::Save %08x\n", hres);
1381 IPersistFile_Release(pPf);
1382 IShellLinkA_Release(psl);
1383 goto fail;
1384 }
1385 hres = IPersistFile_SaveCompleted(pPf, widelink);
1386 IPersistFile_Release(pPf);
1387 IShellLinkA_Release(psl);
1388 TRACE("shortcut %s has been created, result=%08x\n",
1389 new_lnk_filepath, hres);
1390 }
1391 else {
1392 ERR("CoCreateInstance failed, hres=%08x\n", hres);
1393 }
1394 }
1395
1396 fail:
1398
1399 /* all done */
1400 RegCloseKey(HCUbasekey);
1401 return;
1402#endif
1403}
Definition: bufpool.h:45
INT(CALLBACK * MRUCMPPROCW)(LPCWSTR, LPCWSTR)
HANDLE WINAPI CreateMRUListW(const MRUINFOW *infoW)
static TAGID TAGID find
Definition: db.cpp:155
static const WCHAR szDescription[]
Definition: provider.c:55
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
Definition: reg.c:1096
LONG WINAPI RegCreateKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD Reserved, _In_ LPSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_ LPDWORD lpdwDisposition)
Definition: reg.c:1034
LONG WINAPI RegDeleteKeyA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey)
Definition: reg.c:1224
UINT uFlags
Definition: api.c:59
#define CloseHandle
Definition: compat.h:739
#define OPEN_EXISTING
Definition: compat.h:775
#define lstrcpynA
Definition: compat.h:751
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define GENERIC_READ
Definition: compat.h:135
#define CreateFileW
Definition: compat.h:741
#define lstrcpyW
Definition: compat.h:749
#define FILE_SHARE_READ
Definition: compat.h:136
#define lstrcpynW
Definition: compat.h:738
static const WCHAR *const ext[]
Definition: module.c:53
UINT WINAPI SetErrorMode(IN UINT uMode)
Definition: except.c:751
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
Definition: delete.c:24
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
Definition: delete.c:39
DWORD WINAPI GetFileAttributesA(LPCSTR lpFileName)
Definition: fileinfo.c:636
HANDLE WINAPI FindFirstFileW(IN LPCWSTR lpFileName, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:320
BOOL WINAPI FindClose(HANDLE hFindFile)
Definition: find.c:502
DWORD WINAPI GetFullPathNameW(IN LPCWSTR lpFileName, IN DWORD nBufferLength, OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart)
Definition: path.c:1106
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:1964
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:2067
HRESULT WINAPI SHGetMalloc(LPMALLOC *lpmal)
Definition: shellole.c:285
HRESULT WINAPI SHGetSpecialFolderLocation(HWND hwndOwner, INT nFolder, LPITEMIDLIST *ppidl)
Definition: shellpath.c:3225
BOOL WINAPI SHGetSpecialFolderPathW(HWND hwndOwner, LPWSTR szPath, int nFolder, BOOL bCreate)
Definition: shellpath.c:3092
void WINAPI PathStripPathA(LPSTR lpszPath)
Definition: path.c:677
LPWSTR WINAPI PathFindFileNameW(LPCWSTR lpszPath)
Definition: path.c:394
LPWSTR WINAPI PathFindExtensionW(LPCWSTR lpszPath)
Definition: path.c:447
BOOL WINAPI PathFileExistsW(LPCWSTR lpszPath)
Definition: path.c:1777
BOOL WINAPI PathIsDirectoryW(LPCWSTR lpszPath)
Definition: path.c:1723
DWORD WINAPI SHDeleteKeyW(HKEY hKey, LPCWSTR lpszSubKey)
Definition: reg.c:1546
LPWSTR WINAPI StrCatBuffW(LPWSTR lpszStr, LPCWSTR lpszCat, INT cchMax)
Definition: string.c:1444
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
int const JOCTET unsigned int datalen
Definition: jpeglib.h:1031
LPSTR WINAPI lstrcatA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:123
#define error(str)
Definition: mkdosfs.c:1605
LPCWSTR szPath
Definition: env.c:37
static const WCHAR desc[]
Definition: protectdata.c:36
HRESULT hres
Definition: protocol.c:465
_In_ HANDLE hFile
Definition: mswsock.h:90
#define SEM_FAILCRITICALERRORS
Definition: rtltypes.h:69
#define KEY_WRITE
Definition: nt_native.h:1031
#define GENERIC_WRITE
Definition: nt_native.h:90
const GUID IID_IPersistFile
#define PathAppendA
Definition: pathcch.h:308
#define PathAppendW
Definition: pathcch.h:309
long LONG
Definition: pedump.c:60
BOOL WINAPI SHGetPathFromIDListA(LPCITEMIDLIST pidl, LPSTR pszPath)
Definition: pidl.c:1291
BOOL WINAPI SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath)
Definition: pidl.c:1353
#define err(...)
#define REG_DWORD
Definition: sdbapi.c:596
static INT CALLBACK SHADD_compare_mru(LPCVOID data1, LPCVOID data2, DWORD cbData)
Definition: shellord.c:690
#define MRUF_BINARY_LIST
Definition: shellord.c:66
#define MRUF_DELAYED_SAVE
Definition: shellord.c:67
INT WINAPI FindMRUData(HANDLE hList, LPCVOID lpData, DWORD cbData, LPINT lpRegNum)
HANDLE WINAPI CreateMRUListA(LPCREATEMRULISTA lpcml)
VOID WINAPI FreeMRUList(HANDLE hMRUList)
static INT SHADD_create_add_mru_data(HANDLE mruhandle, LPCSTR doc_name, LPCSTR new_lnk_name, LPSTR buffer, INT *len)
Definition: shellord.c:758
static INT SHADD_get_policy(LPCSTR policy, LPDWORD type, LPVOID buffer, LPDWORD len)
Definition: shellord.c:649
INT WINAPI EnumMRUListA(HANDLE hList, INT nItemPos, LPVOID lpBuffer, DWORD nBufferSize)
struct tagCREATEMRULIST CREATEMRULISTA
static IMalloc * ppM
Definition: shlfolder.c:47
HRESULT hr
Definition: shlfolder.c:183
#define CSIDL_RECENT
Definition: shlobj.h:2166
#define SHARD_PATHW
Definition: shlobj.h:1169
#define SHARD_PIDL
Definition: shlobj.h:1167
#define SHARD_PATHA
Definition: shlobj.h:1168
@ REST_NORECENTDOCSHISTORY
Definition: shlobj.h:1659
DWORD WINAPI SHRestricted(RESTRICTIONS rest)
Definition: shpolicy.c:146
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
Definition: cookie.c:202
LPCSTR lpszSubKey
Definition: shellord.c:60
DWORD nMaxItems
Definition: shellord.c:57
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define FindNextFile
Definition: winbase.h:3788
int WINAPIV wsprintfA(_Out_ LPSTR, _In_ _Printf_format_string_ LPCSTR,...)
unsigned char BYTE
Definition: xxhash.c:193

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

◆ SHCreatePropSheetExtArray()

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

Definition at line 2043 of file shellord.c.

2044{
2045 return SHCreatePropSheetExtArrayEx(hKey, pszSubKey, max_iface, NULL);
2046}
FxAutoRegKey hKey
HPSXA WINAPI SHCreatePropSheetExtArrayEx(HKEY hKey, LPCWSTR pszSubKey, UINT max_iface, LPDATAOBJECT pDataObj)
Definition: shellord.c:2051

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

◆ SHCreatePropSheetExtArrayEx()

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

Definition at line 2051 of file shellord.c.

2052{
2053 WCHAR szHandler[64];
2054 DWORD dwHandlerLen;
2055 WCHAR szClsidHandler[39];
2056 DWORD dwClsidSize;
2057 CLSID clsid;
2058 LONG lRet;
2059 DWORD dwIndex;
2060 IShellExtInit *psxi;
2061 IShellPropSheetExt *pspsx;
2062 HKEY hkBase, hkPropSheetHandlers;
2063 PPSXA psxa = NULL;
2064
2065 TRACE("(%p,%s,%u)\n", hKey, debugstr_w(pszSubKey), max_iface);
2066
2067 if (max_iface == 0)
2068 return NULL;
2069
2070 /* Open the registry key */
2071 lRet = RegOpenKeyW(hKey, pszSubKey, &hkBase);
2072 if (lRet != ERROR_SUCCESS)
2073 return NULL;
2074
2075 lRet = RegOpenKeyExW(hkBase, L"shellex\\PropertySheetHandlers", 0, KEY_ENUMERATE_SUB_KEYS, &hkPropSheetHandlers);
2076 RegCloseKey(hkBase);
2077 if (lRet == ERROR_SUCCESS)
2078 {
2079 /* Create and initialize the Property Sheet Extensions Array */
2080 psxa = LocalAlloc(LMEM_FIXED, FIELD_OFFSET(PSXA, pspsx[max_iface]));
2081 if (psxa)
2082 {
2083 ZeroMemory(psxa, FIELD_OFFSET(PSXA, pspsx[max_iface]));
2084 psxa->uiAllocated = max_iface;
2085
2086 /* Enumerate all subkeys and attempt to load the shell extensions */
2087 dwIndex = 0;
2088 do
2089 {
2090 dwHandlerLen = sizeof(szHandler) / sizeof(szHandler[0]);
2091 lRet = RegEnumKeyExW(hkPropSheetHandlers, dwIndex++, szHandler, &dwHandlerLen, NULL, NULL, NULL, NULL);
2092 if (lRet != ERROR_SUCCESS)
2093 {
2094 if (lRet == ERROR_MORE_DATA)
2095 continue;
2096
2097 if (lRet == ERROR_NO_MORE_ITEMS)
2098 lRet = ERROR_SUCCESS;
2099 break;
2100 }
2101
2102 /* The CLSID is stored either in the key itself or in its default value. */
2103 if (FAILED(lRet = SHCLSIDFromStringW(szHandler, &clsid)))
2104 {
2105 dwClsidSize = sizeof(szClsidHandler);
2106 if (SHGetValueW(hkPropSheetHandlers, szHandler, NULL, NULL, szClsidHandler, &dwClsidSize) == ERROR_SUCCESS)
2107 {
2108 /* Force a NULL-termination and convert the string */
2109 szClsidHandler[(sizeof(szClsidHandler) / sizeof(szClsidHandler[0])) - 1] = 0;
2110 lRet = SHCLSIDFromStringW(szClsidHandler, &clsid);
2111 }
2112 }
2113
2114 if (SUCCEEDED(lRet))
2115 {
2116 /* Attempt to get an IShellPropSheetExt and an IShellExtInit instance.
2117 Only if both interfaces are supported it's a real shell extension.
2118 Then call IShellExtInit's Initialize method. */
2119 if (SUCCEEDED(CoCreateInstance(&clsid, NULL, CLSCTX_INPROC_SERVER/* | CLSCTX_NO_CODE_DOWNLOAD */, &IID_IShellPropSheetExt, (LPVOID *)&pspsx)))
2120 {
2121 if (SUCCEEDED(pspsx->lpVtbl->QueryInterface(pspsx, &IID_IShellExtInit, (PVOID *)&psxi)))
2122 {
2123 if (SUCCEEDED(psxi->lpVtbl->Initialize(psxi, NULL, pDataObj, hKey)))
2124 {
2125 /* Add the IShellPropSheetExt instance to the array */
2126 psxa->pspsx[psxa->uiCount++] = pspsx;
2127 }
2128 else
2129 {
2130 psxi->lpVtbl->Release(psxi);
2131 pspsx->lpVtbl->Release(pspsx);
2132 }
2133 }
2134 else
2135 pspsx->lpVtbl->Release(pspsx);
2136 }
2137 }
2138
2139 } while (psxa->uiCount != psxa->uiAllocated);
2140 }
2141 else
2143
2144 RegCloseKey(hkPropSheetHandlers);
2145 }
2146
2147 if (lRet != ERROR_SUCCESS && psxa)
2148 {
2149 SHDestroyPropSheetExtArray((HPSXA)psxa);
2150 psxa = NULL;
2151 }
2152
2153 return (HPSXA)psxa;
2154}
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
#define ERROR_MORE_DATA
Definition: dderror.h:13
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
LONG WINAPI RegEnumKeyExW(_In_ HKEY hKey, _In_ DWORD dwIndex, _Out_ LPWSTR lpName, _Inout_ LPDWORD lpcbName, _Reserved_ LPDWORD lpReserved, _Out_opt_ LPWSTR lpClass, _Inout_opt_ LPDWORD lpcbClass, _Out_opt_ PFILETIME lpftLastWriteTime)
Definition: reg.c:2504
#define ERROR_NO_MORE_ITEMS
Definition: compat.h:105
DWORD WINAPI SHCLSIDFromStringW(LPCWSTR clsid, CLSID *id)
Definition: shellole.c:256
DWORD WINAPI SHGetValueW(HKEY hKey, LPCWSTR lpszSubKey, LPCWSTR lpszValue, LPDWORD pwType, LPVOID pvData, LPDWORD pcbData)
Definition: reg.c:1236
HLOCAL NTAPI LocalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:1390
nsresult QueryInterface(nsIIDRef riid, void **result)
nsrefcnt Release()
REFCLSID clsid
Definition: msctf.c:82
#define KEY_ENUMERATE_SUB_KEYS
Definition: nt_native.h:1019
void WINAPI SHDestroyPropSheetExtArray(HPSXA hpsxa)
Definition: shellord.c:2190
UINT uiAllocated
Definition: shellord.c:1979
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
#define LMEM_FIXED
Definition: winbase.h:368

Referenced by SHCreatePropSheetExtArray().

◆ SHCreateShellFolderView()

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

Definition at line 2500 of file shellord.c.

2502{
2503 IShellView * psf;
2504 HRESULT hRes;
2505
2506 *ppsv = NULL;
2507 if (!pcsfv || pcsfv->cbSize != sizeof(*pcsfv))
2508 return E_INVALIDARG;
2509
2510 TRACE("sf=%p outer=%p callback=%p\n",
2511 pcsfv->pshf, pcsfv->psvOuter, pcsfv->psfvcb);
2512
2513 hRes = IShellView_Constructor(pcsfv->pshf, &psf);
2514 if (FAILED(hRes))
2515 return hRes;
2516
2517 hRes = IShellView_QueryInterface(psf, &IID_IShellView, (LPVOID *)ppsv);
2518 IShellView_Release(psf);
2519
2520 return hRes;
2521}
#define E_INVALIDARG
Definition: ddrawi.h:101
IShellFolderViewCB * psfvcb
Definition: shlobj.h:1351
IShellView * psvOuter
Definition: shlobj.h:1350
UINT cbSize
Definition: shlobj.h:1348
IShellFolder * pshf
Definition: shlobj.h:1349

◆ SHCreateShellFolderViewEx()

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

Definition at line 1419 of file shellord.c.

1422{
1423 IShellView * psf;
1424 HRESULT hRes;
1425
1426 TRACE("sf=%p pidl=%p cb=%p mode=0x%08x parm=%p\n",
1427 psvcbi->pshf, psvcbi->pidl, psvcbi->pfnCallback,
1428 psvcbi->fvm, psvcbi->psvOuter);
1429
1430 *ppv = NULL;
1431 hRes = IShellView_Constructor(psvcbi->pshf, &psf);
1432
1433 if (FAILED(hRes))
1434 return hRes;
1435
1436 hRes = IShellView_QueryInterface(psf, &IID_IShellView, (LPVOID *)ppv);
1437 IShellView_Release(psf);
1438
1439 return hRes;
1440}
REFIID LPVOID * ppv
Definition: atlbase.h:39
FOLDERVIEWMODE fvm
Definition: shlobj.h:1275
IShellView * psvOuter
Definition: shlobj.h:1271
LPFNVIEWCALLBACK pfnCallback
Definition: shlobj.h:1274
PCIDLIST_ABSOLUTE pidl
Definition: shlobj.h:1272
IShellFolder * pshf
Definition: shlobj.h:1270

◆ SHCreateStdEnumFmtEtc()

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

Definition at line 2239 of file shellord.c.

2243{
2244 IEnumFORMATETC *pef;
2245 HRESULT hRes;
2246 TRACE("cf=%d fe=%p pef=%p\n", cFormats, lpFormats, ppenumFormatetc);
2247
2248 hRes = IEnumFORMATETC_Constructor(cFormats, lpFormats, &pef);
2249 if (FAILED(hRes))
2250 return hRes;
2251
2252 IEnumFORMATETC_AddRef(pef);
2253 hRes = IEnumFORMATETC_QueryInterface(pef, &IID_IEnumFORMATETC, (LPVOID*)ppenumFormatetc);
2254 IEnumFORMATETC_Release(pef);
2255
2256 return hRes;
2257}
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 2190 of file shellord.c.

2191{
2192 UINT i;
2193 PPSXA psxa = (PPSXA)hpsxa;
2194
2195 TRACE("(%p)\n", hpsxa);
2196
2197 if (psxa)
2198 {
2199 for (i = 0; i != psxa->uiCount; i++)
2200 {
2201 psxa->pspsx[i]->lpVtbl->Release(psxa->pspsx[i]);
2202 }
2203
2204 LocalFree(psxa);
2205 }
2206}
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1594
ULONG Release()

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

◆ SHDoDragDrop()

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

Definition at line 595 of file shellord.c.

601{
602 FIXME("(%p %p %p 0x%08x %p):stub.\n",
603 hWnd, lpDataObject, lpDropSource, dwOKEffect, pdwEffect);
604 return DoDragDrop(lpDataObject, lpDropSource, dwOKEffect, pdwEffect);
605}
HRESULT WINAPI DoDragDrop(IDataObject *pDataObject, IDropSource *pDropSource, DWORD dwOKEffect, DWORD *pdwEffect)
Definition: ole2.c:753

◆ ShellMessageBoxA()

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

Definition at line 428 of file shellord.c.

435{
436#ifdef __REACTOS__
437 CHAR *szText = NULL, szTitle[100];
438 LPCSTR pszText, pszTitle = szTitle;
439 LPSTR pszTemp;
441 int ret;
442
443 __ms_va_start(args, uType);
444
445 TRACE("(%p,%p,%p,%p,%08x)\n", hInstance, hWnd, lpText, lpCaption, uType);
446
447 if (IS_INTRESOURCE(lpCaption))
449 else
450 pszTitle = lpCaption;
451
452 if (IS_INTRESOURCE(lpText))
453 {
454 /* Retrieve the length of the Unicode string and obtain the maximum
455 * possible length for the corresponding ANSI string (not counting
456 * any possible NULL-terminator). */
457 const WCHAR *ptr;
458 UINT len = LoadStringW(hInstance, LOWORD(lpText), (LPWSTR)&ptr, 0);
459
461 NULL, 0, NULL, NULL);
462
463 if (len)
464 {
465 szText = HeapAlloc(GetProcessHeap(), 0, (len + 1) * sizeof(CHAR));
466 if (szText) LoadStringA(hInstance, LOWORD(lpText), szText, len + 1);
467 }
468 pszText = szText;
469 if (!pszText) {
470 WARN("Failed to load id %d\n", LOWORD(lpText));
472 return 0;
473 }
474 }
475 else
476 pszText = lpText;
477
479 pszText, 0, 0, (LPSTR)&pszTemp, 0, &args);
480
482
483 ret = MessageBoxA(hWnd, pszTemp, pszTitle, uType | MB_SETFOREGROUND);
484
485 HeapFree(GetProcessHeap(), 0, szText);
486 LocalFree(pszTemp);
487 return ret;
488
489#else // __REACTOS__
490
491// Wine version, broken.
492 char szText[100],szTitle[100];
493 LPCSTR pszText = szText, pszTitle = szTitle;
494 LPSTR pszTemp;
496 int ret;
497
498 __ms_va_start(args, uType);
499 /* wvsprintfA(buf,fmt, args); */
500
501 TRACE("(%p,%p,%p,%p,%08x)\n",
502 hInstance,hWnd,lpText,lpCaption,uType);
503
504 if (IS_INTRESOURCE(lpCaption))
505 LoadStringA(hInstance, LOWORD(lpCaption), szTitle, sizeof(szTitle));
506 else
507 pszTitle = lpCaption;
508
509 if (IS_INTRESOURCE(lpText))
510 LoadStringA(hInstance, LOWORD(lpText), szText, sizeof(szText));
511 else
512 pszText = lpText;
513
515 pszText, 0, 0, (LPSTR)&pszTemp, 0, &args);
516
518
519 ret = MessageBoxA(hWnd,pszTemp,pszTitle,uType);
520 LocalFree(pszTemp);
521 return ret;
522#endif
523}
#define ARRAY_SIZE(A)
Definition: main.h:33
HINSTANCE hInstance
Definition: charmap.c:19
DWORD WINAPI FormatMessageA(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPSTR lpBuffer, DWORD nSize, __ms_va_list *args)
Definition: format_msg.c:483
TCHAR szTitle[MAX_LOADSTRING]
Definition: magnifier.c:35
#define LOWORD(l)
Definition: pedump.c:82
#define args
Definition: format.c:66
Definition: match.c:390
#define FORMAT_MESSAGE_FROM_STRING
Definition: winbase.h:421
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
Definition: winbase.h:419
#define __ms_va_list
Definition: windef.h:456
#define __ms_va_end(list)
Definition: windef.h:458
#define __ms_va_start(list, arg)
Definition: windef.h:457
#define MB_SETFOREGROUND
Definition: winuser.h:814
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
int WINAPI MessageBoxA(_In_opt_ HWND hWnd, _In_opt_ LPCSTR lpText, _In_opt_ LPCSTR lpCaption, _In_ UINT uType)
#define IS_INTRESOURCE(i)
Definition: winuser.h:580
int WINAPI LoadStringA(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPSTR lpBuffer, _In_ int cchBufferMax)
const char * LPCSTR
Definition: xmlstorage.h:183

◆ ShellMessageBoxW()

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

Definition at line 357 of file shellord.c.

364{
365 WCHAR szText[100],szTitle[100];
366 LPCWSTR pszText = szText, pszTitle = szTitle;
367 LPWSTR pszTemp;
369 int ret;
370
371 __ms_va_start(args, uType);
372 /* wvsprintfA(buf,fmt, args); */
373
374 TRACE("(%p,%p,%p,%p,%08x)\n",
375 hInstance,hWnd,lpText,lpCaption,uType);
376
377 if (IS_INTRESOURCE(lpCaption))
379 else
380 pszTitle = lpCaption;
381
382 if (IS_INTRESOURCE(lpText))
383 LoadStringW(hInstance, LOWORD(lpText), szText, ARRAY_SIZE(szText));
384 else
385 pszText = lpText;
386
388 pszText, 0, 0, (LPWSTR)&pszTemp, 0, &args);
389
391
392 ret = MessageBoxW(hWnd,pszTemp,pszTitle,uType);
393 LocalFree(pszTemp);
394 return ret;
395}
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 2262 of file shellord.c.

2263{
2264 FIXME("params ignored: %p %p\n", pidlFolder, pidlSaveFile);
2266 {
2267 return FALSE;
2268 }
2269 /* Open the search results folder */
2270 /* FIXME: CSearchBar should be opened as well */
2271 return ShellExecuteW(NULL, NULL, L"explorer.exe", L"::{E17D4FC0-5564-11D1-83F2-00A0C90DC849}", NULL, SW_SHOWNORMAL) > (HINSTANCE)32;
2272}
HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
Definition: shlexec.cpp:2402
@ REST_NOFIND
Definition: shlobj.h:1635
HANDLE HINSTANCE
Definition: typedefs.h:77
#define SW_SHOWNORMAL
Definition: winuser.h:770

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

◆ SHFlushClipboard()

HRESULT WINAPI SHFlushClipboard ( void  )

Definition at line 1762 of file shellord.c.

1763{
1764 return OleFlushClipboard();
1765}
HRESULT WINAPI OleFlushClipboard(void)
Definition: clipboard.c:2293

◆ SHFlushSFCache()

void WINAPI SHFlushSFCache ( void  )

Definition at line 2438 of file shellord.c.

2439{
2440}

◆ SHFreeUnusedLibraries()

void WINAPI SHFreeUnusedLibraries ( void  )

Definition at line 1530 of file shellord.c.

1531{
1532 FIXME("stub\n");
1534}
void WINAPI DECLSPEC_HOTPATCH CoFreeUnusedLibraries(void)
Definition: compobj.c:3701

◆ SHGetImageList()

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

Definition at line 2452 of file shellord.c.

2453{
2454 HIMAGELIST hLarge, hSmall;
2455 HIMAGELIST hNew;
2456 HRESULT ret = E_FAIL;
2457
2458 /* Wine currently only maintains large and small image lists */
2459 if ((iImageList != SHIL_LARGE) && (iImageList != SHIL_SMALL) && (iImageList != SHIL_SYSSMALL))
2460 {
2461 FIXME("Unsupported image list %i requested\n", iImageList);
2462 return E_FAIL;
2463 }
2464
2465 Shell_GetImageLists(&hLarge, &hSmall);
2466#ifndef __REACTOS__
2467 hNew = ImageList_Duplicate(iImageList == SHIL_LARGE ? hLarge : hSmall);
2468
2469 /* Get the interface for the new image list */
2470 if (hNew)
2471 {
2473 ImageList_Destroy(hNew);
2474 }
2475#else
2476 /* Duplicating the imagelist causes the start menu items not to draw on
2477 * the first show. Was the Duplicate necessary for some reason? I believe
2478 * Windows returns the raw pointer here. */
2479 hNew = (iImageList == SHIL_LARGE ? hLarge : hSmall);
2480 ret = IImageList2_QueryInterface((IImageList2 *) hNew, riid, ppv);
2481#endif
2482
2483 return ret;
2484}
#define E_FAIL
Definition: ddrawi.h:102
HRESULT WINAPI HIMAGELIST_QueryInterface(HIMAGELIST himl, REFIID riid, void **ppv)
Definition: imagelist.c:4038
HIMAGELIST WINAPI ImageList_Duplicate(HIMAGELIST himlSrc)
Definition: imagelist.c:1801
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:928
BOOL WINAPI Shell_GetImageLists(HIMAGELIST *lpBigList, HIMAGELIST *lpSmallList)
Definition: iconcache.cpp:683
REFIID riid
Definition: atlbase.h:39
#define SHIL_SYSSMALL
Definition: shellapi.h:187
#define SHIL_SMALL
Definition: shellapi.h:185
#define SHIL_LARGE
Definition: shellapi.h:184

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

◆ SHGetInstanceExplorer()

HRESULT WINAPI SHGetInstanceExplorer ( IUnknown **  lpUnknown)

Definition at line 1506 of file shellord.c.

1507{ TRACE("%p\n", lpUnknown);
1508
1509 *lpUnknown = SHELL32_IExplorerInterface;
1510
1512 return E_FAIL;
1513
1514 IUnknown_AddRef(SHELL32_IExplorerInterface);
1515 return S_OK;
1516}
#define S_OK
Definition: intsafe.h:52
static LPUNKNOWN SHELL32_IExplorerInterface
Definition: shellord.c:1489

Referenced by _SHGetInstanceExplorer(), and SHOpenFolderWindow().

◆ SHGetNewLinkInfoA()

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

Definition at line 2322 of file shellord.c.

2324{
2325 WCHAR wszLinkTo[MAX_PATH];
2326 WCHAR wszDir[MAX_PATH];
2327 WCHAR wszName[MAX_PATH];
2328 BOOL res;
2329
2330 MultiByteToWideChar(CP_ACP, 0, pszLinkTo, -1, wszLinkTo, MAX_PATH);
2331 MultiByteToWideChar(CP_ACP, 0, pszDir, -1, wszDir, MAX_PATH);
2332
2333 res = SHGetNewLinkInfoW(wszLinkTo, wszDir, wszName, pfMustCopy, uFlags);
2334
2335 if (res)
2336 WideCharToMultiByte(CP_ACP, 0, wszName, -1, pszName, MAX_PATH, NULL, NULL);
2337
2338 return res;
2339}
_In_ LPCSTR pszDir
Definition: shellapi.h:584
_In_ LPCSTR _Out_ BOOL * pfMustCopy
Definition: shellapi.h:586
BOOL WINAPI SHGetNewLinkInfoW(LPCWSTR pszLinkTo, LPCWSTR pszDir, LPWSTR pszName, BOOL *pfMustCopy, UINT uFlags)
Definition: shellord.c:2341

Referenced by test_sh_new_link_info().

◆ SHGetNewLinkInfoW()

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

Definition at line 2341 of file shellord.c.

2343{
2344 const WCHAR *basename;
2345 WCHAR *dst_basename;
2346 int i=2;
2347
2348 TRACE("(%s, %s, %p, %p, 0x%08x)\n", debugstr_w(pszLinkTo), debugstr_w(pszDir),
2349 pszName, pfMustCopy, uFlags);
2350
2351 *pfMustCopy = FALSE;
2352
2353 if (uFlags & SHGNLI_PIDL)
2354 {
2355 FIXME("SHGNLI_PIDL flag unsupported\n");
2356 return FALSE;
2357 }
2358
2359 if (uFlags)
2360 FIXME("ignoring flags: 0x%08x\n", uFlags);
2361
2362 /* FIXME: should test if the file is a shortcut or DOS program */
2364 return FALSE;
2365
2366 basename = strrchrW(pszLinkTo, '\\');
2367 if (basename)
2368 basename = basename+1;
2369 else
2370 basename = pszLinkTo;
2371
2372 lstrcpynW(pszName, pszDir, MAX_PATH);
2373 if (!PathAddBackslashW(pszName))
2374 return FALSE;
2375
2376 dst_basename = pszName + strlenW(pszName);
2377
2378 snprintfW(dst_basename, pszName + MAX_PATH - dst_basename, L"%s.lnk", basename);
2379
2381 {
2382 snprintfW(dst_basename, pszName + MAX_PATH - dst_basename, L"%s (%d).lnk", basename, i);
2383 i++;
2384 }
2385
2386 return TRUE;
2387}
static void basename(LPCWSTR path, LPWSTR name)
Definition: profile.c:38
#define PathAddBackslashW
Definition: pathcch.h:301
#define strlenW(s)
Definition: unicode.h:28
#define strrchrW(s, c)
Definition: unicode.h:35
#define snprintfW
Definition: unicode.h:60
#define SHGNLI_PIDL
Definition: shellapi.h:404

Referenced by SHGetNewLinkInfoA(), and SHGetNewLinkInfoWrapW().

◆ SHGetSetSettings()

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

Definition at line 202 of file shellord.c.

203{
204 if(bSet)
205 {
206 FIXME("%p 0x%08x TRUE\n", lpss, dwMask);
207 }
208 else
209 {
210 SHGetSettings((LPSHELLFLAGSTATE)lpss,dwMask);
211 }
212}
VOID WINAPI SHGetSettings(LPSHELLFLAGSTATE lpsfs, DWORD dwMask)
Definition: shellord.c:222

Referenced by DesktopOnInitDialog(), CShellDispatch::GetSetting(), CACListISF::Reset(), START_TEST(), and ViewDlg_Apply().

◆ SHGetSettings()

VOID WINAPI SHGetSettings ( LPSHELLFLAGSTATE  lpsfs,
DWORD  dwMask 
)

Definition at line 222 of file shellord.c.

223{
224 HKEY hKey;
226 DWORD dwDataSize = sizeof (DWORD);
227
228 TRACE("(%p 0x%08x)\n",lpsfs,dwMask);
229
230 if (RegCreateKeyExA(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced",
231 0, 0, 0, KEY_ALL_ACCESS, 0, &hKey, 0))
232 return;
233
234 if ( (SSF_SHOWEXTENSIONS & dwMask) && !RegQueryValueExA(hKey, "HideFileExt", 0, 0, (LPBYTE)&dwData, &dwDataSize))
235 lpsfs->fShowExtensions = ((dwData == 0) ? 0 : 1);
236
237 if ( (SSF_SHOWINFOTIP & dwMask) && !RegQueryValueExA(hKey, "ShowInfoTip", 0, 0, (LPBYTE)&dwData, &dwDataSize))
238 lpsfs->fShowInfoTip = ((dwData == 0) ? 0 : 1);
239
240 if ( (SSF_DONTPRETTYPATH & dwMask) && !RegQueryValueExA(hKey, "DontPrettyPath", 0, 0, (LPBYTE)&dwData, &dwDataSize))
241 lpsfs->fDontPrettyPath = ((dwData == 0) ? 0 : 1);
242
243 if ( (SSF_HIDEICONS & dwMask) && !RegQueryValueExA(hKey, "HideIcons", 0, 0, (LPBYTE)&dwData, &dwDataSize))
244 lpsfs->fHideIcons = ((dwData == 0) ? 0 : 1);
245
246 if ( (SSF_MAPNETDRVBUTTON & dwMask) && !RegQueryValueExA(hKey, "MapNetDrvBtn", 0, 0, (LPBYTE)&dwData, &dwDataSize))
247 lpsfs->fMapNetDrvBtn = ((dwData == 0) ? 0 : 1);
248
249 if ( (SSF_SHOWATTRIBCOL & dwMask) && !RegQueryValueExA(hKey, "ShowAttribCol", 0, 0, (LPBYTE)&dwData, &dwDataSize))
250 lpsfs->fShowAttribCol = ((dwData == 0) ? 0 : 1);
251
252 if (((SSF_SHOWALLOBJECTS | SSF_SHOWSYSFILES) & dwMask) && !RegQueryValueExA(hKey, "Hidden", 0, 0, (LPBYTE)&dwData, &dwDataSize))
253 { if (dwData == 0)
254 { if (SSF_SHOWALLOBJECTS & dwMask) lpsfs->fShowAllObjects = 0;
255 if (SSF_SHOWSYSFILES & dwMask) lpsfs->fShowSysFiles = 0;
256 }
257 else if (dwData == 1)
258 { if (SSF_SHOWALLOBJECTS & dwMask) lpsfs->fShowAllObjects = 1;
259 if (SSF_SHOWSYSFILES & dwMask) lpsfs->fShowSysFiles = 0;
260 }
261 else if (dwData == 2)
262 { if (SSF_SHOWALLOBJECTS & dwMask) lpsfs->fShowAllObjects = 0;
263 if (SSF_SHOWSYSFILES & dwMask) lpsfs->fShowSysFiles = 1;
264 }
265 }
267
268 TRACE("-- 0x%04x\n", *(WORD*)lpsfs);
269}
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
static HANDLE ULONG_PTR dwData
Definition: file.c:35
#define KEY_ALL_ACCESS
Definition: nt_native.h:1041
#define DWORD
Definition: nt_native.h:44
#define SSF_DONTPRETTYPATH
Definition: shlobj.h:1601
#define SSF_SHOWATTRIBCOL
Definition: shlobj.h:1598
#define SSF_SHOWSYSFILES
Definition: shlobj.h:1596
#define SSF_MAPNETDRVBUTTON
Definition: shlobj.h:1603
#define SSF_SHOWEXTENSIONS
Definition: shlobj.h:1594
#define SSF_SHOWALLOBJECTS
Definition: shlobj.h:1593
#define SSF_SHOWINFOTIP
Definition: shlobj.h:1602
#define SSF_HIDEICONS
Definition: shlobj.h:1605
BOOL fMapNetDrvBtn
Definition: shlobj.h:1583
BOOL fShowInfoTip
Definition: shlobj.h:1584
BOOL fHideIcons
Definition: shlobj.h:1586
BOOL fShowExtensions
Definition: shlobj.h:1572
BOOL fShowSysFiles
Definition: shlobj.h:1574
BOOL fDontPrettyPath
Definition: shlobj.h:1581
BOOL fShowAllObjects
Definition: shlobj.h:1571
BOOL fShowAttribCol
Definition: shlobj.h:1582

Referenced by SHGetSetSettings(), and START_TEST().

◆ SHHandleUpdateImage()

INT WINAPI SHHandleUpdateImage ( PCIDLIST_ABSOLUTE  pidlExtra)

Definition at line 2308 of file shellord.c.

2309{
2310 FIXME("%p - stub\n", pidlExtra);
2311
2312 return -1;
2313}

◆ SHLimitInputEdit()

HRESULT WINAPI SHLimitInputEdit ( HWND  hWnd,
IShellFolder psf 
)

Definition at line 2826 of file shellord.c.

2827{
2828 IItemNameLimits *pLimits;
2829 HRESULT hr;
2830 LPWSTR pwszValidChars, pwszInvalidChars;
2831 UxSubclassInfo *pInfo;
2832
2833 pInfo = GetPropW(hWnd, L"UxSubclassInfo");
2834 if (pInfo)
2835 {
2837 pInfo = NULL;
2838 }
2839
2840 hr = psf->lpVtbl->QueryInterface(psf, &IID_IItemNameLimits, (LPVOID *)&pLimits);
2841 if (FAILED(hr))
2842 {
2843 ERR("hr: %x\n", hr);
2844 return hr;
2845 }
2846
2847 pwszValidChars = pwszInvalidChars = NULL;
2848 hr = pLimits->lpVtbl->GetValidCharacters(pLimits, &pwszValidChars, &pwszInvalidChars);
2849 if (FAILED(hr))
2850 {
2851 ERR("hr: %x\n", hr);
2852 pLimits->lpVtbl->Release(pLimits);
2853 return hr;
2854 }
2855
2856 pInfo = UxSubclassInfo_Create(hWnd, pwszValidChars, pwszInvalidChars);
2857 if (!pInfo)
2858 hr = E_FAIL;
2859
2860 pLimits->lpVtbl->Release(pLimits);
2861
2862 return hr;
2863}
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
static UxSubclassInfo * UxSubclassInfo_Create(HWND hwnd, LPWSTR valid, LPWSTR invalid)
Definition: shellord.c:2792

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

◆ SHLoadOLE()

HRESULT WINAPI SHLoadOLE ( LPARAM  lParam)

Definition at line 1715 of file shellord.c.

1716{ FIXME("0x%08lx stub\n",lParam);
1717 return S_OK;
1718}

◆ SHObjectProperties()

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

Definition at line 2315 of file shellord.c.

2316{
2317 FIXME("%p, 0x%08x, %s, %s - stub\n", hwnd, dwType, debugstr_w(szObject), debugstr_w(szPage));
2318
2319 return TRUE;
2320}

◆ SHOutOfMemoryMessageBox()

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

Definition at line 1750 of file shellord.c.

1754{
1755 FIXME("%p %s 0x%08x stub\n",hwndOwner, lpCaption, uType);
1756 return 0;
1757}

◆ SHRegisterDragDrop()

HRESULT WINAPI SHRegisterDragDrop ( HWND  hWnd,
LPDROPTARGET  pDropTarget 
)

Definition at line 541 of file shellord.c.

544{
545 static BOOL ole_initialized = FALSE;
546 HRESULT hr;
547
548 TRACE("(%p,%p)\n", hWnd, pDropTarget);
549
550 if (!ole_initialized)
551 {
553 if (FAILED(hr))
554 return hr;
555 ole_initialized = TRUE;
556 }
557 return RegisterDragDrop(hWnd, pDropTarget);
558}
HRESULT WINAPI DECLSPEC_HOTPATCH OleInitialize(LPVOID reserved)
Definition: ole2.c:169
HRESULT WINAPI RegisterDragDrop(HWND hwnd, LPDROPTARGET pDropTarget)
Definition: ole2.c:557

◆ SHReplaceFromPropSheetExtArray()

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

Definition at line 2159 of file shellord.c.

2160{
2161 PSXA_CALL Call;
2162 UINT i;
2163 PPSXA psxa = (PPSXA)hpsxa;
2164
2165 TRACE("(%p,%u,%p,%08lx)\n", hpsxa, uPageID, lpfnReplaceWith, lParam);
2166
2167 if (psxa)
2168 {
2169 ZeroMemory(&Call, sizeof(Call));
2170 Call.lpfnAddReplaceWith = lpfnReplaceWith;
2171 Call.lParam = lParam;
2172
2173 /* Call the ReplacePage method of all registered IShellPropSheetExt interfaces.
2174 Each shell extension is only allowed to call the callback once during the callback. */
2175 for (i = 0; i != psxa->uiCount; i++)
2176 {
2177 Call.bCalled = FALSE;
2178 psxa->pspsx[i]->lpVtbl->ReplacePage(psxa->pspsx[i], uPageID, PsxaCall, (LPARAM)&Call);
2179 }
2180
2181 return Call.uiCount;
2182 }
2183
2184 return 0;
2185}
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 576 of file shellord.c.

577{
578 TRACE("(%p)\n", hWnd);
579 return RevokeDragDrop(hWnd);
580}
HRESULT WINAPI RevokeDragDrop(HWND hwnd)
Definition: ole2.c:639

◆ SHRunControlPanel()

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

Definition at line 1464 of file shellord.c.

1465{
1466#ifdef __REACTOS__
1467 /*
1468 * TODO: Run in-process when possible, using
1469 * HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel\InProcCPLs
1470 * and possibly some extra rules.
1471 * See also https://docs.microsoft.com/en-us/windows/win32/api/shlobj/nf-shlobj-shruncontrolpanel
1472 * "If the specified Control Panel item is already running, SHRunControlPanel
1473 * attempts to switch to that instance rather than opening a new instance."
1474 * This function is not supported as of Windows Vista, where it always returns FALSE.
1475 * However we need to keep it "alive" even when ReactOS is compliled as NT6+
1476 * in order to keep control panel elements launch commands.
1477 */
1478 WCHAR parameters[MAX_PATH] = L"shell32.dll,Control_RunDLL ";
1479 TRACE("(%s, %p)n", debugstr_w(commandLine), parent);
1480 wcscat(parameters, commandLine);
1481
1482 return ((INT_PTR)ShellExecuteW(parent, L"open", L"rundll32.exe", parameters, NULL, SW_SHOWNORMAL) > 32);
1483#else
1484 FIXME("(%s, %p): stub\n", debugstr_w(commandLine), parent);
1485 return FALSE;
1486#endif
1487}
r parent
Definition: btrfs.c:3010
_CRTIMP wchar_t *__cdecl wcscat(_Inout_updates_z_(_String_length_(_Dest)+_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
int32_t INT_PTR
Definition: typedefs.h:64

Referenced by CShellDispatch::ControlPanelItem().

◆ SHSetInstanceExplorer()

VOID WINAPI SHSetInstanceExplorer ( LPUNKNOWN  lpUnknown)

Definition at line 1496 of file shellord.c.

1497{ TRACE("%p\n", lpUnknown);
1498 SHELL32_IExplorerInterface = lpUnknown;
1499}

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

◆ SHSetLocalizedName()

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

Definition at line 2404 of file shellord.c.

2405{
2406 FIXME("%p, %s, %d - stub\n", pszPath, debugstr_w(pszResModule), idsRes);
2407
2408 return S_OK;
2409}

◆ SHShellFolderView_Message()

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

Definition at line 291 of file shellord.c.

295{
296 FIXME("%p %08x %08lx stub\n",hwndCabinet, uMessage, lParam);
297 return 0;
298}

◆ SHStartNetConnectionDialog()

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

Definition at line 2389 of file shellord.c.

2390{
2391#ifdef __REACTOS__
2392 if (SHELL_OsIsUnicode())
2393 return SHStartNetConnectionDialogW(hwnd, (LPCWSTR)pszRemoteName, dwType);
2394 return SHStartNetConnectionDialogA(hwnd, pszRemoteName, dwType);
2395#else
2396 FIXME("%p, %s, 0x%08x - stub\n", hwnd, debugstr_a(pszRemoteName), dwType);
2397
2398 return S_OK;
2399#endif
2400}
EXTERN_C HRESULT WINAPI SHStartNetConnectionDialogW(_In_ HWND hwnd, _In_ LPCWSTR pszRemoteName, _In_ DWORD dwType)
Definition: stubs.cpp:596
EXTERN_C HRESULT WINAPI SHStartNetConnectionDialogA(_In_ HWND hwnd, _In_ LPCSTR pszRemoteName, _In_ DWORD dwType)
Definition: utils.cpp:1110

◆ SHTestTokenMembership()

EXTERN_C BOOL WINAPI SHTestTokenMembership ( HANDLE  TokenHandle,
ULONG  ulRID 
)

Definition at line 2534 of file shellord.c.

2535{
2537 DWORD nSubAuthority0, nSubAuthority1;
2538 DWORD nSubAuthorityCount;
2539 PSID SidToCheck;
2540 BOOL IsMember = FALSE;
2541
2542 if ((ulRID == SECURITY_SERVICE_RID) || ulRID == SECURITY_LOCAL_SYSTEM_RID)
2543 {
2544 nSubAuthority0 = ulRID;
2545 nSubAuthority1 = 0;
2546 nSubAuthorityCount= 1;
2547 }
2548 else
2549 {
2550 nSubAuthority0 = SECURITY_BUILTIN_DOMAIN_RID;
2551 nSubAuthority1 = ulRID;
2552 nSubAuthorityCount= 2;
2553 }
2554
2555 if (!AllocateAndInitializeSid(&ntAuth,
2556 nSubAuthorityCount,
2557 nSubAuthority0,
2558 nSubAuthority1,
2559 0, 0, 0, 0, 0, 0,
2560 &SidToCheck))
2561 {
2562 return FALSE;
2563 }
2564
2565 if (!CheckTokenMembership(TokenHandle, SidToCheck, &IsMember))
2566 {
2567 IsMember = FALSE;
2568 }
2569
2570 FreeSid(SidToCheck);
2571 return IsMember;
2572}
BOOL WINAPI CheckTokenMembership(IN HANDLE ExistingTokenHandle, IN PSID SidToCheck, OUT PBOOL IsMember)
Definition: token.c:21
BOOL WINAPI AllocateAndInitializeSid(PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority, BYTE nSubAuthorityCount, DWORD nSubAuthority0, DWORD nSubAuthority1, DWORD nSubAuthority2, DWORD nSubAuthority3, DWORD nSubAuthority4, DWORD nSubAuthority5, DWORD nSubAuthority6, DWORD nSubAuthority7, PSID *pSid)
Definition: security.c:674
PVOID WINAPI FreeSid(PSID pSid)
Definition: security.c:698
_In_ ACCESS_MASK _In_ ULONG _Out_ PHANDLE TokenHandle
Definition: psfuncs.h:726
#define SECURITY_BUILTIN_DOMAIN_RID
Definition: setypes.h:581
#define SECURITY_SERVICE_RID
Definition: setypes.h:562
#define SECURITY_LOCAL_SYSTEM_RID
Definition: setypes.h:574
#define SECURITY_NT_AUTHORITY
Definition: setypes.h:554

Referenced by IsUserAnAdmin().

◆ SHUpdateImageA()

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

Definition at line 2303 of file shellord.c.

2304{
2305 FIXME("%s, %d, 0x%x, %d - stub\n", debugstr_a(pszHashItem), iIndex, uFlags, iImageIndex);
2306}

◆ SHUpdateImageW()

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

Definition at line 2293 of file shellord.c.

2294{
2295 FIXME("%s, %d, 0x%x, %d - stub\n", debugstr_w(pszHashItem), iIndex, uFlags, iImageIndex);
2296}

◆ SHValidateUNC()

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

Definition at line 1794 of file shellord.c.

1795{
1796 FIXME("(%p, %s, 0x%08x): stub\n", hwndOwner, debugstr_w(pszFile), fConnect);
1797 return FALSE;
1798}

◆ SHWaitForFileToOpen()

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

Definition at line 1771 of file shellord.c.

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

◆ SHWinHelp()

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

Definition at line 1447 of file shellord.c.

1448{
1449 TRACE("(%p, %s, 0x%08x, %p)\n", hwnd, debugstr_w(pszHelp), uCommand, dwData);
1450 if (!WinHelpW(hwnd, pszHelp, uCommand, dwData))
1451 {
1452#if 0
1455#endif
1456 return FALSE;
1457 }
1458 return TRUE;
1459}
#define shell32_hInstance
#define ShellMessageBoxW
Definition: precomp.h:59
BOOL WINAPI WinHelpW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_ UINT, _In_ ULONG_PTR)
#define MB_ICONSTOP
Definition: winuser.h:803
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582

◆ SignalFileOpen()

BOOL WINAPI SignalFileOpen ( PCIDLIST_ABSOLUTE  pidl)

Definition at line 627 of file shellord.c.

628{
629 FIXME("(%p):stub.\n", pidl);
630
631 return FALSE;
632}

◆ UxSubclassInfo_Create()

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

Definition at line 2792 of file shellord.c.

2793{
2794 UxSubclassInfo *pInfo;
2796 if (!pInfo)
2797 {
2798 ERR("HeapAlloc failed.\n");
2801 return NULL;
2802 }
2803
2805 if (!pInfo->fnWndProc)
2806 {
2807 ERR("SetWindowLongPtrW failed\n");
2810 HeapFree(GetProcessHeap(), 0, pInfo);
2811 return NULL;
2812 }
2813
2814 pInfo->hwnd = hwnd;
2815 pInfo->pwszValidChars = valid;
2816 pInfo->pwszInvalidChars = invalid;
2817 if (!SetPropW(hwnd, L"UxSubclassInfo", pInfo))
2818 {
2820 pInfo = NULL;
2821 }
2822 return pInfo;
2823}
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
BOOLEAN valid
static const WCHAR invalid[]
Definition: assoc.c:39
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
static LRESULT CALLBACK LimitEditWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: shellord.c:2699
#define GWLP_WNDPROC
Definition: treelist.c:66
BOOL WINAPI SetPropW(_In_ HWND, _In_ LPCWSTR, _In_opt_ HANDLE)
#define SetWindowLongPtrW
Definition: winuser.h:5346

Referenced by SHLimitInputEdit().

◆ UxSubclassInfo_Destroy()

static void UxSubclassInfo_Destroy ( UxSubclassInfo pInfo)
static

Definition at line 2606 of file shellord.c.

2607{
2608 if (!pInfo)
2609 return;
2610
2611 RemovePropW(pInfo->hwnd, L"UxSubclassInfo");
2612
2615
2617
2618 HeapFree(GetProcessHeap(), 0, pInfo);
2619}
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 1656 of file shellord.c.

1657{
1658 DWORD r;
1659 HKEY hkey = 0;
1660
1661 TRACE("%p\n",cs);
1662
1663 if( cs == NULL )
1664 return FALSE;
1665
1666 r = RegCreateKeyExW( HKEY_CURRENT_USER, L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\CabinetState", 0,
1667 NULL, 0, KEY_ALL_ACCESS, NULL, &hkey, NULL);
1668 if( r == ERROR_SUCCESS )
1669 {
1670 r = RegSetValueExW( hkey, L"Settings", 0,
1671 REG_BINARY, (LPBYTE) cs, cs->cLength);
1672
1673 RegCloseKey( hkey );
1674 }
1675
1676 return (r==ERROR_SUCCESS);
1677}
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4882

Referenced by IntSetNewWindowMode().

Variable Documentation

◆ SHELL32_IExplorerInterface

LPUNKNOWN SHELL32_IExplorerInterface =0
static

Definition at line 1489 of file shellord.c.

Referenced by SHGetInstanceExplorer(), and SHSetInstanceExplorer().