ReactOS  0.4.14-dev-41-g31d7680
netshell.cpp
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS Shell
3  * LICENSE: LGPL-2.1-or-later (https://spdx.org/licenses/LGPL-2.1-or-later)
4  * PURPOSE: ReactOS Networking Configuration
5  * COPYRIGHT: Copyright 2008 Johannes Anderwald (johannes.anderwald@reactos.org)
6  */
7 
8 #include "precomp.h"
9 
11 
13 
15 {
16 public:
17 };
18 
19 BEGIN_OBJECT_MAP(ObjectMap)
20  OBJECT_ENTRY(CLSID_ConnectionFolder, CNetworkConnections)
22  OBJECT_ENTRY(CLSID_LanConnectionUi, CNetConnectionPropertyUi)
23  OBJECT_ENTRY(CLSID_ConnectionTray, CLanStatus)
25 
27 
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 }
47 
48 extern "C"
49 {
50 
51 BOOL
52 WINAPI
53 DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
54 {
55  switch (fdwReason)
56  {
57  case DLL_PROCESS_ATTACH:
58  netshell_hInstance = hinstDLL;
60  gModule.Init(ObjectMap, netshell_hInstance, NULL);
61  break;
62  default:
63  break;
64  }
65 
66  return TRUE;
67 }
68 
69 HRESULT
70 WINAPI
72 {
73  return S_FALSE;
74 }
75 
76 STDAPI
78 {
79  HRESULT hr;
80 
83  return hr;
84 
87  return hr;
88 
89  return S_OK;
90 }
91 
92 STDAPI
94 {
95  HRESULT hr;
96 
99  return hr;
100 
102  if (FAILED_UNEXPECTEDLY(hr))
103  return hr;
104 
105  return S_OK;
106 }
107 
108 STDAPI
110  REFCLSID rclsid,
111  REFIID riid,
112  LPVOID *ppv)
113 {
114  return gModule.DllGetClassObject(rclsid, riid, ppv);
115 }
116 
117 VOID
118 WINAPI
120 {
121  CoTaskMemFree(pProps->pszwName);
122  CoTaskMemFree(pProps->pszwDeviceName);
123  CoTaskMemFree(pProps);
124 }
125 
126 BOOL
127 WINAPI
129 {
130  if (!pszwName)
131  return FALSE;
132 
133  BOOL nonSpace = FALSE;
134  while (*pszwName)
135  {
136  switch(*(pszwName++))
137  {
138  case L'\\':
139  case L'/':
140  case L':':
141  case L'*':
142  case L'\t':
143  case L'?':
144  case L'<':
145  case L'>':
146  case L'|':
147  case L'\"':
148  return FALSE;
149  case L' ':
150  break;
151  default:
152  nonSpace = TRUE;
153  break;
154  }
155  }
156  return nonSpace;
157 }
158 
159 } // extern "C"
#define STDAPI
Definition: basetyps.h:41
const uint16_t * PCWSTR
Definition: typedefs.h:55
#define REFIID
Definition: guiddef.h:118
#define TRUE
Definition: types.h:120
HRESULT DllRegisterServer(BOOL bRegTypeLib=TRUE)
Definition: atlbase.h:940
LPWSTR pszwDeviceName
Definition: netcon.h:85
#define IDR_NETSHELL
Definition: resource.h:127
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:422
LPCWSTR pszTemplate
Definition: prsht.h:209
HRESULT hr
Definition: shlfolder.c:183
GLint x0
Definition: linetemp.h:95
#define OBJECT_ENTRY(clsid, class)
Definition: atlcom.h:653
REFIID riid
Definition: precomp.h:44
#define REFCLSID
Definition: guiddef.h:117
REFIID LPVOID * ppv
Definition: atlbase.h:39
HMODULE g_hModule
Definition: netshell.cpp:10
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
#define DLL_PROCESS_ATTACH
Definition: compat.h:120
VOID WINAPI NcFreeNetconProperties(NETCON_PROPERTIES *pProps)
Definition: netshell.cpp:119
HINSTANCE netshell_hInstance
Definition: netshell.cpp:12
EXTERN_C const CLSID CLSID_ConnectionManager
Definition: netcon.h:172
HRESULT Init(_ATL_OBJMAP_ENTRY *p, HINSTANCE, const GUID *plibid)
Definition: atlbase.h:797
DWORD dwSize
Definition: prsht.h:205
unsigned int BOOL
Definition: ntddk_ex.h:94
DLGPROC pfnDlgProc
Definition: prsht.h:217
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
#define S_FALSE
Definition: winerror.h:2357
BOOL WINAPI NcIsValidConnectionName(_In_ PCWSTR pszwName)
Definition: netshell.cpp:128
HRESULT DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
Definition: atlbase.h:935
struct _PROPSHEETPAGEW PROPSHEETPAGEW
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
HPROPSHEETPAGE InitializePropertySheetPage(LPWSTR resname, DLGPROC dlgproc, LPARAM lParam, LPWSTR szTitle)
Definition: netshell.cpp:29
LPCWSTR pszTitle
Definition: prsht.h:216
HPROPSHEETPAGE WINAPI CreatePropertySheetPageW(LPCPROPSHEETPAGEW lpPropSheetPage)
Definition: propsheet.c:3072
#define PSP_DEFAULT
Definition: prsht.h:22
HRESULT WINAPI UpdateRegistryFromResource(LPCTSTR lpszRes, BOOL bRegister, struct _ATL_REGMAP_ENTRY *pMapEntries=NULL)
Definition: atlbase.h:439
LONG HRESULT
Definition: typedefs.h:77
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:71
#define WINAPI
Definition: msvc.h:8
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
Definition: netshell.cpp:53
TCHAR szTitle[MAX_LOADSTRING]
Definition: magnifier.c:35
static const WCHAR L[]
Definition: oid.c:1250
LPARAM lParam
Definition: prsht.h:218
HINSTANCE hInstance
Definition: prsht.h:207
STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
Definition: netshell.cpp:109
STDAPI DllUnregisterServer(void)
Definition: netshell.cpp:93
#define PSP_USETITLE
Definition: prsht.h:26
STDAPI DllRegisterServer(void)
Definition: netshell.cpp:77
INT_PTR(CALLBACK * DLGPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2870
#define _In_
Definition: no_sal2.h:204
#define S_OK
Definition: intsafe.h:59
DWORD LPVOID fImpLoad
Definition: misc.cpp:155
HRESULT WINAPI DllCanUnloadNow(void)
Definition: netshell.cpp:71
#define BEGIN_OBJECT_MAP(x)
Definition: atlcom.h:649
HRESULT DllUnregisterServer(BOOL bUnRegTypeLib=TRUE)
Definition: atlbase.h:945
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define memset(x, y, z)
Definition: compat.h:39
CNetshellModule gModule
Definition: netshell.cpp:26
LPARAM lParam
Definition: combotst.c:139
DWORD dwFlags
Definition: prsht.h:206
#define END_OBJECT_MAP()
Definition: atlcom.h:651