ReactOS 0.4.15-dev-8058-ga7cbb60
precomp.h File Reference
#include <stdio.h>
#include <windef.h>
#include <winbase.h>
#include <wingdi.h>
#include <wincon.h>
#include <winreg.h>
#include <winnls.h>
#include <shlwapi.h>
#include <shlobj.h>
#include <shellapi.h>
#include <atlbase.h>
#include <atlcom.h>
#include <atlcoll.h>
#include <atlstr.h>
#include <iphlpapi.h>
#include <setupapi.h>
#include <devguid.h>
#include <netcon.h>
#include <shlguid_undoc.h>
#include <prsht.h>
#include <undocshell.h>
#include <shellutils.h>
#include <netcfgx.h>
#include <netcfgn.h>
#include <strsafe.h>
#include <wine/debug.h>
#include "resource.h"
#include "connectmanager.h"
#include "lanconnectui.h"
#include "lanstatusui.h"
#include "shfldr_netconnect.h"
Include dependency graph for precomp.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  tagNETCONIDSTRUCT
 

Macros

#define WIN32_NO_STATUS
 
#define _INC_WINDOWS
 
#define COM_NO_WINDOWS_H
 
#define NCF_VIRTUAL   0x1
 
#define NCF_SOFTWARE_ENUMERATED   0x2
 
#define NCF_PHYSICAL   0x4
 
#define NCF_HIDDEN   0x8
 
#define NCF_NO_SERVICE   0x10
 
#define NCF_NOT_USER_REMOVABLE   0x20
 
#define NCF_MULTIPORT_INSTANCED_ADAPTER   0x40
 
#define NCF_HAS_UI   0x80
 
#define NCF_FILTER   0x400
 
#define NCF_NDIS_PROTOCOL   0x4000
 
#define USE_CUSTOM_CONMGR   1
 
#define NCCF_NOTIFY_DISCONNECTED   0x100000
 

Typedefs

typedef struct tagNETCONIDSTRUCT NETCONIDSTRUCT
 
typedef struct tagNETCONIDSTRUCTPNETCONIDSTRUCT
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (shell)
 
PNETCONIDSTRUCT ILGetConnData (PCITEMID_CHILD pidl)
 
PWCHAR ILGetConnName (PCITEMID_CHILD pidl)
 
PWCHAR ILGetDeviceName (PCITEMID_CHILD pidl)
 
PITEMID_CHILD ILCreateNetConnectItem (INetConnection *pItem)
 
HRESULT ILGetConnection (PCITEMID_CHILD pidl, INetConnection **pItem)
 
HRESULT CEnumIDList_CreateInstance (HWND hwndOwner, DWORD dwFlags, REFIID riid, LPVOID *ppv)
 
HPROPSHEETPAGE InitializePropertySheetPage (LPWSTR resname, DLGPROC dlgproc, LPARAM lParam, LPWSTR szTitle)
 

Variables

HINSTANCE netshell_hInstance
 

Macro Definition Documentation

◆ _INC_WINDOWS

#define _INC_WINDOWS

Definition at line 7 of file precomp.h.

◆ COM_NO_WINDOWS_H

#define COM_NO_WINDOWS_H

Definition at line 8 of file precomp.h.

◆ NCCF_NOTIFY_DISCONNECTED

#define NCCF_NOTIFY_DISCONNECTED   0x100000

Definition at line 76 of file precomp.h.

◆ NCF_FILTER

#define NCF_FILTER   0x400

Definition at line 49 of file precomp.h.

◆ NCF_HAS_UI

#define NCF_HAS_UI   0x80

Definition at line 48 of file precomp.h.

◆ NCF_HIDDEN

#define NCF_HIDDEN   0x8

Definition at line 44 of file precomp.h.

◆ NCF_MULTIPORT_INSTANCED_ADAPTER

#define NCF_MULTIPORT_INSTANCED_ADAPTER   0x40

Definition at line 47 of file precomp.h.

◆ NCF_NDIS_PROTOCOL

#define NCF_NDIS_PROTOCOL   0x4000

Definition at line 50 of file precomp.h.

◆ NCF_NO_SERVICE

#define NCF_NO_SERVICE   0x10

Definition at line 45 of file precomp.h.

◆ NCF_NOT_USER_REMOVABLE

#define NCF_NOT_USER_REMOVABLE   0x20

Definition at line 46 of file precomp.h.

◆ NCF_PHYSICAL

#define NCF_PHYSICAL   0x4

Definition at line 43 of file precomp.h.

◆ NCF_SOFTWARE_ENUMERATED

#define NCF_SOFTWARE_ENUMERATED   0x2

Definition at line 42 of file precomp.h.

◆ NCF_VIRTUAL

#define NCF_VIRTUAL   0x1

Definition at line 41 of file precomp.h.

◆ USE_CUSTOM_CONMGR

#define USE_CUSTOM_CONMGR   1

Definition at line 52 of file precomp.h.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 6 of file precomp.h.

Typedef Documentation

◆ NETCONIDSTRUCT

◆ PNETCONIDSTRUCT

Function Documentation

◆ CEnumIDList_CreateInstance()

HRESULT CEnumIDList_CreateInstance ( HWND  hwndOwner,
DWORD  dwFlags,
REFIID  riid,
LPVOID ppv 
)

Definition at line 337 of file enumlist.cpp.

338{
339 return ShellObjectCreatorInit<CEnumIDList>(riid, ppv);
340}
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39

Referenced by CNetworkConnections::EnumObjects().

◆ ILCreateNetConnectItem()

PITEMID_CHILD ILCreateNetConnectItem ( INetConnection pItem)

Definition at line 33 of file enumlist.cpp.

34{
35 PITEMID_CHILD pidl;
37 NETCON_PROPERTIES * pProperties;
38 PNETCONIDSTRUCT pnetid;
39 PWCHAR pwchName;
40
41 if (pItem->GetProperties(&pProperties) != S_OK)
42 return NULL;
43
44 size = sizeof(WORD); /* nr of bytes in this item */
45 size += sizeof(NETCONIDSTRUCT);
46 size += (wcslen(pProperties->pszwName) + 1) * sizeof(WCHAR);
47 size += (wcslen(pProperties->pszwDeviceName) + 1) * sizeof(WCHAR);
48
49 /* Allocate enough memory for the trailing id which will indicate that this is a simple id */
50 pidl = static_cast<LPITEMIDLIST>(SHAlloc(size + sizeof(SHITEMID)));
51 pidl->mkid.cb = (WORD)size;
52 pidl->mkid.abID[0] = 0x99;
53
54 /* Copy the connection properties */
55 pnetid = ILGetConnData(pidl);
56 pnetid->guidId = pProperties->guidId;
57 pnetid->Status = pProperties->Status;
58 pnetid->MediaType = pProperties->MediaType;
59 pnetid->dwCharacter = pProperties->dwCharacter;
60 pnetid->uNameOffset = sizeof(NETCONIDSTRUCT);
61 pnetid->uDeviceNameOffset = pnetid->uNameOffset + (wcslen(pProperties->pszwName) + 1) * sizeof(WCHAR);
62
63 pwchName = ILGetConnName(pidl);
64 wcscpy(pwchName, pProperties->pszwName);
65
66 pwchName = ILGetDeviceName(pidl);
67 wcscpy(pwchName, pProperties->pszwDeviceName);
68
69 /* Set the trailing id to null */
70 memset((void*)((ULONG_PTR)pidl + size), 0, sizeof(SHITEMID));
71
72 NcFreeNetconProperties(pProperties);
73
74 return pidl;
75}
#define NULL
Definition: types.h:112
struct tagNETCONIDSTRUCT NETCONIDSTRUCT
LPVOID WINAPI SHAlloc(SIZE_T len)
Definition: shellole.c:304
PWCHAR ILGetDeviceName(PCITEMID_CHILD pidl)
Definition: enumlist.cpp:25
PNETCONIDSTRUCT ILGetConnData(PCITEMID_CHILD pidl)
Definition: enumlist.cpp:10
PWCHAR ILGetConnName(PCITEMID_CHILD pidl)
Definition: enumlist.cpp:17
unsigned short WORD
Definition: ntddk_ex.h:93
GLsizeiptr size
Definition: glext.h:5919
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
HRESULT GetProperties([out] NETCON_PROPERTIES **ppProps)
#define S_OK
Definition: intsafe.h:52
VOID WINAPI NcFreeNetconProperties(NETCON_PROPERTIES *pProps)
Definition: netshell.cpp:119
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
#define memset(x, y, z)
Definition: compat.h:39
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
BYTE abID[1]
Definition: shtypes.idl:28
WORD cb
Definition: shtypes.idl:27
SHITEMID mkid
Definition: shtypes.idl:34
ULONG_PTR uDeviceNameOffset
Definition: precomp.h:66
DWORD dwCharacter
Definition: precomp.h:64
NETCON_MEDIATYPE MediaType
Definition: precomp.h:63
ULONG_PTR uNameOffset
Definition: precomp.h:65
NETCON_STATUS Status
Definition: precomp.h:62
NETCON_STATUS Status
Definition: netcon.h:86
LPWSTR pszwDeviceName
Definition: netcon.h:85
NETCON_MEDIATYPE MediaType
Definition: netcon.h:87
uint32_t ULONG_PTR
Definition: typedefs.h:65
uint16_t * PWCHAR
Definition: typedefs.h:56
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by CEnumIDList::Initialize(), and CNetworkConnections::SetNameOf().

◆ ILGetConnData()

◆ ILGetConnection()

HRESULT ILGetConnection ( PCITEMID_CHILD  pidl,
INetConnection **  pItem 
)

Definition at line 77 of file enumlist.cpp.

78{
79 HRESULT hr;
84 NETCON_PROPERTIES * pProperties;
85
87 if (!pdata)
88 return E_FAIL;
89
90 /* get an instance to of IConnectionManager */
91 hr = CNetConnectionManager_CreateInstance(IID_PPV_ARG(INetConnectionManager, &pNetConMan));
93 return hr;
94
95 hr = pNetConMan->EnumConnections(NCME_DEFAULT, &pEnumCon);
97 return hr;
98
99 while (TRUE)
100 {
101 hr = pEnumCon->Next(1, &INetCon, &Count);
102 if (hr != S_OK)
103 return E_FAIL;
104
105 hr = INetCon->GetProperties(&pProperties);
107 continue;
108
109 BOOL bSame = !memcmp(&pProperties->guidId, &pdata->guidId, sizeof(GUID));
110
111 NcFreeNetconProperties(pProperties);
112
113 if (bSame)
114 {
115 *pItem = INetCon.Detach();
116 return S_OK;
117 }
118 }
119
120 return E_FAIL;
121}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
T * Detach()
Definition: atlcomcli.h:186
HRESULT WINAPI CNetConnectionManager_CreateInstance(REFIID riid, LPVOID *ppv)
#define E_FAIL
Definition: ddrawi.h:102
#define TRUE
Definition: types.h:120
#define FAILED_UNEXPECTEDLY(hr)
Definition: precomp.h:121
unsigned int BOOL
Definition: ntddk_ex.h:94
static PROTOCOLDATA * pdata
Definition: protocol.c:158
@ NCME_DEFAULT
Definition: netcon.h:10
int Count
Definition: noreturn.cpp:7
HRESULT hr
Definition: shlfolder.c:183
uint32_t ULONG
Definition: typedefs.h:59
#define IID_PPV_ARG(Itype, ppType)

Referenced by CNetConUiObject::InvokeCommand(), and CNetworkConnections::SetNameOf().

◆ ILGetConnName()

PWCHAR ILGetConnName ( PCITEMID_CHILD  pidl)

Definition at line 17 of file enumlist.cpp.

18{
20 if (!pdata)
21 return NULL;
22 return (PWCHAR)&pidl->mkid.abID[pdata->uNameOffset];
23}

Referenced by CNetworkConnections::GetDetailsOf(), CNetworkConnections::GetDisplayNameOf(), and ILCreateNetConnectItem().

◆ ILGetDeviceName()

PWCHAR ILGetDeviceName ( PCITEMID_CHILD  pidl)

Definition at line 25 of file enumlist.cpp.

26{
28 if (!pdata)
29 return NULL;
30 return (PWCHAR)&pidl->mkid.abID[pdata->uDeviceNameOffset];
31}

Referenced by CNetworkConnections::GetDetailsOf(), and ILCreateNetConnectItem().

◆ InitializePropertySheetPage()

HPROPSHEETPAGE InitializePropertySheetPage ( LPWSTR  resname,
DLGPROC  dlgproc,
LPARAM  lParam,
LPWSTR  szTitle 
)

Definition at line 29 of file netshell.cpp.

30{
31 PROPSHEETPAGEW ppage;
32
33 memset(&ppage, 0x0, sizeof(PROPSHEETPAGEW));
34 ppage.dwSize = sizeof(PROPSHEETPAGEW);
35 ppage.dwFlags = PSP_DEFAULT;
36 ppage.pszTemplate = resname;
37 ppage.pfnDlgProc = dlgproc;
38 ppage.lParam = lParam;
40 if (szTitle)
41 {
42 ppage.dwFlags |= PSP_USETITLE;
43 ppage.pszTitle = szTitle;
44 }
45 return CreatePropertySheetPageW(&ppage);
46}
LPARAM lParam
Definition: combotst.c:139
HPROPSHEETPAGE WINAPI CreatePropertySheetPageW(LPCPROPSHEETPAGEW lpPropSheetPage)
Definition: propsheet.c:3083
TCHAR szTitle[MAX_LOADSTRING]
Definition: magnifier.c:35
HINSTANCE netshell_hInstance
Definition: netshell.cpp:12
#define PSP_USETITLE
Definition: prsht.h:26
#define PSP_DEFAULT
Definition: prsht.h:22
struct _PROPSHEETPAGEW PROPSHEETPAGEW
DLGPROC pfnDlgProc
Definition: prsht.h:226
DWORD dwSize
Definition: prsht.h:214
DWORD dwFlags
Definition: prsht.h:215
LPARAM lParam
Definition: prsht.h:227
LPCWSTR pszTemplate
Definition: prsht.h:218
LPCWSTR pszTitle
Definition: prsht.h:225
HINSTANCE hInstance
Definition: prsht.h:216

Referenced by AddAlternativeDialog(), CNetConnectionPropertyUi::AddPages(), INetCfgComponentPropertyUi_fnMergePropPages(), LaunchAdvancedTcpipSettings(), and ShowStatusPropertyDialog().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( shell  )

Variable Documentation

◆ netshell_hInstance