ReactOS  0.4.14-dev-50-g13bb5e2
CNetworkConnections Class Reference

#include <shfldr_netconnect.h>

Inheritance diagram for CNetworkConnections:
Collaboration diagram for CNetworkConnections:

Public Member Functions

 CNetworkConnections ()
 
 ~CNetworkConnections ()
 
virtual HRESULT WINAPI GetClassID (CLSID *lpClassId)
 
virtual HRESULT WINAPI Initialize (PCIDLIST_ABSOLUTE pidl)
 
virtual HRESULT WINAPI GetCurFolder (PIDLIST_ABSOLUTE *pidl)
 
virtual HRESULT WINAPI ParseDisplayName (HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, DWORD *pchEaten, PIDLIST_RELATIVE *ppidl, DWORD *pdwAttributes)
 
virtual HRESULT WINAPI EnumObjects (HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList)
 
virtual HRESULT WINAPI BindToObject (PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut)
 
virtual HRESULT WINAPI BindToStorage (PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut)
 
virtual HRESULT WINAPI CompareIDs (LPARAM lParam, PCUIDLIST_RELATIVE pidl1, PCUIDLIST_RELATIVE pidl2)
 
virtual HRESULT WINAPI CreateViewObject (HWND hwndOwner, REFIID riid, LPVOID *ppvOut)
 
virtual HRESULT WINAPI GetAttributesOf (UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD *rgfInOut)
 
virtual HRESULT WINAPI GetUIObjectOf (HWND hwndOwner, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, REFIID riid, UINT *prgfInOut, LPVOID *ppvOut)
 
virtual HRESULT WINAPI GetDisplayNameOf (PCUITEMID_CHILD pidl, DWORD dwFlags, LPSTRRET strRet)
 
virtual HRESULT WINAPI SetNameOf (HWND hwndOwner, PCUITEMID_CHILD pidl, LPCOLESTR lpName, DWORD dwFlags, PITEMID_CHILD *pPidlOut)
 
virtual HRESULT WINAPI GetDefaultSearchGUID (GUID *pguid)
 
virtual HRESULT WINAPI EnumSearches (IEnumExtraSearch **ppenum)
 
virtual HRESULT WINAPI GetDefaultColumn (DWORD dwRes, ULONG *pSort, ULONG *pDisplay)
 
virtual HRESULT WINAPI GetDefaultColumnState (UINT iColumn, DWORD *pcsFlags)
 
virtual HRESULT WINAPI GetDetailsEx (PCUITEMID_CHILD pidl, const SHCOLUMNID *pscid, VARIANT *pv)
 
virtual HRESULT WINAPI GetDetailsOf (PCUITEMID_CHILD pidl, UINT iColumn, SHELLDETAILS *psd)
 
virtual HRESULT WINAPI MapColumnToSCID (UINT column, SHCOLUMNID *pscid)
 
virtual HRESULT WINAPI Initialize (PCIDLIST_ABSOLUTE pidlFolder, IDataObject *pdtobj, HKEY hkeyProgID)
 
virtual HRESULT WINAPI Exec (const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
 
virtual HRESULT WINAPI QueryStatus (const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[], OLECMDTEXT *pCmdText)
 
virtual HRESULT WINAPI MessageSFVCB (UINT uMsg, WPARAM wParam, LPARAM lParam)
 
virtual HRESULT WINAPI Execute (LPSHELLEXECUTEINFOW pei)
 
- 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 ()
 
- Public Member Functions inherited from IUnknown
HRESULT QueryInterface ([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
 
ULONG AddRef ()
 
ULONG Release ()
 
- 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 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)
 
- 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
}
 
typedef IShellFolderLPSHELLFOLDER
 
typedef enum IShellFolder::tagSHGDN SHGNO
 
typedef DWORD SHGDNF
 
typedef DWORD SHCONTF
 
- 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
 
- Public Attributes inherited from IShellFolder
SFGAO_STORAGEANCESTOR typedef ULONG SFGAOF
 

Detailed Description

Definition at line 10 of file shfldr_netconnect.h.

Constructor & Destructor Documentation

◆ CNetworkConnections()

CNetworkConnections::CNetworkConnections ( )

Definition at line 60 of file shfldr_netconnect.cpp.

60  :
62 {
63  HRESULT hr;
64  hr = CoCreateInstance(CLSID_ConnectionTray, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARG(IOleCommandTarget, &m_lpOleCmd));
66  m_lpOleCmd = NULL;
67 }
CComPtr< IOleCommandTarget > m_lpOleCmd
HRESULT hr
Definition: shlfolder.c:183
#define IID_PPV_ARG(Itype, ppType)
PIDLIST_ABSOLUTE m_pidlRoot
smooth NULL
Definition: ftsmooth.c:416
LONG HRESULT
Definition: typedefs.h:77
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:71
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3234

◆ ~CNetworkConnections()

CNetworkConnections::~CNetworkConnections ( )

Definition at line 69 of file shfldr_netconnect.cpp.

70 {
71  if (m_pidlRoot)
73 }
PIDLIST_ABSOLUTE m_pidlRoot
void WINAPI SHFree(LPVOID pv)
Definition: shellole.c:331

Member Function Documentation

◆ BindToObject()

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

Definition at line 103 of file shfldr_netconnect.cpp.

105 {
106  return E_NOTIMPL;
107 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ BindToStorage()

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

Definition at line 112 of file shfldr_netconnect.cpp.

114 {
115  *ppvOut = NULL;
116  return E_NOTIMPL;
117 }
smooth NULL
Definition: ftsmooth.c:416
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ CompareIDs()

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

Implements IShellFolder.

Definition at line 123 of file shfldr_netconnect.cpp.

125 {
126  return E_NOTIMPL;
127 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ CreateViewObject()

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

Definition at line 132 of file shfldr_netconnect.cpp.

134 {
136 
137  if (!ppvOut)
138  return hr;
139 
140  *ppvOut = NULL;
141 
142  if (IsEqualIID(riid, IID_IShellView))
143  {
144  CSFV cvf = {sizeof(cvf), this};
145  CComPtr<IShellView> pShellView;
146  hr = SHCreateShellFolderViewEx(&cvf, &pShellView);
147  if (FAILED_UNEXPECTEDLY(hr))
148  return hr;
149 
150  return pShellView->QueryInterface(riid, ppvOut);
151  }
152 
153  return hr;
154 }
#define E_NOINTERFACE
Definition: winerror.h:2364
HRESULT hr
Definition: shlfolder.c:183
REFIID riid
Definition: precomp.h:44
Definition: shlobj.h:1192
smooth NULL
Definition: ftsmooth.c:416
HRESULT WINAPI SHCreateShellFolderViewEx(LPCSFV psvcbi, IShellView **ppsv)
Definition: CDefView.cpp:3428
LONG HRESULT
Definition: typedefs.h:77
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:71
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95

◆ EnumObjects()

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

Definition at line 94 of file shfldr_netconnect.cpp.

96 {
97  return CEnumIDList_CreateInstance(hwndOwner, dwFlags, IID_PPV_ARG(IEnumIDList, ppEnumIDList));
98 }
#define IID_PPV_ARG(Itype, ppType)
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
HRESULT CEnumIDList_CreateInstance(HWND hwndOwner, DWORD dwFlags, REFIID riid, LPVOID *ppv)
Definition: enumlist.cpp:329

◆ EnumSearches()

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

Implements IShellFolder2.

Definition at line 305 of file shfldr_netconnect.cpp.

306 {
307  return E_NOTIMPL;
308 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ Exec()

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

Implements IOleCommandTarget.

Definition at line 853 of file shfldr_netconnect.cpp.

854 {
855  FIXME("CNetworkConnections::Exec()\n");
856  return E_NOTIMPL;
857 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ Execute()

HRESULT WINAPI CNetworkConnections::Execute ( LPSHELLEXECUTEINFOW  pei)
virtual

Definition at line 829 of file shfldr_netconnect.cpp.

830 {
833  if (!pdata)
834  {
835  ERR("Got invalid pidl!\n");
836  return E_FAIL;
837  }
838 
839  if (pdata->Status == NCS_CONNECTED)
840  {
841  return ShowNetConnectionStatus(m_lpOleCmd, pidl, pei->hwnd);
842  }
843 
844  return S_OK;
845 }
CComPtr< IOleCommandTarget > m_lpOleCmd
const ITEMID_CHILD UNALIGNED * PCUITEMID_CHILD
Definition: shtypes.idl:70
#define E_FAIL
Definition: ddrawi.h:102
LPITEMIDLIST WINAPI ILFindLastID(LPCITEMIDLIST pidl)
Definition: pidl.c:189
PNETCONIDSTRUCT ILGetConnData(PCITEMID_CHILD pidl)
Definition: enumlist.cpp:10
static PROTOCOLDATA * pdata
Definition: protocol.c:157
HRESULT ShowNetConnectionStatus(IOleCommandTarget *lpOleCmd, PCUITEMID_CHILD pidl, HWND hwnd)
#define ERR(fmt,...)
Definition: debug.h:109
#define S_OK
Definition: intsafe.h:59

◆ GetAttributesOf()

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

Definition at line 159 of file shfldr_netconnect.cpp.

161 {
162  //IGenericSFImpl *This = (IGenericSFImpl *)iface;
163  HRESULT hr = S_OK;
164  static const DWORD dwNetConnectAttributes = SFGAO_STORAGE | SFGAO_HASPROPSHEET | SFGAO_STORAGEANCESTOR |
165  SFGAO_FILESYSANCESTOR | SFGAO_FOLDER | SFGAO_FILESYSTEM | SFGAO_HASSUBFOLDER | SFGAO_CANRENAME | SFGAO_CANDELETE;
166 
167  static const DWORD dwNetConnectItemAttributes = SFGAO_HASPROPSHEET | SFGAO_STORAGEANCESTOR |
168  SFGAO_FILESYSANCESTOR | SFGAO_CANRENAME;
169 
170  if (!rgfInOut)
171  return E_INVALIDARG;
172 
173  if (cidl && !apidl)
174  return E_INVALIDARG;
175 
176  if (*rgfInOut == 0)
177  *rgfInOut = ~0;
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 }
HRESULT hr
Definition: shlfolder.c:183
#define E_INVALIDARG
Definition: ddrawi.h:101
PNETCONIDSTRUCT ILGetConnData(PCITEMID_CHILD pidl)
Definition: enumlist.cpp:10
static PROTOCOLDATA * pdata
Definition: protocol.c:157
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
#define S_OK
Definition: intsafe.h:59

◆ GetClassID()

HRESULT WINAPI CNetworkConnections::GetClassID ( CLSID lpClassId)
virtual

Implements IPersist.

Definition at line 789 of file shfldr_netconnect.cpp.

790 {
791  if (!lpClassId)
792  return E_POINTER;
793 
794  *lpClassId = CLSID_ConnectionFolder;
795 
796  return S_OK;
797 }
#define S_OK
Definition: intsafe.h:59
#define E_POINTER
Definition: winerror.h:2365

◆ GetCurFolder()

HRESULT WINAPI CNetworkConnections::GetCurFolder ( PIDLIST_ABSOLUTE pidl)
virtual

Implements IPersistFolder2.

Definition at line 816 of file shfldr_netconnect.cpp.

817 {
818  if (!pidl)
819  return E_POINTER;
820 
821  *pidl = ILClone(m_pidlRoot);
822 
823  return S_OK;
824 }
PIDLIST_ABSOLUTE m_pidlRoot
#define S_OK
Definition: intsafe.h:59
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
Definition: pidl.c:228
#define E_POINTER
Definition: winerror.h:2365

◆ GetDefaultColumn()

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

Implements IShellFolder2.

Definition at line 310 of file shfldr_netconnect.cpp.

311 {
312  if (pSort)
313  *pSort = 0;
314  if (pDisplay)
315  *pDisplay = 0;
316 
317  return S_OK;
318 }
#define S_OK
Definition: intsafe.h:59

◆ GetDefaultColumnState()

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

Implements IShellFolder2.

Definition at line 320 of file shfldr_netconnect.cpp.

321 {
322  if (!pcsFlags || iColumn >= NETCONNECTSHELLVIEWCOLUMNS)
323  return E_INVALIDARG;
324  *pcsFlags = NetConnectSFHeader[iColumn].pcsFlags;
325  return S_OK;
326 }
#define E_INVALIDARG
Definition: ddrawi.h:101
static const shvheader NetConnectSFHeader[]
#define S_OK
Definition: intsafe.h:59
#define NETCONNECTSHELLVIEWCOLUMNS

◆ GetDefaultSearchGUID()

HRESULT WINAPI CNetworkConnections::GetDefaultSearchGUID ( GUID pguid)
virtual

Implements IShellFolder2.

Definition at line 300 of file shfldr_netconnect.cpp.

301 {
302  return E_NOTIMPL;
303 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ GetDetailsEx()

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

Implements IShellFolder2.

Definition at line 328 of file shfldr_netconnect.cpp.

330 {
331  return E_NOTIMPL;
332 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ GetDetailsOf()

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

Implements IShellFolder2.

Definition at line 334 of file shfldr_netconnect.cpp.

336 {
337  if (iColumn >= NETCONNECTSHELLVIEWCOLUMNS)
338  return E_FAIL;
339 
340  psd->fmt = NetConnectSFHeader[iColumn].fmt;
341  psd->cxChar = NetConnectSFHeader[iColumn].cxChar;
342  if (pidl == NULL)
343  return SHSetStrRet(&psd->str, netshell_hInstance, NetConnectSFHeader[iColumn].colnameid);
344 
346  if (!pdata)
347  return E_FAIL;
348 
349  switch (iColumn)
350  {
351  case COLUMN_NAME:
352  return SHSetStrRet(&psd->str, ILGetConnName(pidl));
353  case COLUMN_TYPE:
354  if (pdata->MediaType == NCM_LAN || pdata->MediaType == NCM_SHAREDACCESSHOST_RAS)
355  {
356  return SHSetStrRet(&psd->str, netshell_hInstance, IDS_TYPE_ETHERNET);
357  }
358  else
359  {
360  return SHSetStrRet(&psd->str, "");
361  }
362  break;
363  case COLUMN_STATUS:
364  switch(pdata->Status)
365  {
366  case NCS_HARDWARE_DISABLED:
367  return SHSetStrRet(&psd->str, netshell_hInstance, IDS_STATUS_NON_OPERATIONAL);
368  case NCS_DISCONNECTED:
369  return SHSetStrRet(&psd->str, netshell_hInstance, IDS_STATUS_UNREACHABLE);
371  return SHSetStrRet(&psd->str, netshell_hInstance, IDS_STATUS_DISCONNECTED);
372  case NCS_CONNECTING:
373  return SHSetStrRet(&psd->str, netshell_hInstance, IDS_STATUS_CONNECTING);
374  case NCS_CONNECTED:
375  return SHSetStrRet(&psd->str, netshell_hInstance, IDS_STATUS_CONNECTED);
376  default:
377  return SHSetStrRet(&psd->str, "");
378  }
379  break;
380  case COLUMN_DEVNAME:
381  return SHSetStrRet(&psd->str, ILGetDeviceName(pidl));
382  case COLUMN_PHONE:
383  case COLUMN_OWNER:
384  return SHSetStrRet(&psd->str, "");
385  }
386 
387  return E_FAIL;
388 }
#define IDS_STATUS_UNREACHABLE
Definition: resource.h:82
#define COLUMN_NAME
#define IDS_STATUS_DISCONNECTED
Definition: resource.h:83
#define IDS_STATUS_CONNECTED
Definition: resource.h:85
#define IDS_TYPE_ETHERNET
Definition: resource.h:80
PWCHAR ILGetConnName(PCITEMID_CHILD pidl)
Definition: enumlist.cpp:17
#define E_FAIL
Definition: ddrawi.h:102
STRRET str
Definition: shtypes.idl:108
HINSTANCE netshell_hInstance
Definition: netshell.cpp:12
#define COLUMN_DEVNAME
smooth NULL
Definition: ftsmooth.c:416
PWCHAR ILGetDeviceName(PCITEMID_CHILD pidl)
Definition: enumlist.cpp:25
PNETCONIDSTRUCT ILGetConnData(PCITEMID_CHILD pidl)
Definition: enumlist.cpp:10
static PROTOCOLDATA * pdata
Definition: protocol.c:157
#define COLUMN_TYPE
static const shvheader NetConnectSFHeader[]
#define COLUMN_OWNER
#define COLUMN_PHONE
#define IDS_STATUS_CONNECTING
Definition: resource.h:84
Definition: netcon.h:71
#define IDS_STATUS_NON_OPERATIONAL
Definition: resource.h:81
#define COLUMN_STATUS
#define NETCONNECTSHELLVIEWCOLUMNS

◆ GetDisplayNameOf()

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

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 }
PWCHAR ILGetConnName(PCITEMID_CHILD pidl)
Definition: enumlist.cpp:17
uint16_t * PWCHAR
Definition: typedefs.h:54
HINSTANCE netshell_hInstance
Definition: netshell.cpp:12
#define IDS_NETWORKCONNECTION
Definition: resource.h:73
#define E_INVALIDARG
Definition: ddrawi.h:101
#define ERR(fmt,...)
Definition: debug.h:109

◆ GetUIObjectOf()

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

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
238  hr = E_NOINTERFACE;
239 
240  *ppvOut = pObj;
241  return hr;
242 }
CComPtr< IOleCommandTarget > m_lpOleCmd
#define E_NOINTERFACE
Definition: winerror.h:2364
HRESULT hr
Definition: shlfolder.c:183
REFIID riid
Definition: precomp.h:44
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
LONG HRESULT
Definition: typedefs.h:77
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95

◆ Initialize() [1/2]

HRESULT WINAPI CNetworkConnections::Initialize ( PCIDLIST_ABSOLUTE  pidl)
virtual

Implements IPersistFolder.

Definition at line 804 of file shfldr_netconnect.cpp.

805 {
806  if (m_pidlRoot)
808  m_pidlRoot = ILClone(pidl);
809 
810  return S_OK;
811 }
PIDLIST_ABSOLUTE m_pidlRoot
#define S_OK
Definition: intsafe.h:59
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
Definition: pidl.c:228
void WINAPI SHFree(LPVOID pv)
Definition: shellole.c:331

◆ Initialize() [2/2]

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

Implements IShellExtInit.

Definition at line 847 of file shfldr_netconnect.cpp.

848 {
849  FIXME("CNetworkConnections::Initialize()\n");
850  return E_NOTIMPL;
851 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ MapColumnToSCID()

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

Implements IShellFolder2.

Definition at line 390 of file shfldr_netconnect.cpp.

391 {
392  return E_NOTIMPL;
393 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ MessageSFVCB()

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

Definition at line 865 of file shfldr_netconnect.cpp.

866 {
867  FIXME("CNetworkConnections::MessageSFVCB()\n");
868  return E_NOTIMPL;
869 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ ParseDisplayName()

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

Definition at line 78 of file shfldr_netconnect.cpp.

81 {
83 
84  *ppidl = 0;
85  if (pchEaten)
86  *pchEaten = 0; /* strange but like the original */
87 
88  return hr;
89 }
HRESULT hr
Definition: shlfolder.c:183
LONG HRESULT
Definition: typedefs.h:77
#define E_UNEXPECTED
Definition: winerror.h:2456

◆ QueryStatus()

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

Implements IOleCommandTarget.

Definition at line 859 of file shfldr_netconnect.cpp.

860 {
861  FIXME("CNetworkConnections::QueryStatus()\n");
862  return E_NOTIMPL;
863 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ SetNameOf()

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

Implements IShellFolder.

Definition at line 278 of file shfldr_netconnect.cpp.

281 {
282  HRESULT hr;
284 
285  hr = ILGetConnection(pidl, &pCon);
286  if (FAILED_UNEXPECTEDLY(hr))
287  return hr;
288 
289  hr = pCon->Rename(lpName);
290  if (FAILED_UNEXPECTEDLY(hr))
291  return hr;
292 
293  *pPidlOut = ILCreateNetConnectItem(pCon);
294  if (*pPidlOut == NULL)
295  return E_FAIL;
296 
297  return S_OK;
298 }
HRESULT ILGetConnection(PCITEMID_CHILD pidl, INetConnection **pItem)
Definition: enumlist.cpp:77
HRESULT hr
Definition: shlfolder.c:183
_In_ LPCSTR lpName
Definition: winbase.h:2729
#define E_FAIL
Definition: ddrawi.h:102
smooth NULL
Definition: ftsmooth.c:416
LONG HRESULT
Definition: typedefs.h:77
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:71
PITEMID_CHILD ILCreateNetConnectItem(INetConnection *pItem)
Definition: enumlist.cpp:33
#define S_OK
Definition: intsafe.h:59

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: