po: Update French translation.
[wine] / dlls / scrrun / filesystem.c
1 /*
2  * Copyright 2012 Alistair Leslie-Hughes
3  *
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.
8  *
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.
13  *
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
17  */
18
19 #define COBJMACROS
20
21 #include "config.h"
22 #include <stdarg.h>
23
24 #include "windef.h"
25 #include "winbase.h"
26 #include "ole2.h"
27 #include "dispex.h"
28 #include "scrrun.h"
29
30 #include "wine/debug.h"
31
32 WINE_DEFAULT_DEBUG_CHANNEL(scrrun);
33
34 static HRESULT WINAPI filesys_QueryInterface(IFileSystem3 *iface, REFIID riid, void **ppvObject)
35 {
36     TRACE("%p %s %p\n", iface, debugstr_guid(riid), ppvObject);
37
38     if ( IsEqualGUID( riid, &IID_IFileSystem3 ) ||
39          IsEqualGUID( riid, &IID_IFileSystem ) ||
40          IsEqualGUID( riid, &IID_IDispatch ) ||
41          IsEqualGUID( riid, &IID_IUnknown ) )
42     {
43         *ppvObject = iface;
44     }
45     else if ( IsEqualGUID( riid, &IID_IDispatchEx ))
46     {
47         TRACE("Interface IDispatchEx not supported - returning NULL\n");
48         *ppvObject = NULL;
49         return E_NOINTERFACE;
50     }
51     else if ( IsEqualGUID( riid, &IID_IObjectWithSite ))
52     {
53         TRACE("Interface IObjectWithSite not supported - returning NULL\n");
54         *ppvObject = NULL;
55         return E_NOINTERFACE;
56     }
57     else
58     {
59         FIXME("Unsupported interface %s\n", debugstr_guid(riid));
60         return E_NOINTERFACE;
61     }
62
63     IFileSystem3_AddRef(iface);
64
65     return S_OK;
66 }
67
68 static ULONG WINAPI filesys_AddRef(IFileSystem3 *iface)
69 {
70     TRACE("%p\n", iface);
71
72     return 2;
73 }
74
75 static ULONG WINAPI filesys_Release(IFileSystem3 *iface)
76 {
77     TRACE("%p\n", iface);
78
79     return 1;
80 }
81
82 static HRESULT WINAPI filesys_GetTypeInfoCount(IFileSystem3 *iface, UINT *pctinfo)
83 {
84     TRACE("(%p)->(%p)\n", iface, pctinfo);
85
86     *pctinfo = 1;
87     return S_OK;
88 }
89
90 static HRESULT WINAPI filesys_GetTypeInfo(IFileSystem3 *iface, UINT iTInfo,
91                                         LCID lcid, ITypeInfo **ppTInfo)
92 {
93     FIXME("(%p)->(%u %u %p)\n", iface, iTInfo, lcid, ppTInfo);
94
95     return E_NOTIMPL;
96 }
97
98 static HRESULT WINAPI filesys_GetIDsOfNames(IFileSystem3 *iface, REFIID riid,
99                                         LPOLESTR *rgszNames, UINT cNames,
100                                         LCID lcid, DISPID *rgDispId)
101 {
102     FIXME("(%p)->(%s %p %u %u %p)\n", iface, debugstr_guid(riid), rgszNames, cNames,
103           lcid, rgDispId);
104
105     return E_NOTIMPL;
106 }
107
108 static HRESULT WINAPI filesys_Invoke(IFileSystem3 *iface, DISPID dispIdMember,
109                                       REFIID riid, LCID lcid, WORD wFlags,
110                                       DISPPARAMS *pDispParams, VARIANT *pVarResult,
111                                       EXCEPINFO *pExcepInfo, UINT *puArgErr)
112 {
113     FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", iface, dispIdMember, debugstr_guid(riid),
114           lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
115
116     return E_NOTIMPL;
117 }
118
119 static HRESULT WINAPI filesys_get_Drives(IFileSystem3 *iface, IDriveCollection **ppdrives)
120 {
121     FIXME("%p %p\n", iface, ppdrives);
122
123     return E_NOTIMPL;
124 }
125
126 static HRESULT WINAPI filesys_BuildPath(IFileSystem3 *iface, BSTR Path,
127                                             BSTR Name, BSTR *pbstrResult)
128 {
129     FIXME("%p %s %s %p\n", iface, debugstr_w(Path), debugstr_w(Name), pbstrResult);
130
131     return E_NOTIMPL;
132 }
133
134 static HRESULT WINAPI filesys_GetDriveName(IFileSystem3 *iface, BSTR Path,
135                                             BSTR *pbstrResult)
136 {
137     FIXME("%p %s %p\n", iface, debugstr_w(Path), pbstrResult);
138
139     return E_NOTIMPL;
140 }
141
142 static HRESULT WINAPI filesys_GetParentFolderName(IFileSystem3 *iface, BSTR Path,
143                                             BSTR *pbstrResult)
144 {
145     FIXME("%p %s %p\n", iface, debugstr_w(Path), pbstrResult);
146
147     return E_NOTIMPL;
148 }
149
150 static HRESULT WINAPI filesys_GetFileName(IFileSystem3 *iface, BSTR Path,
151                                             BSTR *pbstrResult)
152 {
153     FIXME("%p %s %p\n", iface, debugstr_w(Path), pbstrResult);
154
155     return E_NOTIMPL;
156 }
157
158 static HRESULT WINAPI filesys_GetBaseName(IFileSystem3 *iface, BSTR Path,
159                                             BSTR *pbstrResult)
160 {
161     FIXME("%p %s %p\n", iface, debugstr_w(Path), pbstrResult);
162
163     return E_NOTIMPL;
164 }
165
166 static HRESULT WINAPI filesys_GetExtensionName(IFileSystem3 *iface, BSTR Path,
167                                             BSTR *pbstrResult)
168 {
169     FIXME("%p %s %p\n", iface, debugstr_w(Path), pbstrResult);
170
171     return E_NOTIMPL;
172 }
173
174 static HRESULT WINAPI filesys_GetAbsolutePathName(IFileSystem3 *iface, BSTR Path,
175                                             BSTR *pbstrResult)
176 {
177     FIXME("%p %s %p\n", iface, debugstr_w(Path), pbstrResult);
178
179     return E_NOTIMPL;
180 }
181
182 static HRESULT WINAPI filesys_GetTempName(IFileSystem3 *iface, BSTR *pbstrResult)
183 {
184     FIXME("%p %p\n", iface, pbstrResult);
185
186     return E_NOTIMPL;
187 }
188
189 static HRESULT WINAPI filesys_DriveExists(IFileSystem3 *iface, BSTR DriveSpec,
190                                             VARIANT_BOOL *pfExists)
191 {
192     FIXME("%p %s %p\n", iface, debugstr_w(DriveSpec), pfExists);
193
194     return E_NOTIMPL;
195 }
196
197 static HRESULT WINAPI filesys_FileExists(IFileSystem3 *iface, BSTR FileSpec,
198                                             VARIANT_BOOL *pfExists)
199 {
200     FIXME("%p %s %p\n", iface, debugstr_w(FileSpec), pfExists);
201
202     return E_NOTIMPL;
203 }
204
205 static HRESULT WINAPI filesys_FolderExists(IFileSystem3 *iface, BSTR FolderSpec,
206                                             VARIANT_BOOL *pfExists)
207 {
208     FIXME("%p %s %p\n", iface, debugstr_w(FolderSpec), pfExists);
209
210     return E_NOTIMPL;
211 }
212
213 static HRESULT WINAPI filesys_GetDrive(IFileSystem3 *iface, BSTR DriveSpec,
214                                             IDrive **ppdrive)
215 {
216     FIXME("%p %s %p\n", iface, debugstr_w(DriveSpec), ppdrive);
217
218     return E_NOTIMPL;
219 }
220
221 static HRESULT WINAPI filesys_GetFile(IFileSystem3 *iface, BSTR FilePath,
222                                             IFile **ppfile)
223 {
224     FIXME("%p %s %p\n", iface, debugstr_w(FilePath), ppfile);
225
226     return E_NOTIMPL;
227 }
228
229 static HRESULT WINAPI filesys_GetFolder(IFileSystem3 *iface, BSTR FolderPath,
230                                             IFolder **ppfolder)
231 {
232     FIXME("%p %s %p\n", iface, debugstr_w(FolderPath), ppfolder);
233
234     return E_NOTIMPL;
235 }
236
237 static HRESULT WINAPI filesys_GetSpecialFolder(IFileSystem3 *iface,
238                                             SpecialFolderConst SpecialFolder,
239                                             IFolder **ppfolder)
240 {
241     FIXME("%p %d %p\n", iface, SpecialFolder, ppfolder);
242
243     return E_NOTIMPL;
244 }
245
246 static HRESULT WINAPI filesys_DeleteFile(IFileSystem3 *iface, BSTR FileSpec,
247                                             VARIANT_BOOL Force)
248 {
249     FIXME("%p %s %d\n", iface, debugstr_w(FileSpec), Force);
250
251     return E_NOTIMPL;
252 }
253
254 static HRESULT WINAPI filesys_DeleteFolder(IFileSystem3 *iface, BSTR FolderSpec,
255                                             VARIANT_BOOL Force)
256 {
257     FIXME("%p %s %d\n", iface, debugstr_w(FolderSpec), Force);
258
259     return E_NOTIMPL;
260 }
261
262 static HRESULT WINAPI filesys_MoveFile(IFileSystem3 *iface, BSTR Source,
263                                             BSTR Destination)
264 {
265     FIXME("%p %s %s\n", iface, debugstr_w(Source), debugstr_w(Destination));
266
267     return E_NOTIMPL;
268 }
269
270 static HRESULT WINAPI filesys_MoveFolder(IFileSystem3 *iface,BSTR Source,
271                                             BSTR Destination)
272 {
273     FIXME("%p %s %s\n", iface, debugstr_w(Source), debugstr_w(Destination));
274
275     return E_NOTIMPL;
276 }
277
278 static HRESULT WINAPI filesys_CopyFile(IFileSystem3 *iface, BSTR Source,
279                                             BSTR Destination, VARIANT_BOOL OverWriteFiles)
280 {
281     FIXME("%p %s %s %d\n", iface, debugstr_w(Source), debugstr_w(Destination), OverWriteFiles);
282
283     return E_NOTIMPL;
284 }
285
286 static HRESULT WINAPI filesys_CopyFolder(IFileSystem3 *iface, BSTR Source,
287                                             BSTR Destination, VARIANT_BOOL OverWriteFiles)
288 {
289     FIXME("%p %s %s %d\n", iface, debugstr_w(Source), debugstr_w(Destination), OverWriteFiles);
290
291     return E_NOTIMPL;
292 }
293
294 static HRESULT WINAPI filesys_CreateFolder(IFileSystem3 *iface, BSTR Path,
295                                             IFolder **ppfolder)
296 {
297     FIXME("%p %s %p\n", iface, debugstr_w(Path), ppfolder);
298
299     return E_NOTIMPL;
300 }
301
302 static HRESULT WINAPI filesys_CreateTextFile(IFileSystem3 *iface, BSTR FileName,
303                                             VARIANT_BOOL Overwrite, VARIANT_BOOL Unicode,
304                                             ITextStream **ppts)
305 {
306     FIXME("%p %s %d %d %p\n", iface, debugstr_w(FileName), Overwrite, Unicode, ppts);
307
308     return E_NOTIMPL;
309 }
310
311 static HRESULT WINAPI filesys_OpenTextFile(IFileSystem3 *iface, BSTR FileName,
312                                             IOMode IOMode, VARIANT_BOOL Create,
313                                             Tristate Format, ITextStream **ppts)
314 {
315     FIXME("%p %s %d %d %d %p\n", iface, debugstr_w(FileName), IOMode, Create, Format, ppts);
316
317     return E_NOTIMPL;
318 }
319
320 static HRESULT WINAPI filesys_GetStandardStream(IFileSystem3 *iface,
321                                             StandardStreamTypes StandardStreamType,
322                                             VARIANT_BOOL Unicode,
323                                             ITextStream **ppts)
324 {
325     FIXME("%p %d %d %p\n", iface, StandardStreamType, Unicode, ppts);
326
327     return E_NOTIMPL;
328 }
329
330 static HRESULT WINAPI filesys_GetFileVersion(IFileSystem3 *iface, BSTR FileName,
331                                             BSTR *FileVersion)
332 {
333     FIXME("%p %s %p\n", iface, debugstr_w(FileName), FileVersion);
334
335     return E_NOTIMPL;
336 }
337
338 static const struct IFileSystem3Vtbl filesys_vtbl =
339 {
340     filesys_QueryInterface,
341     filesys_AddRef,
342     filesys_Release,
343     filesys_GetTypeInfoCount,
344     filesys_GetTypeInfo,
345     filesys_GetIDsOfNames,
346     filesys_Invoke,
347     filesys_get_Drives,
348     filesys_BuildPath,
349     filesys_GetDriveName,
350     filesys_GetParentFolderName,
351     filesys_GetFileName,
352     filesys_GetBaseName,
353     filesys_GetExtensionName,
354     filesys_GetAbsolutePathName,
355     filesys_GetTempName,
356     filesys_DriveExists,
357     filesys_FileExists,
358     filesys_FolderExists,
359     filesys_GetDrive,
360     filesys_GetFile,
361     filesys_GetFolder,
362     filesys_GetSpecialFolder,
363     filesys_DeleteFile,
364     filesys_DeleteFolder,
365     filesys_MoveFile,
366     filesys_MoveFolder,
367     filesys_CopyFile,
368     filesys_CopyFolder,
369     filesys_CreateFolder,
370     filesys_CreateTextFile,
371     filesys_OpenTextFile,
372     filesys_GetStandardStream,
373     filesys_GetFileVersion
374 };
375
376 static IFileSystem3 filesystem = { &filesys_vtbl };
377
378 HRESULT WINAPI FileSystem_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv)
379 {
380     TRACE("(%p %s %p)\n", outer, debugstr_guid(riid), ppv);
381
382     return IFileSystem3_QueryInterface(&filesystem, riid, ppv);
383 }