[NETSHELL] Change Turkish translation.
[reactos.git] / dll / shellext / netshell / netshell.cpp
1 #include "precomp.h"
2
3 #include <olectl.h>
4
5 HINSTANCE netshell_hInstance;
6
7 extern "C"
8 {
9
10 /* FIXME: rpcproxy.h */
11 HRESULT __wine_register_resources(HMODULE module);
12 HRESULT __wine_unregister_resources(HMODULE module);
13
14 BOOL
15 WINAPI
16 DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
17 {
18 switch (fdwReason)
19 {
20 case DLL_PROCESS_ATTACH:
21 netshell_hInstance = hinstDLL;
22 DisableThreadLibraryCalls(netshell_hInstance);
23 break;
24 default:
25 break;
26 }
27
28 return TRUE;
29 }
30
31 HRESULT
32 WINAPI
33 DllCanUnloadNow(void)
34 {
35 return S_FALSE;
36 }
37
38 STDAPI
39 DllRegisterServer(void)
40 {
41 return __wine_register_resources(netshell_hInstance);
42 }
43
44 STDAPI
45 DllUnregisterServer(void)
46 {
47 return __wine_unregister_resources(netshell_hInstance);
48 }
49
50 STDAPI
51 DllGetClassObject(
52 REFCLSID rclsid,
53 REFIID riid,
54 LPVOID *ppv)
55 {
56 if (!ppv)
57 return E_INVALIDARG;
58
59 *ppv = NULL;
60
61 return IClassFactory_fnConstructor(rclsid, riid, ppv);
62 }
63
64 VOID
65 WINAPI
66 NcFreeNetconProperties(NETCON_PROPERTIES *pProps)
67 {
68 CoTaskMemFree(pProps->pszwName);
69 CoTaskMemFree(pProps->pszwDeviceName);
70 CoTaskMemFree(pProps);
71 }
72
73 BOOL
74 WINAPI
75 NcIsValidConnectionName(_In_ PCWSTR pszwName)
76 {
77 if (!pszwName)
78 return FALSE;
79
80 BOOL nonSpace = FALSE;
81 while (*pszwName)
82 {
83 switch(*(pszwName++))
84 {
85 case L'\\':
86 case L'/':
87 case L':':
88 case L'*':
89 case L'\t':
90 case L'?':
91 case L'<':
92 case L'>':
93 case L'|':
94 case L'\"':
95 return FALSE;
96 case L' ':
97 break;
98 default:
99 nonSpace = TRUE;
100 break;
101 }
102 }
103 return nonSpace;
104 }
105
106 } // extern "C"