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

Go to the source code of this file.

Classes

struct  tagCREATEMRULIST
 
struct  _PSXA
 
struct  _PSXA_CALL
 
struct  UxSubclassInfo
 

Macros

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

Typedefs

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

Functions

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

Variables

static LPUNKNOWN SHELL32_IExplorerInterface =0
 

Macro Definition Documentation

◆ _INC_WINDOWS

#define _INC_WINDOWS

Definition at line 26 of file shellord.c.

◆ COBJMACROS

#define COBJMACROS

Definition at line 27 of file shellord.c.

◆ MRUF_BINARY_LIST

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

Definition at line 66 of file shellord.c.

◆ MRUF_DELAYED_SAVE

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

Definition at line 67 of file shellord.c.

◆ MRUF_STRING_LIST

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

Definition at line 65 of file shellord.c.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 25 of file shellord.c.

Typedef Documentation

◆ CREATEMRULISTA

◆ LPCREATEMRULISTA

◆ PPSXA

typedef struct _PSXA * PPSXA

◆ PPSXA_CALL

◆ PSXA

typedef struct _PSXA PSXA

◆ PSXA_CALL

◆ UxSubclassInfo

Function Documentation

◆ AddMRUData()

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

Definition at line 462 of file comctl32undoc.c.

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

Referenced by SHADD_create_add_mru_data(), and SHAddToRecentDocs().

◆ ArrangeWindows()

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

Definition at line 809 of file shellord.c.

811{
812 /* Unimplemented in WinXP SP3 */
813 TRACE("(%p 0x%08x %p 0x%04x %p):stub.\n",
814 hwndParent, dwReserved, lpRect, cKids, lpKids);
815 return 0;
816}
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 2419 of file shellord.c.

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

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

◆ CreateMRUListA()

HANDLE WINAPI CreateMRUListA ( LPCREATEMRULISTA  lpcml)

Referenced by SHAddToRecentDocs().

◆ DAD_AutoScroll()

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

Definition at line 1737 of file shellord.c.

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

◆ DAD_DragEnter()

BOOL WINAPI DAD_DragEnter ( HWND  hwnd)

Definition at line 1746 of file shellord.c.

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

◆ DAD_DragEnterEx()

BOOL WINAPI DAD_DragEnterEx ( HWND  hwnd,
POINT  p 
)

Definition at line 1755 of file shellord.c.

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

◆ DAD_DragLeave()

BOOL WINAPI DAD_DragLeave ( VOID  )

Definition at line 1773 of file shellord.c.

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

◆ DAD_DragMove()

BOOL WINAPI DAD_DragMove ( POINT  p)

Definition at line 1764 of file shellord.c.

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

◆ DAD_SetDragImage()

BOOL WINAPI DAD_SetDragImage ( HIMAGELIST  himlTrack,
LPPOINT  lppt 
)

Definition at line 1784 of file shellord.c.

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

◆ DAD_ShowDragImage()

BOOL WINAPI DAD_ShowDragImage ( BOOL  bShow)

Definition at line 1797 of file shellord.c.

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

◆ DoEnvironmentSubstA()

DWORD WINAPI DoEnvironmentSubstA ( LPSTR  pszString,
UINT  cchString 
)

Definition at line 2011 of file shellord.c.

2012{
2013 LPSTR dst;
2014 BOOL res = FALSE;
2015 DWORD len = cchString;
2016
2017 TRACE("(%s, %d)\n", debugstr_a(pszString), cchString);
2018 if (pszString == NULL) /* Really return 0? */
2019 return 0;
2020 if ((dst = (LPSTR)HeapAlloc(GetProcessHeap(), 0, cchString * sizeof(CHAR))))
2021 {
2023 /* len includes the terminating 0 */
2024 if (len && len < cchString)
2025 {
2026 res = TRUE;
2028 }
2029 else
2030 len = cchString;
2031
2033 }
2034 return MAKELONG(len, res);
2035}
#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 2086 of file shellord.c.

2087{
2088 if (SHELL_OsIsUnicode())
2089 return DoEnvironmentSubstW(x, y);
2090 return DoEnvironmentSubstA(x, y);
2091}
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:154
DWORD WINAPI DoEnvironmentSubstW(LPWSTR pszString, UINT cchString)
Definition: shellord.c:2056
DWORD WINAPI DoEnvironmentSubstA(LPSTR pszString, UINT cchString)
Definition: shellord.c:2011

◆ DoEnvironmentSubstW()

DWORD WINAPI DoEnvironmentSubstW ( LPWSTR  pszString,
UINT  cchString 
)

Definition at line 2056 of file shellord.c.

2057{
2058 LPWSTR dst;
2059 BOOL res = FALSE;
2060 DWORD len = cchString;
2061
2062 TRACE("(%s, %d)\n", debugstr_w(pszString), cchString);
2063
2064 if ((cchString < MAXLONG) && (dst = HeapAlloc(GetProcessHeap(), 0, cchString * sizeof(WCHAR))))
2065 {
2067 /* len includes the terminating 0 */
2068 if (len && len <= cchString)
2069 {
2070 res = TRUE;
2071 memcpy(pszString, dst, len * sizeof(WCHAR));
2072 }
2073 else
2074 len = cchString;
2075
2077 }
2078 return MAKELONG(len, res);
2079}
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 2877 of file shellord.c.

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

Referenced by LimitEditWindowProc().

◆ DoSanitizeText()

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

Definition at line 2844 of file shellord.c.

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

Referenced by DoSanitizeClipboard().

◆ DriveType()

int WINAPI DriveType ( int  DriveType)

Definition at line 1929 of file shellord.c.

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

◆ EnumMRUListA()

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

Definition at line 860 of file comctl32undoc.c.

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

Referenced by SHAddToRecentDocs().

◆ FileIconInit()

BOOL WINAPI FileIconInit ( BOOL  bFullInit)

Definition at line 1889 of file shellord.c.

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

Referenced by DisplayImageList(), and StartWithDesktop().

◆ FindMRUData()

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

Definition at line 388 of file comctl32undoc.c.

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

Referenced by SHAddToRecentDocs().

◆ FreeMRUList()

VOID WINAPI FreeMRUList ( HANDLE  hMRUList)

Definition at line 348 of file comctl32undoc.c.

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

Referenced by SHAddToRecentDocs().

◆ GetFileNameFromBrowse()

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

Definition at line 154 of file shellord.c.

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

◆ GUIDFromStringA()

BOOL WINAPI GUIDFromStringA ( LPCSTR  str,
LPGUID  guid 
)

Definition at line 2096 of file shellord.c.

2097{
2098 ANSI_STRING ansi_str;
2099 WCHAR szWide[40];
2100 UNICODE_STRING guid_str = { 0, sizeof(szWide), szWide };
2101 if (*str != '{')
2102 return FALSE;
2103 RtlInitAnsiString(&ansi_str, str);
2104 return !RtlAnsiStringToUnicodeString(&guid_str, &ansi_str, FALSE) &&
2105 !RtlGUIDFromString(&guid_str, guid);
2106}
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 2111 of file shellord.c.

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

◆ InvalidateDriveType()

int WINAPI InvalidateDriveType ( int  u)

Definition at line 1939 of file shellord.c.

1940{
1941 TRACE("0x%08x stub\n",u);
1942 return 0;
1943}
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 2808 of file shellord.c.

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

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

◆ LimitEditWindowProc()

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

Definition at line 2921 of file shellord.c.

2922{
2923 WNDPROC fnWndProc;
2924 WCHAR wch;
2925 UxSubclassInfo *pInfo = GetPropW(hwnd, L"UxSubclassInfo");
2926 if (!pInfo)
2927 return DefWindowProcW(hwnd, uMsg, wParam, lParam);
2928
2929 fnWndProc = pInfo->fnWndProc;
2930
2931 switch (uMsg)
2932 {
2933 case WM_KEYDOWN:
2934 if (GetKeyState(VK_SHIFT) < 0 && wParam == VK_INSERT)
2935 DoSanitizeClipboard(hwnd, pInfo);
2936 else if (GetKeyState(VK_CONTROL) < 0 && wParam == L'V')
2937 DoSanitizeClipboard(hwnd, pInfo);
2938
2939 return CallWindowProcW(fnWndProc, hwnd, uMsg, wParam, lParam);
2940
2941 case WM_PASTE:
2942 DoSanitizeClipboard(hwnd, pInfo);
2943 return CallWindowProcW(fnWndProc, hwnd, uMsg, wParam, lParam);
2944
2945 case WM_CHAR:
2946 if (GetKeyState(VK_CONTROL) < 0 && wParam == L'V')
2947 break;
2948
2949 if (pInfo->pwszInvalidChars)
2950 {
2951 if (wcschr(pInfo->pwszInvalidChars, (WCHAR)wParam) != NULL)
2952 {
2953 MessageBeep(0xFFFFFFFF);
2954 break;
2955 }
2956 }
2957 else if (pInfo->pwszValidChars)
2958 {
2959 if (wcschr(pInfo->pwszValidChars, (WCHAR)wParam) == NULL)
2960 {
2961 MessageBeep(0xFFFFFFFF);
2962 break;
2963 }
2964 }
2965 return CallWindowProcW(fnWndProc, hwnd, uMsg, wParam, lParam);
2966
2967 case WM_UNICHAR:
2968 if (wParam == UNICODE_NOCHAR)
2969 return TRUE;
2970
2971 /* FALL THROUGH */
2972
2973 case WM_IME_CHAR:
2974 wch = (WCHAR)wParam;
2975 if (GetKeyState(VK_CONTROL) < 0 && wch == L'V')
2976 break;
2977
2978 if (!IsWindowUnicode(hwnd) && HIBYTE(wch) != 0)
2979 {
2980 CHAR data[] = {HIBYTE(wch), LOBYTE(wch)};
2981 MultiByteToWideChar(CP_ACP, 0, data, 2, &wch, 1);
2982 }
2983
2984 if (pInfo->pwszInvalidChars)
2985 {
2986 if (wcschr(pInfo->pwszInvalidChars, wch) != NULL)
2987 {
2988 MessageBeep(0xFFFFFFFF);
2989 break;
2990 }
2991 }
2992 else if (pInfo->pwszValidChars)
2993 {
2994 if (wcschr(pInfo->pwszValidChars, wch) == NULL)
2995 {
2996 MessageBeep(0xFFFFFFFF);
2997 break;
2998 }
2999 }
3000 return CallWindowProcW(fnWndProc, hwnd, uMsg, wParam, lParam);
3001
3002 case WM_NCDESTROY:
3004 return CallWindowProcW(fnWndProc, hwnd, uMsg, wParam, lParam);
3005
3006 default:
3007 return CallWindowProcW(fnWndProc, hwnd, uMsg, wParam, lParam);
3008 }
3009
3010 return 0;
3011}
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:2877
static void UxSubclassInfo_Destroy(UxSubclassInfo *pInfo)
Definition: shellord.c:2828
WNDPROC fnWndProc
Definition: shellord.c:2822
#define WM_PASTE
Definition: winuser.h:1874
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define VK_CONTROL
Definition: winuser.h:2214
BOOL WINAPI IsWindowUnicode(_In_ HWND)
#define WM_IME_CHAR
Definition: winuser.h:1845
#define WM_CHAR
Definition: winuser.h:1728
HANDLE WINAPI GetPropW(_In_ HWND, _In_ LPCWSTR)
#define WM_NCDESTROY
Definition: winuser.h:1695
#define VK_SHIFT
Definition: winuser.h:2213
#define WM_KEYDOWN
Definition: winuser.h:1726
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2917
LRESULT WINAPI CallWindowProcW(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define VK_INSERT
Definition: winuser.h:2243
SHORT WINAPI GetKeyState(_In_ int)

Referenced by UxSubclassInfo_Create().

◆ LinkWindow_RegisterClass()

BOOL WINAPI LinkWindow_RegisterClass ( void  )

Definition at line 2636 of file shellord.c.

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

◆ LinkWindow_UnregisterClass()

BOOL WINAPI LinkWindow_UnregisterClass ( DWORD  dwUnused)

Definition at line 2645 of file shellord.c.

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

◆ ParseFieldA()

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

Definition at line 83 of file shellord.c.

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

Referenced by HCR_RegGetIconA(), and ParseFieldAW().

◆ ParseFieldAW()

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

Definition at line 143 of file shellord.c.

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

◆ ParseFieldW()

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

Definition at line 117 of file shellord.c.

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

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

◆ PathIsTemporaryA()

BOOL WINAPI PathIsTemporaryA ( LPSTR  Str)

Definition at line 2127 of file shellord.c.

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

Referenced by Test_PathIsTemporaryA().

◆ PathIsTemporaryW()

BOOL WINAPI PathIsTemporaryW ( LPWSTR  Str)

Definition at line 2150 of file shellord.c.

2152{
2153#ifdef __REACTOS__
2154 WCHAR szLongPath[MAX_PATH], szTempPath[MAX_PATH];
2155 DWORD attrs;
2156 LPCWSTR pszTarget = Str;
2157
2158 TRACE("(%s)\n", debugstr_w(Str));
2159
2160 attrs = GetFileAttributesW(Str);
2161 if (attrs != INVALID_FILE_ATTRIBUTES && (attrs & FILE_ATTRIBUTE_TEMPORARY))
2162 return TRUE;
2163
2166 {
2167 return FALSE;
2168 }
2169
2170 if (GetLongPathNameW(Str, szLongPath, _countof(szLongPath)))
2171 pszTarget = szLongPath;
2172
2173 return (PathIsEqualOrSubFolder(szTempPath, pszTarget) ||
2176#else
2177 FIXME("(%s)stub\n", debugstr_w(Str));
2178 return FALSE;
2179#endif
2180}
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:1589
#define UlongToPtr(u)
Definition: config.h:106
static char szTempPath[MAX_PATH]
Definition: data.c:16
#define FILE_ATTRIBUTE_TEMPORARY
Definition: nt_native.h:708
#define CSIDL_INTERNET_CACHE
Definition: shlobj.h:2212
#define CSIDL_CDBURN_AREA
Definition: shlobj.h:2236
#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 2198 of file shellord.c.

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

Referenced by SHAddFromPropSheetExtArray(), and SHReplaceFromPropSheetExtArray().

◆ ReadCabinetState()

BOOL WINAPI ReadCabinetState ( CABINETSTATE cs,
int  length 
)

Definition at line 1807 of file shellord.c.

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

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

◆ RegisterShellHook()

BOOL WINAPI RegisterShellHook ( HWND  hWnd,
DWORD  dwType 
)

Definition at line 510 of file shellord.c.

513{
514 if (dwType == 3)
515 {
518 }
519 else if (dwType == 0)
520 {
522 }
523
524 ERR("Unsupported argument");
525 return FALSE;
526}
HWND hWnd
Definition: settings.c:17
#define ERR(fmt,...)
Definition: precomp.h:57
HWND WINAPI SetTaskmanWindow(HWND)
Definition: window.c:1890
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 1992 of file shellord.c.

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

◆ SetAppStartingCursor()

HRESULT WINAPI SetAppStartingCursor ( HWND  u,
DWORD  v 
)

Definition at line 1897 of file shellord.c.

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

◆ SHAbortInvokeCommand()

HRESULT WINAPI SHAbortInvokeCommand ( void  )

Definition at line 1948 of file shellord.c.

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

◆ SHADD_compare_mru()

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

Definition at line 888 of file shellord.c.

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

Referenced by SHAddToRecentDocs().

◆ SHADD_create_add_mru_data()

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

Definition at line 956 of file shellord.c.

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

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

Referenced by SHAddToRecentDocs().

◆ SHAddFromPropSheetExtArray()

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

Definition at line 2219 of file shellord.c.

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

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

◆ SHAddToRecentDocs()

void WINAPI SHAddToRecentDocs ( UINT  uFlags,
LPCVOID  pv 
)

Definition at line 1011 of file shellord.c.

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

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

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

◆ SHCreatePropSheetExtArrayEx()

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

Definition at line 2257 of file shellord.c.

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

Referenced by SHCreatePropSheetExtArray().

◆ SHCreateShellFolderView()

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

Definition at line 2722 of file shellord.c.

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

◆ SHCreateShellFolderViewEx()

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

Definition at line 1617 of file shellord.c.

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

◆ SHCreateStdEnumFmtEtc()

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

Definition at line 2445 of file shellord.c.

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

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

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

◆ SHDoDragDrop()

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

Definition at line 793 of file shellord.c.

799{
800 FIXME("(%p %p %p 0x%08x %p):stub.\n",
801 hWnd, lpDataObject, lpDropSource, dwOKEffect, pdwEffect);
802 return DoDragDrop(lpDataObject, lpDropSource, dwOKEffect, pdwEffect);
803}
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 626 of file shellord.c.

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

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

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

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

◆ SHFlushClipboard()

HRESULT WINAPI SHFlushClipboard ( void  )

Definition at line 1968 of file shellord.c.

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

◆ SHFlushSFCache()

void WINAPI SHFlushSFCache ( void  )

Definition at line 2660 of file shellord.c.

2661{
2662}

◆ SHFreeUnusedLibraries()

void WINAPI SHFreeUnusedLibraries ( void  )

Definition at line 1728 of file shellord.c.

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

◆ SHGetImageList()

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

Definition at line 2674 of file shellord.c.

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

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

◆ SHGetInstanceExplorer()

HRESULT WINAPI SHGetInstanceExplorer ( IUnknown **  lpUnknown)

Definition at line 1704 of file shellord.c.

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

Referenced by _SHGetInstanceExplorer(), and SHOpenFolderWindow().

◆ SHGetNewLinkInfoA()

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

Definition at line 2544 of file shellord.c.

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

Referenced by test_sh_new_link_info().

◆ SHGetNewLinkInfoW()

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

Definition at line 2563 of file shellord.c.

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

Referenced by SHGetNewLinkInfoA(), and SHGetNewLinkInfoWrapW().

◆ SHGetSetSettings()

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

Definition at line 225 of file shellord.c.

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

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

◆ SHGetSettings()

VOID WINAPI SHGetSettings ( LPSHELLFLAGSTATE  lpsfs,
DWORD  dwMask 
)

Definition at line 409 of file shellord.c.

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

Referenced by SHGetSetSettings(), and START_TEST().

◆ SHHandleUpdateImage()

INT WINAPI SHHandleUpdateImage ( PCIDLIST_ABSOLUTE  pidlExtra)

Definition at line 2514 of file shellord.c.

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

◆ SHLimitInputEdit()

HRESULT WINAPI SHLimitInputEdit ( HWND  hWnd,
IShellFolder psf 
)

Definition at line 3048 of file shellord.c.

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

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

◆ SHLoadOLE()

HRESULT WINAPI SHLoadOLE ( LPARAM  lParam)

Definition at line 1921 of file shellord.c.

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

◆ SHObjectProperties()

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

Definition at line 2521 of file shellord.c.

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

◆ SHOutOfMemoryMessageBox()

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

Definition at line 1956 of file shellord.c.

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

◆ SHRegisterDragDrop()

HRESULT WINAPI SHRegisterDragDrop ( HWND  hWnd,
LPDROPTARGET  pDropTarget 
)

Definition at line 739 of file shellord.c.

742{
743 static BOOL ole_initialized = FALSE;
744 HRESULT hr;
745
746 TRACE("(%p,%p)\n", hWnd, pDropTarget);
747
748 if (!ole_initialized)
749 {
751 if (FAILED(hr))
752 return hr;
753 ole_initialized = TRUE;
754 }
755 return RegisterDragDrop(hWnd, pDropTarget);
756}
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 2365 of file shellord.c.

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

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

◆ SHRunControlPanel()

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

Definition at line 1662 of file shellord.c.

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

Referenced by CShellDispatch::ControlPanelItem().

◆ SHSetInstanceExplorer()

VOID WINAPI SHSetInstanceExplorer ( LPUNKNOWN  lpUnknown)

Definition at line 1694 of file shellord.c.

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

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

◆ SHSetLocalizedName()

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

Definition at line 2626 of file shellord.c.

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

◆ SHShellFolderView_Message()

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

Definition at line 489 of file shellord.c.

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

◆ SHStartNetConnectionDialog()

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

Definition at line 2611 of file shellord.c.

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

◆ SHTestTokenMembership()

EXTERN_C BOOL WINAPI SHTestTokenMembership ( HANDLE  TokenHandle,
ULONG  ulRID 
)

Definition at line 2756 of file shellord.c.

2757{
2759 DWORD nSubAuthority0, nSubAuthority1;
2760 DWORD nSubAuthorityCount;
2761 PSID SidToCheck;
2762 BOOL IsMember = FALSE;
2763
2764 if ((ulRID == SECURITY_SERVICE_RID) || ulRID == SECURITY_LOCAL_SYSTEM_RID)
2765 {
2766 nSubAuthority0 = ulRID;
2767 nSubAuthority1 = 0;
2768 nSubAuthorityCount= 1;
2769 }
2770 else
2771 {
2772 nSubAuthority0 = SECURITY_BUILTIN_DOMAIN_RID;
2773 nSubAuthority1 = ulRID;
2774 nSubAuthorityCount= 2;
2775 }
2776
2777 if (!AllocateAndInitializeSid(&ntAuth,
2778 nSubAuthorityCount,
2779 nSubAuthority0,
2780 nSubAuthority1,
2781 0, 0, 0, 0, 0, 0,
2782 &SidToCheck))
2783 {
2784 return FALSE;
2785 }
2786
2787 if (!CheckTokenMembership(TokenHandle, SidToCheck, &IsMember))
2788 {
2789 IsMember = FALSE;
2790 }
2791
2792 FreeSid(SidToCheck);
2793 return IsMember;
2794}
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 2509 of file shellord.c.

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

◆ SHUpdateImageW()

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

Definition at line 2499 of file shellord.c.

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

◆ SHValidateUNC()

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

Definition at line 2000 of file shellord.c.

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

◆ SHWaitForFileToOpen()

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

Definition at line 1977 of file shellord.c.

1981{
1982 FIXME("%p 0x%08x 0x%08x stub\n", pidl, dwFlags, dwTimeout);
1983 return FALSE;
1984}
_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 1645 of file shellord.c.

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

◆ SignalFileOpen()

BOOL WINAPI SignalFileOpen ( PCIDLIST_ABSOLUTE  pidl)

Definition at line 825 of file shellord.c.

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

◆ UxSubclassInfo_Create()

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

Definition at line 3014 of file shellord.c.

3015{
3016 UxSubclassInfo *pInfo;
3018 if (!pInfo)
3019 {
3020 ERR("HeapAlloc failed.\n");
3023 return NULL;
3024 }
3025
3027 if (!pInfo->fnWndProc)
3028 {
3029 ERR("SetWindowLongPtrW failed\n");
3032 HeapFree(GetProcessHeap(), 0, pInfo);
3033 return NULL;
3034 }
3035
3036 pInfo->hwnd = hwnd;
3037 pInfo->pwszValidChars = valid;
3038 pInfo->pwszInvalidChars = invalid;
3039 if (!SetPropW(hwnd, L"UxSubclassInfo", pInfo))
3040 {
3042 pInfo = NULL;
3043 }
3044 return pInfo;
3045}
#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:2921
#define GWLP_WNDPROC
Definition: treelist.c:66
BOOL WINAPI SetPropW(_In_ HWND, _In_ LPCWSTR, _In_opt_ HANDLE)
#define SetWindowLongPtrW
Definition: winuser.h:5366

Referenced by SHLimitInputEdit().

◆ UxSubclassInfo_Destroy()

static void UxSubclassInfo_Destroy ( UxSubclassInfo pInfo)
static

Definition at line 2828 of file shellord.c.

2829{
2830 if (!pInfo)
2831 return;
2832
2833 RemovePropW(pInfo->hwnd, L"UxSubclassInfo");
2834
2837
2839
2840 HeapFree(GetProcessHeap(), 0, pInfo);
2841}
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 1859 of file shellord.c.

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

Referenced by SHGetInstanceExplorer(), and SHSetInstanceExplorer().