ReactOS 0.4.15-dev-8621-g4b051b9
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 <pshpack1.h>
#include <poppack.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 NETCONIDSTRUCT_SIG   0x4EFF
 
#define NCCF_NOTIFY_DISCONNECTED   0x100000
 

Typedefs

typedef struct tagNETCONIDSTRUCT NETCONIDSTRUCT
 
typedef struct tagNETCONIDSTRUCTPNETCONIDSTRUCT
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (shell)
 
 C_ASSERT (2+FIELD_OFFSET(NETCONIDSTRUCT, clsidThisObject)==2+(2+8))
 
 C_ASSERT (2+FIELD_OFFSET(NETCONIDSTRUCT, guidId)==2+(2+8+16))
 
 C_ASSERT (2+FIELD_OFFSET(NETCONIDSTRUCT, dwCharacter)==2+(2+8+32))
 
 C_ASSERT (2+FIELD_OFFSET(NETCONIDSTRUCT, MediaType)==2+(2+8+36))
 
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 86 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.

◆ NETCONIDSTRUCT_SIG

#define NETCONIDSTRUCT_SIG   0x4EFF

Definition at line 59 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

◆ C_ASSERT() [1/4]

C_ASSERT ( 2+  FIELD_OFFSETNETCONIDSTRUCT, clsidThisObject = =2+(2+8))

◆ C_ASSERT() [2/4]

C_ASSERT ( 2+  FIELD_OFFSETNETCONIDSTRUCT, dwCharacter = =2+(2+8+32))

◆ C_ASSERT() [3/4]

C_ASSERT ( 2+  FIELD_OFFSETNETCONIDSTRUCT, guidId = =2+(2+8+16))

◆ C_ASSERT() [4/4]

C_ASSERT ( 2+  FIELD_OFFSETNETCONIDSTRUCT, MediaType = =2+(2+8+36))

◆ CEnumIDList_CreateInstance()

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

Definition at line 345 of file enumlist.cpp.

346{
347 return ShellObjectCreatorInit<CEnumIDList>(riid, ppv);
348}
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 37 of file enumlist.cpp.

38{
39 PITEMID_CHILD pidl;
41 NETCON_PROPERTIES * pProperties;
42 PNETCONIDSTRUCT pnetid;
43 PWCHAR pwchName;
44
45 if (pItem->GetProperties(&pProperties) != S_OK)
46 return NULL;
47
48 size = sizeof(WORD); /* nr of bytes in this item */
49 size += sizeof(NETCONIDSTRUCT);
50 size += (wcslen(pProperties->pszwName) + 1) * sizeof(WCHAR);
51 size += (wcslen(pProperties->pszwDeviceName) + 1) * sizeof(WCHAR);
52
53 /* Allocate enough memory for the trailing id which will indicate that this is a simple id */
54 pidl = static_cast<LPITEMIDLIST>(SHAlloc(size + sizeof(SHITEMID)));
55 if (!pidl)
56 goto end;
57 pidl->mkid.cb = (WORD)size;
59
60 /* Copy the connection properties */
61 pnetid = ILGetConnData(pidl);
62 memset(pnetid->Unknown, 0, sizeof(pnetid->Unknown));
63 pnetid->clsidThisObject = pProperties->clsidThisObject;
64 pnetid->guidId = pProperties->guidId;
65 pnetid->Status = pProperties->Status;
66 pnetid->MediaType = pProperties->MediaType;
67 pnetid->dwCharacter = pProperties->dwCharacter;
68 pnetid->uNameOffset = sizeof(NETCONIDSTRUCT);
69 pnetid->uDeviceNameOffset = ULONG(pnetid->uNameOffset + (wcslen(pProperties->pszwName) + 1) * sizeof(WCHAR));
70
71 pwchName = ILGetConnName(pidl);
72 wcscpy(pwchName, pProperties->pszwName);
73
74 pwchName = ILGetDeviceName(pidl);
75 wcscpy(pwchName, pProperties->pszwDeviceName);
76
77 /* Set the trailing id to null */
78 memset((void*)((ULONG_PTR)pidl + size), 0, sizeof(SHITEMID));
79end:
80 NcFreeNetconProperties(pProperties);
81
82 return pidl;
83}
#define NULL
Definition: types.h:112
#define NETCONIDSTRUCT_SIG
Definition: precomp.h:59
struct tagNETCONIDSTRUCT NETCONIDSTRUCT
struct tagNETCONIDSTRUCT * PNETCONIDSTRUCT
static const WCHAR Signature[]
Definition: parser.c:141
LPVOID WINAPI SHAlloc(SIZE_T len)
Definition: shellole.c:304
PWCHAR ILGetDeviceName(PCITEMID_CHILD pidl)
Definition: enumlist.cpp:29
PNETCONIDSTRUCT ILGetConnData(PCITEMID_CHILD pidl)
Definition: enumlist.cpp:10
PWCHAR ILGetConnName(PCITEMID_CHILD pidl)
Definition: enumlist.cpp:21
unsigned short WORD
Definition: ntddk_ex.h:93
GLuint GLuint end
Definition: gl.h:1545
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
DWORD dwCharacter
Definition: precomp.h:66
NETCON_MEDIATYPE MediaType
Definition: precomp.h:67
BYTE Unknown[8]
Definition: precomp.h:63
NETCON_STATUS Status
Definition: precomp.h:68
ULONG uDeviceNameOffset
Definition: precomp.h:70
ULONG uNameOffset
Definition: precomp.h:69
CLSID clsidThisObject
Definition: precomp.h:64
NETCON_STATUS Status
Definition: netcon.h:86
LPWSTR pszwDeviceName
Definition: netcon.h:85
CLSID clsidThisObject
Definition: netcon.h:89
NETCON_MEDIATYPE MediaType
Definition: netcon.h:87
uint32_t ULONG_PTR
Definition: typedefs.h:65
uint16_t * PWCHAR
Definition: typedefs.h:56
uint32_t ULONG
Definition: typedefs.h:59
__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 85 of file enumlist.cpp.

86{
87 HRESULT hr;
92 NETCON_PROPERTIES * pProperties;
93
95 if (!pdata)
96 return E_FAIL;
97
98 /* get an instance to of IConnectionManager */
99 hr = CNetConnectionManager_CreateInstance(IID_PPV_ARG(INetConnectionManager, &pNetConMan));
101 return hr;
102
103 hr = pNetConMan->EnumConnections(NCME_DEFAULT, &pEnumCon);
105 return hr;
106
107 while (TRUE)
108 {
109 hr = pEnumCon->Next(1, &INetCon, &Count);
110 if (hr != S_OK)
111 return E_FAIL;
112
113 hr = INetCon->GetProperties(&pProperties);
115 continue;
116
117 BOOL bSame = !memcmp(&pProperties->guidId, &pdata->guidId, sizeof(GUID));
118
119 NcFreeNetconProperties(pProperties);
120
121 if (bSame)
122 {
123 *pItem = INetCon.Detach();
124 return S_OK;
125 }
126 }
127
128 return E_FAIL;
129}
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
#define IID_PPV_ARG(Itype, ppType)

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

◆ ILGetConnName()

PWCHAR ILGetConnName ( PCITEMID_CHILD  pidl)

Definition at line 21 of file enumlist.cpp.

22{
24 if (!pdata)
25 return NULL;
26 return (PWCHAR)&pidl->mkid.abID[pdata->uNameOffset];
27}

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

◆ ILGetDeviceName()

PWCHAR ILGetDeviceName ( PCITEMID_CHILD  pidl)

Definition at line 29 of file enumlist.cpp.

30{
32 if (!pdata)
33 return NULL;
34 return (PWCHAR)&pidl->mkid.abID[pdata->uDeviceNameOffset];
35}

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:3086
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