ReactOS 0.4.16-dev-927-g467dec4
ShellPropSheetDialog Struct Reference

Classes

struct  DATA
 

Public Types

typedef void(CALLBACKPFNINITIALIZE) (LPCWSTR InitString, IDataObject *pDO, HKEY *hKeys, UINT *cKeys)
 

Static Public Member Functions

static HRESULT Show (const CLSID *pClsidDefault, IDataObject *pDO, PFNINITIALIZE InitFunc, LPCWSTR InitString)
 
static void FreeData (DATA *pData)
 
static HRESULT ShowAsync (const CLSID *pClsidDefault, IDataObject *pDO, PFNINITIALIZE InitFunc, LPCWSTR InitString)
 
static DWORD CALLBACK ShowPropertiesThread (LPVOID Param)
 

Detailed Description

Definition at line 27 of file item_prop.cpp.

Member Typedef Documentation

◆ PFNINITIALIZE

typedef void(CALLBACK * ShellPropSheetDialog::PFNINITIALIZE) (LPCWSTR InitString, IDataObject *pDO, HKEY *hKeys, UINT *cKeys)

Definition at line 29 of file item_prop.cpp.

Member Function Documentation

◆ FreeData()

static void ShellPropSheetDialog::FreeData ( DATA pData)
inlinestatic

Definition at line 56 of file item_prop.cpp.

57 {
58 if (pData->InitString)
59 SHFree(pData->InitString);
61 }
void WINAPI SHFree(LPVOID pv)
Definition: shellole.c:326
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1830

Referenced by ShowAsync(), and ShowPropertiesThread().

◆ Show()

static HRESULT ShellPropSheetDialog::Show ( const CLSID pClsidDefault,
IDataObject pDO,
PFNINITIALIZE  InitFunc,
LPCWSTR  InitString 
)
inlinestatic

Definition at line 32 of file item_prop.cpp.

34 {
35 HRESULT hr;
36 CRegKeyHandleArray keys;
37 if (InitFunc)
38 InitFunc(InitString, pDO, keys, keys);
39 WCHAR szCaption[MAX_PATH], *pszCaption = NULL;
40 if (SUCCEEDED(SHELL_GetCaptionFromDataObject(pDO, szCaption, _countof(szCaption))))
41 pszCaption = szCaption;
42 hr = SHOpenPropSheetW(pszCaption, keys, keys, pClsidDefault, pDO, NULL, NULL) ? S_OK : E_FAIL;
43 return hr;
44 }
#define E_FAIL
Definition: ddrawi.h:102
#define NULL
Definition: types.h:112
#define MAX_PATH
Definition: compat.h:34
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
static HRESULT SHELL_GetCaptionFromDataObject(IDataObject *pDO, LPWSTR Buf, UINT cchBuf)
Definition: item_prop.cpp:13
HRESULT hr
Definition: shlfolder.c:183
#define _countof(array)
Definition: sndvol32.h:70
EXTERN_C BOOL WINAPI SHOpenPropSheetW(_In_opt_ LPCWSTR pszCaption, _In_opt_ HKEY *ahKeys, _In_ UINT cKeys, _In_ const CLSID *pclsidDefault, _In_ IDataObject *pDataObject, _In_opt_ IShellBrowser *pShellBrowser, _In_opt_ LPCWSTR pszStartPage)
Definition: propsheet.cpp:204
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by ShowPropertiesThread().

◆ ShowAsync()

static HRESULT ShellPropSheetDialog::ShowAsync ( const CLSID pClsidDefault,
IDataObject pDO,
PFNINITIALIZE  InitFunc,
LPCWSTR  InitString 
)
inlinestatic

Definition at line 63 of file item_prop.cpp.

65 {
66 DATA *pData = (DATA*)SHAlloc(sizeof(*pData));
67 if (!pData)
68 return E_OUTOFMEMORY;
69 ZeroMemory(pData, sizeof(*pData));
70 pData->InitFunc = InitFunc;
71 if (InitString && FAILED(SHStrDupW(InitString, &pData->InitString)))
72 {
74 return E_OUTOFMEMORY;
75 }
76 if (pClsidDefault)
77 {
78 pData->ClsidDefault = *pClsidDefault;
79 pData->pClsidDefault = &pData->ClsidDefault;
80 }
82
83 HRESULT hr = S_OK;
84 if (pDO)
86
89 {
90 if (pData->pObjStream)
91 pData->pObjStream->Release();
92 hr = E_FAIL;
93 }
94
95 if (SUCCEEDED(hr))
96 {
97 if (hEvent)
98 {
100 // Pump COM messages until the thread can create its own IDataObject (for CORE-19933).
101 // SHOpenPropSheetW is modal and we cannot wait for it to complete.
104 }
105 }
106 else
107 {
109 }
110 return hr;
111 }
#define index(s, c)
Definition: various.h:29
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define CloseHandle
Definition: compat.h:739
HRESULT WINAPI CoWaitForMultipleHandles(DWORD dwFlags, DWORD dwTimeout, ULONG cHandles, LPHANDLE pHandles, LPDWORD lpdwindex)
Definition: compobj.c:4578
HRESULT WINAPI CoMarshalInterThreadInterfaceInStream(REFIID riid, LPUNKNOWN pUnk, LPSTREAM *ppStm)
Definition: marshal.c:2100
LPVOID WINAPI SHAlloc(SIZE_T len)
Definition: shellole.c:304
HRESULT WINAPI SHStrDupW(LPCWSTR src, LPWSTR *dest)
Definition: string.c:2018
BOOL WINAPI SHCreateThread(LPTHREAD_START_ROUTINE pfnThreadProc, VOID *pData, DWORD dwFlags, LPTHREAD_START_ROUTINE pfnCallback)
Definition: thread.c:356
#define INFINITE
Definition: serial.h:102
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint index
Definition: glext.h:6031
GLbitfield flags
Definition: glext.h:7161
#define FAILED(hr)
Definition: intsafe.h:51
static HANDLE hEvent
Definition: comm.c:54
unsigned int UINT
Definition: ndis.h:50
@ COWAIT_DEFAULT
Definition: objbase.h:695
const GUID IID_IDataObject
#define CTF_PROCESS_REF
Definition: shlwapi.h:1980
#define CTF_COINIT
Definition: shlwapi.h:1981
#define CTF_INSIST
Definition: shlwapi.h:1978
static DWORD CALLBACK ShowPropertiesThread(LPVOID Param)
Definition: item_prop.cpp:113
static void FreeData(DATA *pData)
Definition: item_prop.cpp:56
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:651
#define ZeroMemory
Definition: winbase.h:1743

◆ ShowPropertiesThread()

static DWORD CALLBACK ShellPropSheetDialog::ShowPropertiesThread ( LPVOID  Param)
inlinestatic

Definition at line 113 of file item_prop.cpp.

114 {
115 DATA *pData = (DATA*)Param;
116 CComPtr<IDataObject> pDO, pLocalDO;
117 if (pData->pObjStream)
119 if (pDO && SUCCEEDED(SHELL_CloneDataObject(pDO, &pLocalDO)))
120 pDO = pLocalDO;
121 if (pData->hEvent)
122 SetEvent(pData->hEvent);
123 Show(pData->pClsidDefault, pDO, pData->InitFunc, pData->InitString);
125 return 0;
126 }
HRESULT WINAPI CoGetInterfaceAndReleaseStream(LPSTREAM pStm, REFIID riid, LPVOID *ppv)
Definition: marshal.c:2144
HRESULT SHELL_CloneDataObject(_In_ IDataObject *pDO, _Out_ IDataObject **ppDO)
static HRESULT Show(const CLSID *pClsidDefault, IDataObject *pDO, PFNINITIALIZE InitFunc, LPCWSTR InitString)
Definition: item_prop.cpp:32
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:733
#define IID_PPV_ARG(Itype, ppType)

Referenced by ShowAsync().


The documentation for this struct was generated from the following file: