ReactOS  0.4.15-dev-1397-g19779b3
CControlPanelFolder.cpp File Reference
#include <precomp.h>
Include dependency graph for CControlPanelFolder.cpp:

Go to the source code of this file.

Classes

class  CControlPanelEnum
 

Macros

#define CONROLPANELSHELLVIEWCOLUMNS   2
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (shell)
 
static LPITEMIDLIST _ILCreateCPanelApplet (LPCWSTR pszName, LPCWSTR pszDisplayName, LPCWSTR pszComment, int iIconIdx)
 
static PIDLCPanelStruct_ILGetCPanelPointer (LPCITEMIDLIST pidl)
 
HRESULT CCPLExtractIcon_CreateInstance (IShellFolder *psf, LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppvOut)
 
EXTERN_C void WINAPI Control_RunDLLW (HWND hWnd, HINSTANCE hInst, LPCWSTR cmd, DWORD nCmdShow)
 

Variables

static const shvheader ControlPanelSFHeader []
 

Macro Definition Documentation

◆ CONROLPANELSHELLVIEWCOLUMNS

#define CONROLPANELSHELLVIEWCOLUMNS   2

Definition at line 55 of file CControlPanelFolder.cpp.

Function Documentation

◆ _ILCreateCPanelApplet()

static LPITEMIDLIST _ILCreateCPanelApplet ( LPCWSTR  pszName,
LPCWSTR  pszDisplayName,
LPCWSTR  pszComment,
int  iIconIdx 
)
static

Definition at line 73 of file CControlPanelFolder.cpp.

74 {
75  PIDLCPanelStruct *pCP;
76  LPITEMIDLIST pidl;
78  int cchName, cchDisplayName, cchComment, cbData;
79 
80  /* Calculate lengths of given strings */
81  cchName = wcslen(pszName);
82  cchDisplayName = wcslen(pszDisplayName);
83  cchComment = wcslen(pszComment);
84 
85  /* Allocate PIDL */
86  cbData = sizeof(pidl->mkid.cb) + sizeof(pData->type) + sizeof(pData->u.cpanel) - sizeof(pData->u.cpanel.szName)
87  + (cchName + cchDisplayName + cchComment + 3) * sizeof(WCHAR);
88  pidl = (LPITEMIDLIST)SHAlloc(cbData + sizeof(WORD));
89  if (!pidl)
90  return NULL;
91 
92  /* Copy data to allocated memory */
93  pidl->mkid.cb = cbData;
94  pData = (PIDLDATA *)pidl->mkid.abID;
95  pData->type = PT_CPLAPPLET;
96 
97  pCP = &pData->u.cpanel;
98  pCP->dummy = 0;
99  pCP->iconIdx = iIconIdx;
100  wcscpy(pCP->szName, pszName);
101  pCP->offsDispName = cchName + 1;
102  wcscpy(pCP->szName + pCP->offsDispName, pszDisplayName);
103  pCP->offsComment = pCP->offsDispName + cchDisplayName + 1;
104  wcscpy(pCP->szName + pCP->offsComment, pszComment);
105 
106  /* Add PIDL NULL terminator */
107  *(WORD*)(pCP->szName + pCP->offsComment + cchComment + 1) = 0;
108 
109  pcheck(pidl);
110 
111  return pidl;
112 }
WCHAR szName[1]
Definition: pidl.h:116
_In_ PSID _Out_writes_to_opt_ cchName LPSTR _Inout_ LPDWORD cchName
Definition: winbase.h:2729
WORD offsDispName
Definition: pidl.h:114
WORD offsComment
Definition: pidl.h:115
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned short WORD
Definition: ntddk_ex.h:93
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
#define NULL
Definition: types.h:112
BOOL pcheck(LPCITEMIDLIST pidl)
Definition: debughlp.cpp:336
#define PT_CPLAPPLET
Definition: pidl.h:86
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1827
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
LPVOID WINAPI SHAlloc(SIZE_T len)
Definition: shellole.c:309
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
_In_ LPCSTR _Out_writes_to_opt_ cchDisplayName LPSTR _Inout_ LPDWORD cchDisplayName
Definition: winbase.h:2753

Referenced by CControlPanelEnum::RegisterCPanelApp().

◆ _ILGetCPanelPointer()

static PIDLCPanelStruct* _ILGetCPanelPointer ( LPCITEMIDLIST  pidl)
static

Definition at line 118 of file CControlPanelFolder.cpp.

119 {
121 
122  if (pdata && pdata->type == PT_CPLAPPLET)
123  return (PIDLCPanelStruct *) & (pdata->u.cpanel);
124 
125  return NULL;
126 }
LPPIDLDATA _ILGetDataPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2176
static PROTOCOLDATA * pdata
Definition: protocol.c:158
#define NULL
Definition: types.h:112
#define PT_CPLAPPLET
Definition: pidl.h:86

Referenced by CCPLExtractIcon_CreateInstance(), CControlPanelFolder::CompareIDs(), CControlPanelFolder::GetDetailsOf(), CControlPanelFolder::GetDisplayNameOf(), CControlPanelFolder::GetUIObjectOf(), and CCPLItemMenu::InvokeCommand().

◆ CCPLExtractIcon_CreateInstance()

HRESULT CCPLExtractIcon_CreateInstance ( IShellFolder psf,
LPCITEMIDLIST  pidl,
REFIID  riid,
LPVOID ppvOut 
)

Definition at line 128 of file CControlPanelFolder.cpp.

129 {
131  if (!pData)
132  return E_FAIL;
133 
134  CComPtr<IDefaultExtractIconInit> initIcon;
136  if (FAILED_UNEXPECTEDLY(hr))
137  return hr;
138 
139  initIcon->SetNormalIcon(pData->szName, (int)pData->iconIdx != -1 ? pData->iconIdx : 0);
140 
141  return initIcon->QueryInterface(riid, ppvOut);
142 }
HRESULT hr
Definition: shlfolder.c:183
REFIID riid
Definition: precomp.h:44
static PIDLCPanelStruct * _ILGetCPanelPointer(LPCITEMIDLIST pidl)
#define IID_PPV_ARG(Itype, ppType)
#define E_FAIL
Definition: ddrawi.h:102
LONG HRESULT
Definition: typedefs.h:79
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:71
HRESULT WINAPI SHCreateDefaultExtractIcon(REFIID riid, void **ppv)
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1827

Referenced by CControlPanelFolder::GetUIObjectOf().

◆ Control_RunDLLW()

EXTERN_C void WINAPI Control_RunDLLW ( HWND  hWnd,
HINSTANCE  hInst,
LPCWSTR  cmd,
DWORD  nCmdShow 
)

Definition at line 873 of file control.c.

874 {
875  CPanel panel;
876 
877  TRACE("(%p, %p, %s, 0x%08x)\n",
878  hWnd, hInst, debugstr_w(cmd), nCmdShow);
879 
880 #ifndef __REACTOS__
881  memset(&panel, 0, sizeof(panel));
882  list_init( &panel.applets );
883 #endif
884 
885  if (!cmd || !*cmd) {
886  Control_DoWindow(&panel, hWnd, hInst);
887  } else {
888  Control_DoLaunch(&panel, hWnd, cmd);
889  }
890 }
Definition: ftp_var.h:139
HWND hWnd
Definition: settings.c:17
#define debugstr_w
Definition: kernel32.h:32
#define TRACE(s)
Definition: solgame.cpp:4
static void Control_DoLaunch(CPanel *panel, HWND hWnd, LPCWSTR wszCmd)
Definition: control.c:742
struct list applets
Definition: cpanel.h:57
Definition: cpanel.h:56
HINSTANCE hInst
Definition: dxdiag.c:13
static void Control_DoWindow(CPanel *panel, HWND hWnd, HINSTANCE hInst)
Definition: control.c:698
__WINE_SERVER_LIST_INLINE void list_init(struct list *list)
Definition: list.h:149
#define memset(x, y, z)
Definition: compat.h:39

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( shell  )

Variable Documentation

◆ ControlPanelSFHeader