ReactOS 0.4.15-dev-8348-gc1b9bb5
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 40 of file shfldr_netconnect.cpp.

40 :
42{
43 HRESULT hr;
44 hr = CoCreateInstance(CLSID_ConnectionTray, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARG(IOleCommandTarget, &m_lpOleCmd));
47}
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 49 of file shfldr_netconnect.cpp.

50{
51 if (m_pidlRoot)
53}
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 83 of file shfldr_netconnect.cpp.

85{
86 return E_NOTIMPL;
87}
#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 92 of file shfldr_netconnect.cpp.

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

◆ 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 return E_NOTIMPL;
107}

◆ CreateViewObject()

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

Definition at line 112 of file shfldr_netconnect.cpp.

114{
116
117 if (!ppvOut)
118 return hr;
119
120 *ppvOut = NULL;
121
122 if (IsEqualIID(riid, IID_IShellView))
123 {
124 CSFV cvf = {sizeof(cvf), this};
125 CComPtr<IShellView> pShellView;
126 hr = SHCreateShellFolderViewEx(&cvf, &pShellView);
128 return hr;
129
130 return pShellView->QueryInterface(riid, ppvOut);
131 }
132
133 return hr;
134}
HRESULT WINAPI SHCreateShellFolderViewEx(LPCSFV psvcbi, IShellView **ppsv)
Definition: CDefView.cpp:4356
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 74 of file shfldr_netconnect.cpp.

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

◆ EnumSearches()

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

Implements IShellFolder2.

Definition at line 288 of file shfldr_netconnect.cpp.

289{
290 return E_NOTIMPL;
291}

◆ Exec()

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

Implements IOleCommandTarget.

Definition at line 836 of file shfldr_netconnect.cpp.

837{
838 FIXME("CNetworkConnections::Exec()\n");
839 return E_NOTIMPL;
840}
#define FIXME(fmt,...)
Definition: precomp.h:53

◆ Execute()

HRESULT WINAPI CNetworkConnections::Execute ( LPSHELLEXECUTEINFOW  pei)
override

Definition at line 812 of file shfldr_netconnect.cpp.

813{
816 if (!pdata)
817 {
818 ERR("Got invalid pidl\n");
819 return E_FAIL;
820 }
821
822 if (pdata->Status == NCS_CONNECTED)
823 {
824 return ShowNetConnectionStatus(m_lpOleCmd, pidl, pei->hwnd);
825 }
826
827 return S_OK;
828}
#define ERR(fmt,...)
Definition: precomp.h:57
#define E_FAIL
Definition: ddrawi.h:102
PNETCONIDSTRUCT ILGetConnData(PCITEMID_CHILD pidl)
Definition: enumlist.cpp:10
#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)
const ITEMID_CHILD UNALIGNED * PCUITEMID_CHILD
Definition: shtypes.idl:70

◆ GetAttributesOf()

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

Definition at line 139 of file shfldr_netconnect.cpp.

141{
142 //IGenericSFImpl *This = (IGenericSFImpl *)iface;
143 HRESULT hr = S_OK;
144 static const DWORD dwNetConnectAttributes = SFGAO_STORAGE | SFGAO_HASPROPSHEET | SFGAO_STORAGEANCESTOR |
145 SFGAO_FILESYSANCESTOR | SFGAO_FOLDER | SFGAO_FILESYSTEM | SFGAO_HASSUBFOLDER | SFGAO_CANRENAME | SFGAO_CANDELETE;
146
147 static const DWORD dwNetConnectItemAttributes = SFGAO_HASPROPSHEET | SFGAO_STORAGEANCESTOR |
148 SFGAO_FILESYSANCESTOR | SFGAO_CANRENAME;
149
150 if (!rgfInOut)
151 return E_INVALIDARG;
152
153 if (cidl && !apidl)
154 return E_INVALIDARG;
155
156 if (*rgfInOut == 0)
157 *rgfInOut = ~0;
158
159 if (cidl == 0)
160 {
161 *rgfInOut = dwNetConnectAttributes;
162 }
163 else
164 {
165 *rgfInOut = dwNetConnectItemAttributes;
166
167 while (cidl > 0 && *apidl)
168 {
170 if (!pdata)
171 continue;
172
173 if (!(pdata->dwCharacter & NCCF_ALLOW_RENAME))
174 *rgfInOut &= ~SFGAO_CANRENAME;
175
176 apidl++;
177 cidl--;
178 }
179 }
180
181 /* make sure SFGAO_VALIDATE is cleared, some apps depend on that */
182 *rgfInOut &= ~SFGAO_VALIDATE;
183
184 return hr;
185}
#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 772 of file shfldr_netconnect.cpp.

773{
774 if (!lpClassId)
775 return E_POINTER;
776
777 *lpClassId = CLSID_ConnectionFolder;
778
779 return S_OK;
780}
#define E_POINTER
Definition: winerror.h:2365

◆ GetCurFolder()

HRESULT WINAPI CNetworkConnections::GetCurFolder ( PIDLIST_ABSOLUTE pidl)
override

Implements IPersistFolder2.

Definition at line 799 of file shfldr_netconnect.cpp.

800{
801 if (!pidl)
802 return E_POINTER;
803
804 *pidl = ILClone(m_pidlRoot);
805
806 return S_OK;
807}
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 293 of file shfldr_netconnect.cpp.

294{
295 if (pSort)
296 *pSort = 0;
297 if (pDisplay)
298 *pDisplay = 0;
299
300 return S_OK;
301}

◆ GetDefaultColumnState()

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

Implements IShellFolder2.

Definition at line 303 of file shfldr_netconnect.cpp.

304{
305 if (!pcsFlags || iColumn >= NETCONNECTSHELLVIEWCOLUMNS)
306 return E_INVALIDARG;
307 *pcsFlags = NetConnectSFHeader[iColumn].pcsFlags;
308 return S_OK;
309}
#define NETCONNECTSHELLVIEWCOLUMNS
static const shvheader NetConnectSFHeader[]

◆ GetDefaultSearchGUID()

HRESULT WINAPI CNetworkConnections::GetDefaultSearchGUID ( GUID pguid)
override

Implements IShellFolder2.

Definition at line 283 of file shfldr_netconnect.cpp.

284{
285 return E_NOTIMPL;
286}

◆ GetDetailsEx()

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

Implements IShellFolder2.

Definition at line 311 of file shfldr_netconnect.cpp.

313{
314 return E_NOTIMPL;
315}

◆ GetDetailsOf()

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

Implements IShellFolder2.

Definition at line 317 of file shfldr_netconnect.cpp.

319{
320 if (iColumn >= NETCONNECTSHELLVIEWCOLUMNS)
321 return E_FAIL;
322
323 psd->fmt = NetConnectSFHeader[iColumn].fmt;
324 psd->cxChar = NetConnectSFHeader[iColumn].cxChar;
325 if (pidl == NULL)
326 return SHSetStrRet(&psd->str, netshell_hInstance, NetConnectSFHeader[iColumn].colnameid);
327
329 if (!pdata)
330 return E_FAIL;
331
332 switch (iColumn)
333 {
334 case COLUMN_NAME:
335 return SHSetStrRet(&psd->str, ILGetConnName(pidl));
336 case COLUMN_TYPE:
337 if (pdata->MediaType == NCM_LAN || pdata->MediaType == NCM_SHAREDACCESSHOST_RAS)
338 {
339 return SHSetStrRet(&psd->str, netshell_hInstance, IDS_TYPE_ETHERNET);
340 }
341 else
342 {
343 return SHSetStrRet(&psd->str, "");
344 }
345 break;
346 case COLUMN_STATUS:
347 switch(pdata->Status)
348 {
350 return SHSetStrRet(&psd->str, netshell_hInstance, IDS_STATUS_NON_OPERATIONAL);
351 case NCS_DISCONNECTED:
352 return SHSetStrRet(&psd->str, netshell_hInstance, IDS_STATUS_UNREACHABLE);
354 return SHSetStrRet(&psd->str, netshell_hInstance, IDS_STATUS_DISCONNECTED);
355 case NCS_CONNECTING:
356 return SHSetStrRet(&psd->str, netshell_hInstance, IDS_STATUS_CONNECTING);
357 case NCS_CONNECTED:
358 return SHSetStrRet(&psd->str, netshell_hInstance, IDS_STATUS_CONNECTED);
359 default:
360 return SHSetStrRet(&psd->str, "");
361 }
362 break;
363 case COLUMN_DEVNAME:
364 return SHSetStrRet(&psd->str, ILGetDeviceName(pidl));
365 case COLUMN_PHONE:
366 case COLUMN_OWNER:
367 return SHSetStrRet(&psd->str, "");
368 }
369
370 return E_FAIL;
371}
#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:25
PWCHAR ILGetConnName(PCITEMID_CHILD pidl)
Definition: enumlist.cpp:17
@ 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 228 of file shfldr_netconnect.cpp.

229{
230 if (!strRet)
231 return E_INVALIDARG;
232
233 if (!pidl)
234 return SHSetStrRet(strRet, netshell_hInstance, IDS_NETWORKCONNECTION);
235
236 PWCHAR pwchName = ILGetConnName(pidl);
237 if (!pwchName)
238 {
239 ERR("Got invalid pidl\n");
240 return E_INVALIDARG;
241 }
242
243 return SHSetStrRet(strRet, pwchName);
244}
#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 200 of file shfldr_netconnect.cpp.

203{
204 IUnknown *pObj = NULL;
206
207 if (!ppvOut)
208 return hr;
209
210 *ppvOut = NULL;
211
212 if ((IsEqualIID(riid, IID_IContextMenu) || IsEqualIID (riid, IID_IContextMenu2) || IsEqualIID(riid, IID_IContextMenu3) ||
213 IsEqualIID(riid, IID_IQueryInfo) || IsEqualIID(riid, IID_IExtractIconW)) && cidl >= 1)
214 {
215 return ShellObjectCreatorInit<CNetConUiObject>(apidl[0], m_lpOleCmd, riid, ppvOut);
216 }
217 else
219
220 *ppvOut = pObj;
221 return hr;
222}

◆ Initialize() [1/2]

HRESULT WINAPI CNetworkConnections::Initialize ( PCIDLIST_ABSOLUTE  pidl)
override

Implements IPersistFolder.

Definition at line 787 of file shfldr_netconnect.cpp.

788{
789 if (m_pidlRoot)
791 m_pidlRoot = ILClone(pidl);
792
793 return S_OK;
794}

◆ Initialize() [2/2]

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

Implements IShellExtInit.

Definition at line 830 of file shfldr_netconnect.cpp.

831{
832 FIXME("CNetworkConnections::Initialize()\n");
833 return E_NOTIMPL;
834}

◆ MapColumnToSCID()

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

Implements IShellFolder2.

Definition at line 373 of file shfldr_netconnect.cpp.

374{
375 return E_NOTIMPL;
376}

◆ MessageSFVCB()

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

Definition at line 848 of file shfldr_netconnect.cpp.

849{
850 FIXME("CNetworkConnections::MessageSFVCB()\n");
851 return E_NOTIMPL;
852}

◆ ParseDisplayName()

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

Definition at line 58 of file shfldr_netconnect.cpp.

61{
63
64 *ppidl = 0;
65 if (pchEaten)
66 *pchEaten = 0; /* strange but like the original */
67
68 return hr;
69}
#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 842 of file shfldr_netconnect.cpp.

843{
844 FIXME("CNetworkConnections::QueryStatus()\n");
845 return E_NOTIMPL;
846}

◆ SetNameOf()

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

Implements IShellFolder.

Definition at line 258 of file shfldr_netconnect.cpp.

261{
262 HRESULT hr;
264
265 hr = ILGetConnection(pidl, &pCon);
267 return hr;
268
269 hr = pCon->Rename(lpName);
271 return hr;
272
273 if (pPidlOut)
274 {
275 *pPidlOut = ILCreateNetConnectItem(pCon);
276 if (*pPidlOut == NULL)
277 return E_FAIL;
278 }
279
280 return S_OK;
281}
PITEMID_CHILD ILCreateNetConnectItem(INetConnection *pItem)
Definition: enumlist.cpp:33
HRESULT ILGetConnection(PCITEMID_CHILD pidl, INetConnection **pItem)
Definition: enumlist.cpp:77
_In_ LPCSTR lpName
Definition: winbase.h:2789

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: