ReactOS 0.4.17-dev-117-g313be0c
adshlp.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

BOOL WINAPI FreeADsMem (void *)
 
void *WINAPI AllocADsMem (DWORD) __WINE_ALLOC_SIZE(1) __WINE_DEALLOC(FreeADsMem) __WINE_MALLOC
 
void *WINAPI ReallocADsMem (void *, DWORD, DWORD) __WINE_ALLOC_SIZE(3) __WINE_DEALLOC(FreeADsMem)
 
BOOL WINAPI FreeADsStr (WCHAR *)
 
WCHAR *WINAPI AllocADsStr (WCHAR *) __WINE_DEALLOC(FreeADsStr) __WINE_MALLOC
 
HRESULT WINAPI ADsBuildEnumerator (IADsContainer *, IEnumVARIANT **)
 
HRESULT WINAPI ADsBuildVarArrayStr (LPWSTR *, DWORD, VARIANT *)
 
HRESULT WINAPI ADsEnumerateNext (IEnumVARIANT *, ULONG, VARIANT *, ULONG *)
 
HRESULT WINAPI ADsGetObject (LPCWSTR, REFIID, VOID **)
 
HRESULT WINAPI ADsOpenObject (LPCWSTR, LPCWSTR, LPCWSTR, DWORD, REFIID, VOID **)
 

Function Documentation

◆ ADsBuildEnumerator()

HRESULT WINAPI ADsBuildEnumerator ( IADsContainer *  pADsContainer,
IEnumVARIANT **  ppEnumVariant 
)

Definition at line 59 of file activeds_main.c.

60{
61 FIXME("(%p)->(%p)!stub\n",pADsContainer, ppEnumVariant);
62 return E_NOTIMPL;
63}
#define FIXME(fmt,...)
Definition: precomp.h:53
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ ADsBuildVarArrayStr()

HRESULT WINAPI ADsBuildVarArrayStr ( LPWSTR str,
DWORD  count,
VARIANT var 
)

Definition at line 86 of file activeds_main.c.

87{
88 HRESULT hr;
90 LONG idx, end = count;
91
92 TRACE("(%p, %lu, %p)\n", str, count, var);
93
94 if (!var) return E_ADS_BAD_PARAMETER;
95
97 if (!sa) return E_OUTOFMEMORY;
98
100 for (idx = 0; idx < end; idx++)
101 {
103
104 V_VT(&item) = VT_BSTR;
106 if (!V_BSTR(&item))
107 {
109 goto fail;
110 }
111
114 if (hr != S_OK) goto fail;
115 }
116
118 V_ARRAY(var) = sa;
119 return S_OK;
120
121fail:
123 return hr;
124}
static struct sockaddr_in sa
Definition: adnsresfilter.c:69
#define E_ADS_BAD_PARAMETER
Definition: adserr.h:36
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
HRESULT hr
Definition: delayimp.cpp:573
unsigned int idx
Definition: utils.c:41
@ VT_BSTR
Definition: compat.h:2303
@ VT_ARRAY
Definition: compat.h:2341
@ VT_VARIANT
Definition: compat.h:2307
SAFEARRAY *WINAPI SafeArrayCreateVector(VARTYPE vt, LONG lLbound, ULONG cElements)
Definition: safearray.c:677
HRESULT WINAPI SafeArrayDestroy(SAFEARRAY *psa)
Definition: safearray.c:1347
HRESULT WINAPI SafeArrayPutElement(SAFEARRAY *psa, LONG *rgIndices, void *pvData)
Definition: safearray.c:864
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLuint GLuint end
Definition: gl.h:1545
#define S_OK
Definition: intsafe.h:52
const char * var
Definition: shader.c:5666
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:271
#define V_ARRAY(A)
Definition: oleauto.h:222
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
long LONG
Definition: pedump.c:60
const WCHAR * str
#define TRACE(s)
Definition: solgame.cpp:4
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:568

Referenced by test_ADsBuildVarArrayStr().

◆ ADsEnumerateNext()

HRESULT WINAPI ADsEnumerateNext ( IEnumVARIANT pEnumVariant,
ULONG  cElements,
VARIANT pvar,
ULONG pcElementsFetched 
)

Definition at line 77 of file activeds_main.c.

78{
79 FIXME("(%p)->(%lu, %p, %p)!stub\n",pEnumVariant, cElements, pvar, pcElementsFetched);
80 return E_NOTIMPL;
81}

◆ ADsGetObject()

HRESULT WINAPI ADsGetObject ( LPCWSTR  path,
REFIID  riid,
VOID **  obj 
)

Definition at line 46 of file activeds_main.c.

47{
48 HRESULT hr;
49
50 hr = ADsOpenObject(path, NULL, NULL, ADS_SECURE_AUTHENTICATION, riid, obj);
51 if (hr != S_OK)
53 return hr;
54}
HRESULT WINAPI ADsOpenObject(LPCWSTR path, LPCWSTR user, LPCWSTR password, DWORD reserved, REFIID riid, void **obj)
#define NULL
Definition: types.h:112
REFIID riid
Definition: atlbase.h:39

◆ ADsOpenObject()

HRESULT WINAPI ADsOpenObject ( LPCWSTR  path,
LPCWSTR  user,
LPCWSTR  password,
DWORD  reserved,
REFIID  riid,
VOID **  obj 
)

Definition at line 138 of file activeds_main.c.

139{
140 HRESULT hr;
141 HKEY hkey, hprov;
142 WCHAR provider[MAX_PATH], progid[MAX_PATH];
143 DWORD idx = 0;
144
145 TRACE("(%s,%s,%lu,%s,%p)\n", debugstr_w(path), debugstr_w(user), reserved, debugstr_guid(riid), obj);
146
147 if (!path || !riid || !obj)
148 return E_INVALIDARG;
149
150 hr = E_FAIL;
151
152 if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\ADs\\Providers", 0, KEY_READ, &hkey))
153 return hr;
154
155 for (;;)
156 {
157 if (RegEnumKeyW(hkey, idx++, provider, ARRAY_SIZE(provider)))
158 break;
159
160 TRACE("provider %s\n", debugstr_w(provider));
161
162 if (!wcsnicmp(path, provider, wcslen(provider)) && path[wcslen(provider)] == ':')
163 {
164 LONG size;
165
166 if (RegOpenKeyExW(hkey, provider, 0, KEY_READ, &hprov))
167 break;
168
170 if (!RegQueryValueW(hprov, NULL, progid, &size))
171 {
172 CLSID clsid;
173
175 {
176 IADsOpenDSObject *adsopen;
177 IDispatch *disp;
178
179 TRACE("ns %s => clsid %s\n", debugstr_w(progid), wine_dbgstr_guid(&clsid));
180 if (CoCreateInstance(&clsid, 0, CLSCTX_INPROC_SERVER, &IID_IADsOpenDSObject, (void **)&adsopen) == S_OK)
181 {
182 BSTR bpath, buser, bpassword;
183
184 bpath = SysAllocString(path);
185 buser = SysAllocString(user);
186 bpassword = SysAllocString(password);
187
188 hr = IADsOpenDSObject_OpenDSObject(adsopen, bpath, buser, bpassword, reserved, &disp);
189 if (hr == S_OK)
190 {
191 hr = IDispatch_QueryInterface(disp, riid, obj);
192 IDispatch_Release(disp);
193 }
194
195 SysFreeString(bpath);
196 SysFreeString(buser);
197 SysFreeString(bpassword);
198
199 IADsOpenDSObject_Release(adsopen);
200 }
201 }
202 }
203
204 RegCloseKey(hprov);
205 break;
206 }
207 }
208
209 RegCloseKey(hkey);
210
211 return hr;
212}
void user(int argc, const char *argv[])
Definition: cmds.c:1350
#define ARRAY_SIZE(A)
Definition: main.h:20
#define RegCloseKey(hKey)
Definition: registry.h:49
#define E_INVALIDARG
Definition: ddrawi.h:101
#define E_FAIL
Definition: ddrawi.h:102
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
LSTATUS WINAPI RegQueryValueW(HKEY hkey, LPCWSTR name, LPWSTR data, LPLONG count)
Definition: reg.c:4241
LONG WINAPI RegEnumKeyW(HKEY hKey, DWORD dwIndex, LPWSTR lpName, DWORD cbName)
Definition: reg.c:2393
HRESULT WINAPI DECLSPEC_HOTPATCH CLSIDFromProgID(LPCOLESTR progid, CLSID *clsid)
Definition: combase.c:1437
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, IUnknown *outer, DWORD cls_context, REFIID riid, void **obj)
Definition: combase.c:1685
#define wcsnicmp
Definition: compat.h:14
OLECHAR * BSTR
Definition: compat.h:2293
#define MAX_PATH
Definition: compat.h:34
_ACRTIMP size_t __cdecl wcslen(const wchar_t *)
Definition: wcs.c:2983
#define L(x)
Definition: resources.c:13
r reserved
Definition: btrfs.c:3006
#define progid(str)
Definition: exdisp.idl:31
unsigned long DWORD
Definition: ntddk_ex.h:95
GLsizeiptr size
Definition: glext.h:5919
#define debugstr_guid
Definition: kernel32.h:35
#define debugstr_w
Definition: kernel32.h:32
static WCHAR password[]
Definition: url.c:33
const CLSID * clsid
Definition: msctf.cpp:50
#define KEY_READ
Definition: nt_native.h:1026
short WCHAR
Definition: pedump.c:58
static __inline const char * wine_dbgstr_guid(const GUID *id)
Definition: debug.h:171
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by ADsGetObject().

◆ AllocADsMem()

void *WINAPI AllocADsMem ( DWORD  cb)

Definition at line 234 of file activeds_main.c.

235{
236 return malloc(cb);
237}
#define malloc
Definition: debug_ros.c:4
static MonoProfilerRuntimeShutdownBeginCallback cb
Definition: metahost.c:118

◆ AllocADsStr()

WCHAR *WINAPI AllocADsStr ( WCHAR )

◆ FreeADsMem()

BOOL WINAPI FreeADsMem ( void )

◆ FreeADsStr()

BOOL WINAPI FreeADsStr ( WCHAR )

◆ ReallocADsMem()

void *WINAPI ReallocADsMem ( void ,
DWORD  ,
DWORD   
)