wbemprox: Add support for enumerating class methods.
[wine/multimedia.git] / dlls / scrrun / filesystem.c
blob5c8fb7d487f1dff0f0614c812bebbe7420de7380
1 /*
2 * Copyright 2012 Alistair Leslie-Hughes
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #define COBJMACROS
21 #include "config.h"
22 #include <stdarg.h>
24 #include "windef.h"
25 #include "winbase.h"
26 #include "ole2.h"
27 #include "dispex.h"
28 #include "scrrun.h"
29 #include "scrrun_private.h"
31 #include "wine/debug.h"
33 WINE_DEFAULT_DEBUG_CHANNEL(scrrun);
35 static HRESULT WINAPI filesys_QueryInterface(IFileSystem3 *iface, REFIID riid, void **ppvObject)
37 TRACE("%p %s %p\n", iface, debugstr_guid(riid), ppvObject);
39 if ( IsEqualGUID( riid, &IID_IFileSystem3 ) ||
40 IsEqualGUID( riid, &IID_IFileSystem ) ||
41 IsEqualGUID( riid, &IID_IDispatch ) ||
42 IsEqualGUID( riid, &IID_IUnknown ) )
44 *ppvObject = iface;
46 else if ( IsEqualGUID( riid, &IID_IDispatchEx ))
48 TRACE("Interface IDispatchEx not supported - returning NULL\n");
49 *ppvObject = NULL;
50 return E_NOINTERFACE;
52 else if ( IsEqualGUID( riid, &IID_IObjectWithSite ))
54 TRACE("Interface IObjectWithSite not supported - returning NULL\n");
55 *ppvObject = NULL;
56 return E_NOINTERFACE;
58 else
60 FIXME("Unsupported interface %s\n", debugstr_guid(riid));
61 return E_NOINTERFACE;
64 IFileSystem3_AddRef(iface);
66 return S_OK;
69 static ULONG WINAPI filesys_AddRef(IFileSystem3 *iface)
71 TRACE("%p\n", iface);
73 return 2;
76 static ULONG WINAPI filesys_Release(IFileSystem3 *iface)
78 TRACE("%p\n", iface);
80 return 1;
83 static HRESULT WINAPI filesys_GetTypeInfoCount(IFileSystem3 *iface, UINT *pctinfo)
85 TRACE("(%p)->(%p)\n", iface, pctinfo);
87 *pctinfo = 1;
88 return S_OK;
91 static HRESULT WINAPI filesys_GetTypeInfo(IFileSystem3 *iface, UINT iTInfo,
92 LCID lcid, ITypeInfo **ppTInfo)
94 TRACE("(%p)->(%u %u %p)\n", iface, iTInfo, lcid, ppTInfo);
95 return get_typeinfo(IFileSystem3_tid, ppTInfo);}
97 static HRESULT WINAPI filesys_GetIDsOfNames(IFileSystem3 *iface, REFIID riid,
98 LPOLESTR *rgszNames, UINT cNames,
99 LCID lcid, DISPID *rgDispId)
101 ITypeInfo *typeinfo;
102 HRESULT hr;
104 TRACE("(%p)->(%s %p %u %u %p)\n", iface, debugstr_guid(riid), rgszNames, cNames, lcid, rgDispId);
106 hr = get_typeinfo(IFileSystem3_tid, &typeinfo);
107 if(SUCCEEDED(hr))
109 hr = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId);
110 ITypeInfo_Release(typeinfo);
113 return hr;
116 static HRESULT WINAPI filesys_Invoke(IFileSystem3 *iface, DISPID dispIdMember,
117 REFIID riid, LCID lcid, WORD wFlags,
118 DISPPARAMS *pDispParams, VARIANT *pVarResult,
119 EXCEPINFO *pExcepInfo, UINT *puArgErr)
121 ITypeInfo *typeinfo;
122 HRESULT hr;
124 TRACE("(%p)->(%d %s %d %d %p %p %p %p)\n", iface, dispIdMember, debugstr_guid(riid),
125 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
127 hr = get_typeinfo(IFileSystem3_tid, &typeinfo);
128 if(SUCCEEDED(hr))
130 hr = ITypeInfo_Invoke(typeinfo, &iface, dispIdMember, wFlags,
131 pDispParams, pVarResult, pExcepInfo, puArgErr);
132 ITypeInfo_Release(typeinfo);
135 return hr;
138 static HRESULT WINAPI filesys_get_Drives(IFileSystem3 *iface, IDriveCollection **ppdrives)
140 FIXME("%p %p\n", iface, ppdrives);
142 return E_NOTIMPL;
145 static HRESULT WINAPI filesys_BuildPath(IFileSystem3 *iface, BSTR Path,
146 BSTR Name, BSTR *pbstrResult)
148 FIXME("%p %s %s %p\n", iface, debugstr_w(Path), debugstr_w(Name), pbstrResult);
150 return E_NOTIMPL;
153 static HRESULT WINAPI filesys_GetDriveName(IFileSystem3 *iface, BSTR Path,
154 BSTR *pbstrResult)
156 FIXME("%p %s %p\n", iface, debugstr_w(Path), pbstrResult);
158 return E_NOTIMPL;
161 static HRESULT WINAPI filesys_GetParentFolderName(IFileSystem3 *iface, BSTR Path,
162 BSTR *pbstrResult)
164 FIXME("%p %s %p\n", iface, debugstr_w(Path), pbstrResult);
166 return E_NOTIMPL;
169 static HRESULT WINAPI filesys_GetFileName(IFileSystem3 *iface, BSTR Path,
170 BSTR *pbstrResult)
172 FIXME("%p %s %p\n", iface, debugstr_w(Path), pbstrResult);
174 return E_NOTIMPL;
177 static HRESULT WINAPI filesys_GetBaseName(IFileSystem3 *iface, BSTR Path,
178 BSTR *pbstrResult)
180 FIXME("%p %s %p\n", iface, debugstr_w(Path), pbstrResult);
182 return E_NOTIMPL;
185 static HRESULT WINAPI filesys_GetExtensionName(IFileSystem3 *iface, BSTR Path,
186 BSTR *pbstrResult)
188 FIXME("%p %s %p\n", iface, debugstr_w(Path), pbstrResult);
190 return E_NOTIMPL;
193 static HRESULT WINAPI filesys_GetAbsolutePathName(IFileSystem3 *iface, BSTR Path,
194 BSTR *pbstrResult)
196 FIXME("%p %s %p\n", iface, debugstr_w(Path), pbstrResult);
198 return E_NOTIMPL;
201 static HRESULT WINAPI filesys_GetTempName(IFileSystem3 *iface, BSTR *pbstrResult)
203 FIXME("%p %p\n", iface, pbstrResult);
205 return E_NOTIMPL;
208 static HRESULT WINAPI filesys_DriveExists(IFileSystem3 *iface, BSTR DriveSpec,
209 VARIANT_BOOL *pfExists)
211 FIXME("%p %s %p\n", iface, debugstr_w(DriveSpec), pfExists);
213 return E_NOTIMPL;
216 static HRESULT WINAPI filesys_FileExists(IFileSystem3 *iface, BSTR path, VARIANT_BOOL *ret)
218 TRACE("%p %s %p\n", iface, debugstr_w(path), ret);
220 if (!ret) return E_POINTER;
222 *ret = GetFileAttributesW(path) != INVALID_FILE_ATTRIBUTES ? VARIANT_TRUE : VARIANT_FALSE;
223 return S_OK;
226 static HRESULT WINAPI filesys_FolderExists(IFileSystem3 *iface, BSTR FolderSpec,
227 VARIANT_BOOL *pfExists)
229 FIXME("%p %s %p\n", iface, debugstr_w(FolderSpec), pfExists);
231 return E_NOTIMPL;
234 static HRESULT WINAPI filesys_GetDrive(IFileSystem3 *iface, BSTR DriveSpec,
235 IDrive **ppdrive)
237 FIXME("%p %s %p\n", iface, debugstr_w(DriveSpec), ppdrive);
239 return E_NOTIMPL;
242 static HRESULT WINAPI filesys_GetFile(IFileSystem3 *iface, BSTR FilePath,
243 IFile **ppfile)
245 FIXME("%p %s %p\n", iface, debugstr_w(FilePath), ppfile);
247 return E_NOTIMPL;
250 static HRESULT WINAPI filesys_GetFolder(IFileSystem3 *iface, BSTR FolderPath,
251 IFolder **ppfolder)
253 FIXME("%p %s %p\n", iface, debugstr_w(FolderPath), ppfolder);
255 return E_NOTIMPL;
258 static HRESULT WINAPI filesys_GetSpecialFolder(IFileSystem3 *iface,
259 SpecialFolderConst SpecialFolder,
260 IFolder **ppfolder)
262 FIXME("%p %d %p\n", iface, SpecialFolder, ppfolder);
264 return E_NOTIMPL;
267 static HRESULT WINAPI filesys_DeleteFile(IFileSystem3 *iface, BSTR FileSpec,
268 VARIANT_BOOL Force)
270 FIXME("%p %s %d\n", iface, debugstr_w(FileSpec), Force);
272 return E_NOTIMPL;
275 static HRESULT WINAPI filesys_DeleteFolder(IFileSystem3 *iface, BSTR FolderSpec,
276 VARIANT_BOOL Force)
278 FIXME("%p %s %d\n", iface, debugstr_w(FolderSpec), Force);
280 return E_NOTIMPL;
283 static HRESULT WINAPI filesys_MoveFile(IFileSystem3 *iface, BSTR Source,
284 BSTR Destination)
286 FIXME("%p %s %s\n", iface, debugstr_w(Source), debugstr_w(Destination));
288 return E_NOTIMPL;
291 static HRESULT WINAPI filesys_MoveFolder(IFileSystem3 *iface,BSTR Source,
292 BSTR Destination)
294 FIXME("%p %s %s\n", iface, debugstr_w(Source), debugstr_w(Destination));
296 return E_NOTIMPL;
299 static HRESULT WINAPI filesys_CopyFile(IFileSystem3 *iface, BSTR Source,
300 BSTR Destination, VARIANT_BOOL OverWriteFiles)
302 FIXME("%p %s %s %d\n", iface, debugstr_w(Source), debugstr_w(Destination), OverWriteFiles);
304 return E_NOTIMPL;
307 static HRESULT WINAPI filesys_CopyFolder(IFileSystem3 *iface, BSTR Source,
308 BSTR Destination, VARIANT_BOOL OverWriteFiles)
310 FIXME("%p %s %s %d\n", iface, debugstr_w(Source), debugstr_w(Destination), OverWriteFiles);
312 return E_NOTIMPL;
315 static HRESULT WINAPI filesys_CreateFolder(IFileSystem3 *iface, BSTR Path,
316 IFolder **ppfolder)
318 FIXME("%p %s %p\n", iface, debugstr_w(Path), ppfolder);
320 return E_NOTIMPL;
323 static HRESULT WINAPI filesys_CreateTextFile(IFileSystem3 *iface, BSTR FileName,
324 VARIANT_BOOL Overwrite, VARIANT_BOOL Unicode,
325 ITextStream **ppts)
327 FIXME("%p %s %d %d %p\n", iface, debugstr_w(FileName), Overwrite, Unicode, ppts);
329 return E_NOTIMPL;
332 static HRESULT WINAPI filesys_OpenTextFile(IFileSystem3 *iface, BSTR FileName,
333 IOMode IOMode, VARIANT_BOOL Create,
334 Tristate Format, ITextStream **ppts)
336 FIXME("%p %s %d %d %d %p\n", iface, debugstr_w(FileName), IOMode, Create, Format, ppts);
338 return E_NOTIMPL;
341 static HRESULT WINAPI filesys_GetStandardStream(IFileSystem3 *iface,
342 StandardStreamTypes StandardStreamType,
343 VARIANT_BOOL Unicode,
344 ITextStream **ppts)
346 FIXME("%p %d %d %p\n", iface, StandardStreamType, Unicode, ppts);
348 return E_NOTIMPL;
351 static HRESULT WINAPI filesys_GetFileVersion(IFileSystem3 *iface, BSTR FileName,
352 BSTR *FileVersion)
354 FIXME("%p %s %p\n", iface, debugstr_w(FileName), FileVersion);
356 return E_NOTIMPL;
359 static const struct IFileSystem3Vtbl filesys_vtbl =
361 filesys_QueryInterface,
362 filesys_AddRef,
363 filesys_Release,
364 filesys_GetTypeInfoCount,
365 filesys_GetTypeInfo,
366 filesys_GetIDsOfNames,
367 filesys_Invoke,
368 filesys_get_Drives,
369 filesys_BuildPath,
370 filesys_GetDriveName,
371 filesys_GetParentFolderName,
372 filesys_GetFileName,
373 filesys_GetBaseName,
374 filesys_GetExtensionName,
375 filesys_GetAbsolutePathName,
376 filesys_GetTempName,
377 filesys_DriveExists,
378 filesys_FileExists,
379 filesys_FolderExists,
380 filesys_GetDrive,
381 filesys_GetFile,
382 filesys_GetFolder,
383 filesys_GetSpecialFolder,
384 filesys_DeleteFile,
385 filesys_DeleteFolder,
386 filesys_MoveFile,
387 filesys_MoveFolder,
388 filesys_CopyFile,
389 filesys_CopyFolder,
390 filesys_CreateFolder,
391 filesys_CreateTextFile,
392 filesys_OpenTextFile,
393 filesys_GetStandardStream,
394 filesys_GetFileVersion
397 static IFileSystem3 filesystem = { &filesys_vtbl };
399 HRESULT WINAPI FileSystem_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv)
401 TRACE("(%p %s %p)\n", outer, debugstr_guid(riid), ppv);
403 return IFileSystem3_QueryInterface(&filesystem, riid, ppv);