ReactOS 0.4.16-dev-329-g9223134
CNetworkConnections Class Reference

#include <shfldr_netconnect.h>

Inheritance diagram for CNetworkConnections:
Collaboration diagram for CNetworkConnections:

Public Member Functions

 CNetworkConnections ()
 
 ~CNetworkConnections ()
 
STDMETHOD() GetClassID (CLSID *lpClassId) override
 
STDMETHOD() Initialize (PCIDLIST_ABSOLUTE pidl) override
 
STDMETHOD() GetCurFolder (PIDLIST_ABSOLUTE *pidl) override
 
STDMETHOD() ParseDisplayName (HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, DWORD *pchEaten, PIDLIST_RELATIVE *ppidl, DWORD *pdwAttributes) override
 
STDMETHOD() EnumObjects (HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList) override
 
STDMETHOD() BindToObject (PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut) override
 
STDMETHOD() BindToStorage (PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut) override
 
STDMETHOD() CompareIDs (LPARAM lParam, PCUIDLIST_RELATIVE pidl1, PCUIDLIST_RELATIVE pidl2) override
 
STDMETHOD() CreateViewObject (HWND hwndOwner, REFIID riid, LPVOID *ppvOut) override
 
STDMETHOD() GetAttributesOf (UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD *rgfInOut) override
 
STDMETHOD() GetUIObjectOf (HWND hwndOwner, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, REFIID riid, UINT *prgfInOut, LPVOID *ppvOut) override
 
STDMETHOD() GetDisplayNameOf (PCUITEMID_CHILD pidl, DWORD dwFlags, LPSTRRET strRet) override
 
STDMETHOD() SetNameOf (HWND hwndOwner, PCUITEMID_CHILD pidl, LPCOLESTR lpName, DWORD dwFlags, PITEMID_CHILD *pPidlOut) override
 
STDMETHOD() GetDefaultSearchGUID (GUID *pguid) override
 
STDMETHOD() EnumSearches (IEnumExtraSearch **ppenum) override
 
STDMETHOD() GetDefaultColumn (DWORD dwRes, ULONG *pSort, ULONG *pDisplay) override
 
STDMETHOD() GetDefaultColumnState (UINT iColumn, DWORD *pcsFlags) override
 
STDMETHOD() GetDetailsEx (PCUITEMID_CHILD pidl, const SHCOLUMNID *pscid, VARIANT *pv) override
 
STDMETHOD() GetDetailsOf (PCUITEMID_CHILD pidl, UINT iColumn, SHELLDETAILS *psd) override
 
STDMETHOD() MapColumnToSCID (UINT column, SHCOLUMNID *pscid) override
 
STDMETHOD() Initialize (PCIDLIST_ABSOLUTE pidlFolder, IDataObject *pdtobj, HKEY hkeyProgID) override
 
STDMETHOD() Exec (const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut) override
 
STDMETHOD() QueryStatus (const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[], OLECMDTEXT *pCmdText) override
 
STDMETHOD() MessageSFVCB (UINT uMsg, WPARAM wParam, LPARAM lParam) override
 
STDMETHOD() Execute (LPSHELLEXECUTEINFOW pei) override
 
- Public Member Functions inherited from ATL::CComObjectRootEx< CComMultiThreadModelNoCS >
 ~CComObjectRootEx ()
 
ULONG InternalAddRef ()
 
ULONG InternalRelease ()
 
void Lock ()
 
void Unlock ()
 
HRESULT _AtlInitialConstruct ()
 
- Public Member Functions inherited from ATL::CComObjectRootBase
 CComObjectRootBase ()
 
 ~CComObjectRootBase ()
 
void SetVoid (void *)
 
HRESULT _AtlFinalConstruct ()
 
HRESULT FinalConstruct ()
 
void InternalFinalConstructAddRef ()
 
void InternalFinalConstructRelease ()
 
void FinalRelease ()
 
HRESULT GetCurFolder ([out] PIDLIST_ABSOLUTE *ppidl)
 
HRESULT Initialize ([in] PCIDLIST_ABSOLUTE pidl)
 
HRESULT GetClassID ([out] CLSID *pClassID)
 
- Public Member Functions inherited from IUnknown
HRESULT QueryInterface ([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
 
ULONG AddRef ()
 
ULONG Release ()
 
HRESULT Initialize ([in] PCIDLIST_ABSOLUTE pidlFolder, [in] IDataObject *pdtobj, [in] HKEY hkeyProgID)
 
HRESULT GetDefaultSearchGUID ([out] GUID *lpguid)
 
HRESULT EnumSearches ([out] IEnumExtraSearch **ppenum)
 
HRESULT GetDefaultColumn ([in] DWORD dwReserved, [out] ULONG *pSort, [out] ULONG *pDisplay)
 
HRESULT GetDefaultColumnState ([in] UINT iColumn, [out] SHCOLSTATEF *pcsFlags)
 
HRESULT GetDetailsEx ([in] PCUITEMID_CHILD pidl, [in] const SHCOLUMNID *pscid, [out] VARIANT *pv)
 
HRESULT GetDetailsOf ([in] PCUITEMID_CHILD pidl, [in] UINT iColumn, [out] SHELLDETAILS *psd)
 
HRESULT MapColumnToSCID ([in] UINT iColumn, [in] SHCOLUMNID *pscid)
 
- Public Member Functions inherited from IShellFolder
HRESULT ParseDisplayName ([in] HWND hwndOwner, [in] LPBC pbcReserved, [in, string] LPOLESTR lpszDisplayName, [out] ULONG *pchEaten, [out] PIDLIST_RELATIVE *ppidl, [in, out, unique] ULONG *pdwAttributes)
 
HRESULT EnumObjects ([in] HWND hwndOwner, [in] SHCONTF grfFlags, [out] IEnumIDList **ppenumIDList)
 
HRESULT BindToObject ([in] PCUIDLIST_RELATIVE pidl, [in] LPBC pbcReserved, [in] REFIID riid, [out, iid_is(riid)] void **ppvOut)
 
HRESULT BindToStorage ([in] PCUIDLIST_RELATIVE pidl, [in] LPBC pbcReserved, [in] REFIID riid, [out, iid_is(riid)] void **ppvObj)
 
HRESULT CompareIDs ([in] LPARAM lParam, [in] PCUIDLIST_RELATIVE pidl1, [in] PCUIDLIST_RELATIVE pidl2)
 
HRESULT CreateViewObject ([in] HWND hwndOwner, [in] REFIID riid, [out, iid_is(riid)] void **ppvOut)
 
HRESULT GetAttributesOf ([in] UINT cidl, [in, size_is(cidl)] PCUITEMID_CHILD_ARRAY apidl, [in, out] SFGAOF *rgfInOut)
 
HRESULT GetUIObjectOf ([in] HWND hwndOwner, [in] UINT cidl, [in, size_is(cidl)] PCUITEMID_CHILD_ARRAY apidl, [in] REFIID riid, [in, out, unique] UINT *prgfInOut, [out, iid_is(riid)] void **ppvOut)
 
HRESULT GetDisplayNameOf ([in] PCUITEMID_CHILD pidl, [in] SHGDNF uFlags, [out] STRRET *lpName)
 
HRESULT SetNameOf ([in] HWND hwnd, [in] PCUITEMID_CHILD pidl, [in, string] LPCOLESTR lpszName, [in] SHGDNF uFlags, [out] PITEMID_CHILD *ppidlOut)
 
HRESULT QueryStatus ([in, unique] const GUID *pguidCmdGroup, [in] ULONG cCmds, [in, out, size_is(cCmds)] OLECMD prgCmds[], [in, out, unique] OLECMDTEXT *pCmdText)
 
HRESULT Exec ([in, unique] const GUID *pguidCmdGroup, [in] DWORD nCmdID, [in] DWORD nCmdexecopt, [in, unique] VARIANT *pvaIn, [in, out, unique] VARIANT *pvaOut)
 
- Public Member Functions inherited from IShellExecuteHookW
HRESULT Execute ([in, out] struct _SHELLEXECUTEINFOW *pei)
 

Private Attributes

PIDLIST_ABSOLUTE m_pidlRoot
 
CComPtr< IOleCommandTargetm_lpOleCmd
 

Additional Inherited Members

- Public Types inherited from IPersistFolder2
typedef IPersistFolder2LPPERSISTFOLDER2
 
- Public Types inherited from IPersistFolder
typedef IPersistFolderLPPERSISTFOLDER
 
- Public Types inherited from IPersist
typedef IPersistLPPERSIST
 
- Public Types inherited from IUnknown
typedef IUnknownLPUNKNOWN
 
- Public Types inherited from IShellExtInit
typedef IShellExtInitLPSHELLEXTINIT
 
- Public Types inherited from IShellFolder2
typedef struct IShellFolder2::SHCOLUMNIDLPSHCOLUMNID
 
typedef const SHCOLUMNIDLPCSHCOLUMNID
 
- Public Types inherited from IShellFolder
enum  tagSHGDN {
  SHGDN_NORMAL = 0 , SHGDN_INFOLDER = 1 , SHGDN_FOREDITING = 0x1000 , SHGDN_INCLUDE_NONFILESYS = 0x2000 ,
  SHGDN_FORADDRESSBAR = 0x4000 , SHGDN_FORPARSING = 0x8000
}
 
enum  tagSHCONTF {
  SHCONTF_FOLDERS = 32 , SHCONTF_NONFOLDERS = 64 , SHCONTF_INCLUDEHIDDEN = 128 , SHCONTF_INIT_ON_FIRST_NEXT = 256 ,
  SHCONTF_NETPRINTERSRCH = 512 , SHCONTF_SHAREABLE = 1024 , SHCONTF_STORAGE = 2048 , SHCONTF_NAVIGATION_ENUM = 0x01000 ,
  SHCONTF_FASTITEMS = 0x02000 , SHCONTF_FLATLIST = 0x04000 , SHCONTF_ENABLE_ASYNC = 0x08000 , SHCONTF_INCLUDESUPERHIDDEN = 0x10000
}
 
typedef IShellFolderLPSHELLFOLDER
 
typedef enum IShellFolder::tagSHGDN SHGNO
 
typedef DWORD SHGDNF
 
typedef DWORD SHCONTF
 
typedef ULONG SFGAOF
 
- Public Types inherited from IOleCommandTarget
enum  OLECMDF {
  OLECMDF_SUPPORTED = 0x1 , OLECMDF_ENABLED = 0x2 , OLECMDF_LATCHED = 0x4 , OLECMDF_NINCHED = 0x8 ,
  OLECMDF_INVISIBLE = 0x10 , OLECMDF_DEFHIDEONCTXTMENU = 0x20
}
 
enum  OLECMDTEXTF { OLECMDTEXTF_NONE = 0 , OLECMDTEXTF_NAME = 1 , OLECMDTEXTF_STATUS = 2 }
 
enum  OLECMDEXECOPT { OLECMDEXECOPT_DODEFAULT = 0 , OLECMDEXECOPT_PROMPTUSER = 1 , OLECMDEXECOPT_DONTPROMPTUSER = 2 , OLECMDEXECOPT_SHOWHELP = 3 }
 
enum  OLECMDID {
  OLECMDID_OPEN = 1 , OLECMDID_NEW = 2 , OLECMDID_SAVE = 3 , OLECMDID_SAVEAS = 4 ,
  OLECMDID_SAVECOPYAS = 5 , OLECMDID_PRINT = 6 , OLECMDID_PRINTPREVIEW = 7 , OLECMDID_PAGESETUP = 8 ,
  OLECMDID_SPELL = 9 , OLECMDID_PROPERTIES = 10 , OLECMDID_CUT = 11 , OLECMDID_COPY = 12 ,
  OLECMDID_PASTE = 13 , OLECMDID_PASTESPECIAL = 14 , OLECMDID_UNDO = 15 , OLECMDID_REDO = 16 ,
  OLECMDID_SELECTALL = 17 , OLECMDID_CLEARSELECTION = 18 , OLECMDID_ZOOM = 19 , OLECMDID_GETZOOMRANGE = 20 ,
  OLECMDID_UPDATECOMMANDS = 21 , OLECMDID_REFRESH = 22 , OLECMDID_STOP = 23 , OLECMDID_HIDETOOLBARS = 24 ,
  OLECMDID_SETPROGRESSMAX = 25 , OLECMDID_SETPROGRESSPOS = 26 , OLECMDID_SETPROGRESSTEXT = 27 , OLECMDID_SETTITLE = 28 ,
  OLECMDID_SETDOWNLOADSTATE = 29 , OLECMDID_STOPDOWNLOAD = 30 , OLECMDID_ONTOOLBARACTIVATED = 31 , OLECMDID_FIND = 32 ,
  OLECMDID_DELETE = 33 , OLECMDID_HTTPEQUIV = 34 , OLECMDID_HTTPEQUIV_DONE = 35 , OLECMDID_ENABLE_INTERACTION = 36 ,
  OLECMDID_ONUNLOAD = 37 , OLECMDID_PROPERTYBAG2 = 38 , OLECMDID_PREREFRESH = 39 , OLECMDID_SHOWSCRIPTERROR = 40 ,
  OLECMDID_SHOWMESSAGE = 41 , OLECMDID_SHOWFIND = 42 , OLECMDID_SHOWPAGESETUP = 43 , OLECMDID_SHOWPRINT = 44 ,
  OLECMDID_CLOSE = 45 , OLECMDID_ALLOWUILESSSAVEAS = 46 , OLECMDID_DONTDOWNLOADCSS = 47 , OLECMDID_UPDATEPAGESTATUS = 48 ,
  OLECMDID_PRINT2 = 49 , OLECMDID_PRINTPREVIEW2 = 50 , OLECMDID_SETPRINTTEMPLATE = 51 , OLECMDID_GETPRINTTEMPLATE = 52 ,
  OLECMDID_PAGEACTIONBLOCKED = 55 , OLECMDID_PAGEACTIONUIQUERY = 56 , OLECMDID_FOCUSVIEWCONTROLS = 57 , OLECMDID_FOCUSVIEWCONTROLSQUERY = 58 ,
  OLECMDID_SHOWPAGEACTIONMENU = 59 , OLECMDID_ADDTRAVELENTRY = 60 , OLECMDID_UPDATETRAVELENTRY = 61 , OLECMDID_UPDATEBACKFORWARDSTATE = 62 ,
  OLECMDID_OPTICAL_ZOOM = 63 , OLECMDID_OPTICAL_GETZOOMRANGE = 64 , OLECMDID_WINDOWSTATECHANGED = 65 , OLECMDID_ACTIVEXINSTALLSCOPE = 66 ,
  OLECMDID_UPDATETRAVELENTRY_DATARECOVERY = 67 , OLECMDID_SHOWTASKDLG = 68 , OLECMDID_POPSTATEEVENT = 69 , OLECMDID_VIEWPORT_MODE = 70 ,
  OLECMDID_LAYOUT_VIEWPORT_WIDTH = 71 , OLECMDID_VISUAL_VIEWPORT_EXCLUDE_BOTTOM = 72 , OLECMDID_USER_OPTICAL_ZOOM = 73 , OLECMDID_PAGEAVAILABLE = 74 ,
  OLECMDID_GETUSERSCALABLE = 75 , OLECMDID_UPDATE_CARET = 76 , OLECMDID_ENABLE_VISIBILITY = 77 , OLECMDID_MEDIA_PLAYBACK = 78
}
 
typedef IOleCommandTargetLPOLECOMMANDTARGET
 
typedef enum IOleCommandTarget::OLECMDF OLECMDF
 
typedef struct IOleCommandTarget::_tagOLECMD OLECMD
 
typedef struct IOleCommandTarget::_tagOLECMDTEXT OLECMDTEXT
 
typedef enum IOleCommandTarget::OLECMDTEXTF OLECMDTEXTF
 
typedef enum IOleCommandTarget::OLECMDEXECOPT OLECMDEXECOPT
 
typedef enum IOleCommandTarget::OLECMDID OLECMDID
 
- Static Public Member Functions inherited from ATL::CComObjectRootBase
static void WINAPI ObjectMain (bool)
 
static const struct _ATL_CATMAP_ENTRYGetCategoryMap ()
 
static HRESULT WINAPI InternalQueryInterface (void *pThis, const _ATL_INTMAP_ENTRY *pEntries, REFIID iid, void **ppvObject)
 
- Public Attributes inherited from ATL::CComObjectRootBase
LONG m_dwRef
 

Detailed Description

Definition at line 10 of file shfldr_netconnect.h.

Constructor & Destructor Documentation

◆ CNetworkConnections()

CNetworkConnections::CNetworkConnections ( )

Definition at line 41 of file shfldr_netconnect.cpp.

41 :
43{
44 HRESULT hr;
45 hr = CoCreateInstance(CLSID_ConnectionTray, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARG(IOleCommandTarget, &m_lpOleCmd));
48}
PIDLIST_ABSOLUTE m_pidlRoot
CComPtr< IOleCommandTarget > m_lpOleCmd
#define NULL
Definition: types.h:112
#define FAILED_UNEXPECTEDLY(hr)
Definition: precomp.h:121
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
HRESULT hr
Definition: shlfolder.c:183
#define IID_PPV_ARG(Itype, ppType)

◆ ~CNetworkConnections()

CNetworkConnections::~CNetworkConnections ( )

Definition at line 50 of file shfldr_netconnect.cpp.

51{
52 if (m_pidlRoot)
54}
void WINAPI SHFree(LPVOID pv)
Definition: shellole.c:326

Member Function Documentation

◆ BindToObject()

HRESULT WINAPI CNetworkConnections::BindToObject ( PCUIDLIST_RELATIVE  pidl,
LPBC  pbcReserved,
REFIID  riid,
LPVOID ppvOut 
)
override

Definition at line 84 of file shfldr_netconnect.cpp.

86{
87 return E_NOTIMPL;
88}
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ BindToStorage()

HRESULT WINAPI CNetworkConnections::BindToStorage ( PCUIDLIST_RELATIVE  pidl,
LPBC  pbcReserved,
REFIID  riid,
LPVOID ppvOut 
)
override

Definition at line 93 of file shfldr_netconnect.cpp.

95{
96 *ppvOut = NULL;
97 return E_NOTIMPL;
98}

◆ CompareIDs()

HRESULT WINAPI CNetworkConnections::CompareIDs ( LPARAM  lParam,
PCUIDLIST_RELATIVE  pidl1,
PCUIDLIST_RELATIVE  pidl2 
)
override

Implements IShellFolder.

Definition at line 103 of file shfldr_netconnect.cpp.

105{
106 const UINT colcount = NETCONNECTSHELLVIEWCOLUMNS;
107
108 if (ILGetNext(pidl1) || ILGetNext(pidl2))
109 return E_NOTIMPL; // FIXME: Can the connection folder have subfolders?
110
112 {
113 PNETCONIDSTRUCT p1 = ILGetConnData(pidl1);
114 PNETCONIDSTRUCT p2 = ILGetConnData(pidl2);
115 if (p1 && p2)
116 {
117 int res = memcmp(&p1->guidId, &p2->guidId, sizeof(GUID));
119 }
120 }
121 IShellFolder2 *psf = static_cast<IShellFolder2*>(this);
122 return ShellFolderImpl_CompareItemIDs<colcount, -1>(psf, lParam, (PCUITEMID_CHILD)pidl1, (PCUITEMID_CHILD)pidl2);
123}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
LPARAM lParam
Definition: combotst.c:139
#define SHCIDS_CANONICALONLY
Definition: precomp.h:50
PNETCONIDSTRUCT ILGetConnData(PCITEMID_CHILD pidl)
Definition: enumlist.cpp:10
GLuint res
Definition: glext.h:9613
unsigned int UINT
Definition: ndis.h:50
LPITEMIDLIST WINAPI ILGetNext(LPCITEMIDLIST pidl)
Definition: pidl.c:968
#define MAKE_COMPARE_HRESULT(x)
Definition: shellutils.h:619
#define NETCONNECTSHELLVIEWCOLUMNS
const ITEMID_CHILD UNALIGNED * PCUITEMID_CHILD
Definition: shtypes.idl:70

◆ CreateViewObject()

HRESULT WINAPI CNetworkConnections::CreateViewObject ( HWND  hwndOwner,
REFIID  riid,
LPVOID ppvOut 
)
override

Definition at line 128 of file shfldr_netconnect.cpp.

130{
132
133 if (!ppvOut)
134 return hr;
135
136 *ppvOut = NULL;
137
138 if (IsEqualIID(riid, IID_IShellView))
139 {
140 CSFV cvf = {sizeof(cvf), this};
141 CComPtr<IShellView> pShellView;
142 hr = SHCreateShellFolderViewEx(&cvf, &pShellView);
144 return hr;
145
146 return pShellView->QueryInterface(riid, ppvOut);
147 }
148
149 return hr;
150}
EXTERN_C HRESULT WINAPI SHCreateShellFolderViewEx(_In_ LPCSFV pcsfv, _Out_ IShellView **ppsv)
REFIID riid
Definition: atlbase.h:39
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
Definition: shlobj.h:1275
#define E_NOINTERFACE
Definition: winerror.h:2364

◆ EnumObjects()

HRESULT WINAPI CNetworkConnections::EnumObjects ( HWND  hwndOwner,
DWORD  dwFlags,
LPENUMIDLIST *  ppEnumIDList 
)
override

Definition at line 75 of file shfldr_netconnect.cpp.

77{
78 return CEnumIDList_CreateInstance(hwndOwner, dwFlags, IID_PPV_ARG(IEnumIDList, ppEnumIDList));
79}
HRESULT CEnumIDList_CreateInstance(HWND hwndOwner, DWORD dwFlags, REFIID riid, LPVOID *ppv)
Definition: enumlist.cpp:345
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176

◆ EnumSearches()

HRESULT WINAPI CNetworkConnections::EnumSearches ( IEnumExtraSearch **  ppenum)
override

Implements IShellFolder2.

Definition at line 308 of file shfldr_netconnect.cpp.

309{
310 return E_NOTIMPL;
311}

◆ Exec()

HRESULT WINAPI CNetworkConnections::Exec ( const GUID pguidCmdGroup,
DWORD  nCmdID,
DWORD  nCmdexecopt,
VARIANT pvaIn,
VARIANT pvaOut 
)
override

Implements IOleCommandTarget.

Definition at line 859 of file shfldr_netconnect.cpp.

860{
861 FIXME("CNetworkConnections::Exec()\n");
862 return E_NOTIMPL;
863}
#define FIXME(fmt,...)
Definition: precomp.h:53

◆ Execute()

HRESULT WINAPI CNetworkConnections::Execute ( LPSHELLEXECUTEINFOW  pei)
override

Definition at line 835 of file shfldr_netconnect.cpp.

836{
839 if (!pdata)
840 {
841 ERR("Got invalid pidl\n");
842 return E_FAIL;
843 }
844
845 if (pdata->Status == NCS_CONNECTED)
846 {
847 return ShowNetConnectionStatus(m_lpOleCmd, pidl, pei->hwnd);
848 }
849
850 return S_OK;
851}
#define ERR(fmt,...)
Definition: precomp.h:57
#define E_FAIL
Definition: ddrawi.h:102
#define S_OK
Definition: intsafe.h:52
static PROTOCOLDATA * pdata
Definition: protocol.c:158
@ NCS_CONNECTED
Definition: netcon.h:41
LPITEMIDLIST WINAPI ILFindLastID(LPCITEMIDLIST pidl)
Definition: pidl.c:198
HRESULT ShowNetConnectionStatus(IOleCommandTarget *lpOleCmd, PCUITEMID_CHILD pidl, HWND hwnd)

◆ GetAttributesOf()

HRESULT WINAPI CNetworkConnections::GetAttributesOf ( UINT  cidl,
PCUITEMID_CHILD_ARRAY  apidl,
DWORD rgfInOut 
)
override

Definition at line 155 of file shfldr_netconnect.cpp.

157{
158 //IGenericSFImpl *This = (IGenericSFImpl *)iface;
159 // FIXME: Why are these reporting SFGAO_FILESYSTEM and SFGAO_FILESYSANCESTOR?
160 HRESULT hr = S_OK;
161 static const DWORD dwNetConnectAttributes = SFGAO_STORAGE | SFGAO_HASPROPSHEET | SFGAO_STORAGEANCESTOR |
162 SFGAO_FILESYSANCESTOR | SFGAO_FOLDER | SFGAO_FILESYSTEM | SFGAO_HASSUBFOLDER | SFGAO_CANRENAME | SFGAO_CANDELETE;
163
164 static const DWORD dwNetConnectItemAttributes = SFGAO_HASPROPSHEET | SFGAO_STORAGEANCESTOR |
165 SFGAO_FILESYSANCESTOR | SFGAO_CANRENAME;
166
167 if (!rgfInOut)
168 return E_INVALIDARG;
169
170 if (cidl && !apidl)
171 return E_INVALIDARG;
172
173 if (*rgfInOut == 0)
174 *rgfInOut = ~0;
175
176 if (cidl > 1)
177 *rgfInOut &= ~SFGAO_HASPROPSHEET;
178
179 if (cidl == 0)
180 {
181 *rgfInOut = dwNetConnectAttributes;
182 }
183 else
184 {
185 *rgfInOut = dwNetConnectItemAttributes;
186
187 while (cidl > 0 && *apidl)
188 {
190 if (!pdata)
191 continue;
192
193 if (!(pdata->dwCharacter & NCCF_ALLOW_RENAME))
194 *rgfInOut &= ~SFGAO_CANRENAME;
195
196 apidl++;
197 cidl--;
198 }
199 }
200
201 /* make sure SFGAO_VALIDATE is cleared, some apps depend on that */
202 *rgfInOut &= ~SFGAO_VALIDATE;
203
204 return hr;
205}
#define E_INVALIDARG
Definition: ddrawi.h:101
unsigned long DWORD
Definition: ntddk_ex.h:95
@ NCCF_ALLOW_RENAME
Definition: netcon.h:19

◆ GetClassID()

HRESULT WINAPI CNetworkConnections::GetClassID ( CLSID lpClassId)
override

Implements IPersist.

Definition at line 795 of file shfldr_netconnect.cpp.

796{
797 if (!lpClassId)
798 return E_POINTER;
799
800 *lpClassId = CLSID_NetworkConnections;
801
802 return S_OK;
803}
#define E_POINTER
Definition: winerror.h:2365

◆ GetCurFolder()

HRESULT WINAPI CNetworkConnections::GetCurFolder ( PIDLIST_ABSOLUTE pidl)
override

Implements IPersistFolder2.

Definition at line 822 of file shfldr_netconnect.cpp.

823{
824 if (!pidl)
825 return E_POINTER;
826
827 *pidl = ILClone(m_pidlRoot);
828
829 return S_OK;
830}
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
Definition: pidl.c:237

◆ GetDefaultColumn()

HRESULT WINAPI CNetworkConnections::GetDefaultColumn ( DWORD  dwRes,
ULONG pSort,
ULONG pDisplay 
)
override

Implements IShellFolder2.

Definition at line 313 of file shfldr_netconnect.cpp.

314{
315 if (pSort)
316 *pSort = 0;
317 if (pDisplay)
318 *pDisplay = 0;
319
320 return S_OK;
321}

◆ GetDefaultColumnState()

HRESULT WINAPI CNetworkConnections::GetDefaultColumnState ( UINT  iColumn,
DWORD pcsFlags 
)
override

Implements IShellFolder2.

Definition at line 323 of file shfldr_netconnect.cpp.

324{
325 if (!pcsFlags || iColumn >= NETCONNECTSHELLVIEWCOLUMNS)
326 return E_INVALIDARG;
327 *pcsFlags = NetConnectSFHeader[iColumn].pcsFlags;
328 return S_OK;
329}
static const shvheader NetConnectSFHeader[]

◆ GetDefaultSearchGUID()

HRESULT WINAPI CNetworkConnections::GetDefaultSearchGUID ( GUID pguid)
override

Implements IShellFolder2.

Definition at line 303 of file shfldr_netconnect.cpp.

304{
305 return E_NOTIMPL;
306}

◆ GetDetailsEx()

HRESULT WINAPI CNetworkConnections::GetDetailsEx ( PCUITEMID_CHILD  pidl,
const SHCOLUMNID pscid,
VARIANT pv 
)
override

Implements IShellFolder2.

Definition at line 331 of file shfldr_netconnect.cpp.

333{
334 return E_NOTIMPL;
335}

◆ GetDetailsOf()

HRESULT WINAPI CNetworkConnections::GetDetailsOf ( PCUITEMID_CHILD  pidl,
UINT  iColumn,
SHELLDETAILS psd 
)
override

Implements IShellFolder2.

Definition at line 337 of file shfldr_netconnect.cpp.

339{
340 if (iColumn >= NETCONNECTSHELLVIEWCOLUMNS)
341 return E_FAIL;
342
343 psd->fmt = NetConnectSFHeader[iColumn].fmt;
344 psd->cxChar = NetConnectSFHeader[iColumn].cxChar;
345 if (pidl == NULL)
346 return SHSetStrRet(&psd->str, netshell_hInstance, NetConnectSFHeader[iColumn].colnameid);
347
349 if (!pdata)
350 return E_FAIL;
351
352 switch (iColumn)
353 {
354 case COLUMN_NAME:
355 return SHSetStrRet(&psd->str, ILGetConnName(pidl));
356 case COLUMN_TYPE:
357 if (pdata->MediaType == NCM_LAN || pdata->MediaType == NCM_SHAREDACCESSHOST_RAS)
358 {
359 return SHSetStrRet(&psd->str, netshell_hInstance, IDS_TYPE_ETHERNET);
360 }
361 else
362 {
363 return SHSetStrRet(&psd->str, "");
364 }
365 break;
366 case COLUMN_STATUS:
367 switch(pdata->Status)
368 {
370 return SHSetStrRet(&psd->str, netshell_hInstance, IDS_STATUS_NON_OPERATIONAL);
371 case NCS_DISCONNECTED:
372 return SHSetStrRet(&psd->str, netshell_hInstance, IDS_STATUS_UNREACHABLE);
374 return SHSetStrRet(&psd->str, netshell_hInstance, IDS_STATUS_DISCONNECTED);
375 case NCS_CONNECTING:
376 return SHSetStrRet(&psd->str, netshell_hInstance, IDS_STATUS_CONNECTING);
377 case NCS_CONNECTED:
378 return SHSetStrRet(&psd->str, netshell_hInstance, IDS_STATUS_CONNECTED);
379 default:
380 return SHSetStrRet(&psd->str, "");
381 }
382 break;
383 case COLUMN_DEVNAME:
384 return SHSetStrRet(&psd->str, ILGetDeviceName(pidl));
385 case COLUMN_PHONE:
386 case COLUMN_OWNER:
387 return SHSetStrRet(&psd->str, "");
388 }
389
390 return E_FAIL;
391}
#define IDS_STATUS_NON_OPERATIONAL
Definition: resource.h:81
#define IDS_STATUS_CONNECTED
Definition: resource.h:85
#define IDS_STATUS_DISCONNECTED
Definition: resource.h:83
#define IDS_TYPE_ETHERNET
Definition: resource.h:80
#define IDS_STATUS_UNREACHABLE
Definition: resource.h:82
#define IDS_STATUS_CONNECTING
Definition: resource.h:84
PWCHAR ILGetDeviceName(PCITEMID_CHILD pidl)
Definition: enumlist.cpp:29
PWCHAR ILGetConnName(PCITEMID_CHILD pidl)
Definition: enumlist.cpp:21
@ NCS_CONNECTING
Definition: netcon.h:40
@ NCS_MEDIA_DISCONNECTED
Definition: netcon.h:46
@ NCS_DISCONNECTED
Definition: netcon.h:39
@ NCS_HARDWARE_DISABLED
Definition: netcon.h:44
@ NCM_LAN
Definition: netcon.h:71
@ NCM_SHAREDACCESSHOST_RAS
Definition: netcon.h:77
HINSTANCE netshell_hInstance
Definition: netshell.cpp:12
#define COLUMN_OWNER
#define COLUMN_NAME
#define COLUMN_DEVNAME
#define COLUMN_TYPE
#define COLUMN_STATUS
#define COLUMN_PHONE
STRRET str
Definition: shtypes.idl:108

◆ GetDisplayNameOf()

HRESULT WINAPI CNetworkConnections::GetDisplayNameOf ( PCUITEMID_CHILD  pidl,
DWORD  dwFlags,
LPSTRRET  strRet 
)
override

Definition at line 248 of file shfldr_netconnect.cpp.

249{
250 if (!strRet)
251 return E_INVALIDARG;
252
253 if (!pidl)
254 return SHSetStrRet(strRet, netshell_hInstance, IDS_NETWORKCONNECTION);
255
256 PWCHAR pwchName = ILGetConnName(pidl);
257 if (!pwchName)
258 {
259 ERR("Got invalid pidl\n");
260 return E_INVALIDARG;
261 }
262
263 return SHSetStrRet(strRet, pwchName);
264}
#define IDS_NETWORKCONNECTION
Definition: resource.h:73
uint16_t * PWCHAR
Definition: typedefs.h:56

◆ GetUIObjectOf()

HRESULT WINAPI CNetworkConnections::GetUIObjectOf ( HWND  hwndOwner,
UINT  cidl,
PCUITEMID_CHILD_ARRAY  apidl,
REFIID  riid,
UINT prgfInOut,
LPVOID ppvOut 
)
override

Definition at line 220 of file shfldr_netconnect.cpp.

223{
224 IUnknown *pObj = NULL;
226
227 if (!ppvOut)
228 return hr;
229
230 *ppvOut = NULL;
231
232 if ((IsEqualIID(riid, IID_IContextMenu) || IsEqualIID (riid, IID_IContextMenu2) || IsEqualIID(riid, IID_IContextMenu3) ||
233 IsEqualIID(riid, IID_IQueryInfo) || IsEqualIID(riid, IID_IExtractIconW)) && cidl >= 1)
234 {
235 return ShellObjectCreatorInit<CNetConUiObject>(apidl[0], m_lpOleCmd, riid, ppvOut);
236 }
237 else
239
240 *ppvOut = pObj;
241 return hr;
242}

◆ Initialize() [1/2]

HRESULT WINAPI CNetworkConnections::Initialize ( PCIDLIST_ABSOLUTE  pidl)
override

Implements IPersistFolder.

Definition at line 810 of file shfldr_netconnect.cpp.

811{
812 if (m_pidlRoot)
814 m_pidlRoot = ILClone(pidl);
815
816 return S_OK;
817}

◆ Initialize() [2/2]

HRESULT WINAPI CNetworkConnections::Initialize ( PCIDLIST_ABSOLUTE  pidlFolder,
IDataObject pdtobj,
HKEY  hkeyProgID 
)
override

Implements IShellExtInit.

Definition at line 853 of file shfldr_netconnect.cpp.

854{
855 FIXME("CNetworkConnections::Initialize()\n");
856 return E_NOTIMPL;
857}

◆ MapColumnToSCID()

HRESULT WINAPI CNetworkConnections::MapColumnToSCID ( UINT  column,
SHCOLUMNID pscid 
)
override

Implements IShellFolder2.

Definition at line 393 of file shfldr_netconnect.cpp.

394{
395 return E_NOTIMPL;
396}

◆ MessageSFVCB()

HRESULT WINAPI CNetworkConnections::MessageSFVCB ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
override

Definition at line 871 of file shfldr_netconnect.cpp.

872{
873 FIXME("CNetworkConnections::MessageSFVCB()\n");
874 return E_NOTIMPL;
875}

◆ ParseDisplayName()

HRESULT WINAPI CNetworkConnections::ParseDisplayName ( HWND  hwndOwner,
LPBC  pbc,
LPOLESTR  lpszDisplayName,
DWORD pchEaten,
PIDLIST_RELATIVE ppidl,
DWORD pdwAttributes 
)
override

Definition at line 59 of file shfldr_netconnect.cpp.

62{
64
65 *ppidl = 0;
66 if (pchEaten)
67 *pchEaten = 0; /* strange but like the original */
68
69 return hr;
70}
#define E_UNEXPECTED
Definition: winerror.h:2456

◆ QueryStatus()

HRESULT WINAPI CNetworkConnections::QueryStatus ( const GUID pguidCmdGroup,
ULONG  cCmds,
OLECMD  prgCmds[],
OLECMDTEXT pCmdText 
)
override

Implements IOleCommandTarget.

Definition at line 865 of file shfldr_netconnect.cpp.

866{
867 FIXME("CNetworkConnections::QueryStatus()\n");
868 return E_NOTIMPL;
869}

◆ SetNameOf()

HRESULT WINAPI CNetworkConnections::SetNameOf ( HWND  hwndOwner,
PCUITEMID_CHILD  pidl,
LPCOLESTR  lpName,
DWORD  dwFlags,
PITEMID_CHILD pPidlOut 
)
override

Implements IShellFolder.

Definition at line 278 of file shfldr_netconnect.cpp.

281{
282 HRESULT hr;
284
285 hr = ILGetConnection(pidl, &pCon);
287 return hr;
288
289 hr = pCon->Rename(lpName);
291 return hr;
292
293 if (pPidlOut)
294 {
295 *pPidlOut = ILCreateNetConnectItem(pCon);
296 if (*pPidlOut == NULL)
297 return E_FAIL;
298 }
299
300 return S_OK;
301}
PITEMID_CHILD ILCreateNetConnectItem(INetConnection *pItem)
Definition: enumlist.cpp:37
HRESULT ILGetConnection(PCITEMID_CHILD pidl, INetConnection **pItem)
Definition: enumlist.cpp:85
_In_ LPCSTR lpName
Definition: winbase.h:2814

Member Data Documentation

◆ m_lpOleCmd

CComPtr<IOleCommandTarget> CNetworkConnections::m_lpOleCmd
private

Definition at line 67 of file shfldr_netconnect.h.

Referenced by CNetworkConnections(), Execute(), and GetUIObjectOf().

◆ m_pidlRoot

PIDLIST_ABSOLUTE CNetworkConnections::m_pidlRoot
private

Definition at line 66 of file shfldr_netconnect.h.

Referenced by GetCurFolder(), Initialize(), and ~CNetworkConnections().


The documentation for this class was generated from the following files: