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
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
) )
46 else if ( IsEqualGUID( riid
, &IID_IDispatchEx
))
48 TRACE("Interface IDispatchEx not supported - returning NULL\n");
52 else if ( IsEqualGUID( riid
, &IID_IObjectWithSite
))
54 TRACE("Interface IObjectWithSite not supported - returning NULL\n");
60 FIXME("Unsupported interface %s\n", debugstr_guid(riid
));
64 IFileSystem3_AddRef(iface
);
69 static ULONG WINAPI
filesys_AddRef(IFileSystem3
*iface
)
76 static ULONG WINAPI
filesys_Release(IFileSystem3
*iface
)
83 static HRESULT WINAPI
filesys_GetTypeInfoCount(IFileSystem3
*iface
, UINT
*pctinfo
)
85 TRACE("(%p)->(%p)\n", iface
, pctinfo
);
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
)
104 TRACE("(%p)->(%s %p %u %u %p)\n", iface
, debugstr_guid(riid
), rgszNames
, cNames
, lcid
, rgDispId
);
106 hr
= get_typeinfo(IFileSystem3_tid
, &typeinfo
);
109 hr
= ITypeInfo_GetIDsOfNames(typeinfo
, rgszNames
, cNames
, rgDispId
);
110 ITypeInfo_Release(typeinfo
);
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
)
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
);
130 hr
= ITypeInfo_Invoke(typeinfo
, &iface
, dispIdMember
, wFlags
,
131 pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
132 ITypeInfo_Release(typeinfo
);
138 static HRESULT WINAPI
filesys_get_Drives(IFileSystem3
*iface
, IDriveCollection
**ppdrives
)
140 FIXME("%p %p\n", iface
, ppdrives
);
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
);
153 static HRESULT WINAPI
filesys_GetDriveName(IFileSystem3
*iface
, BSTR Path
,
156 FIXME("%p %s %p\n", iface
, debugstr_w(Path
), pbstrResult
);
161 static HRESULT WINAPI
filesys_GetParentFolderName(IFileSystem3
*iface
, BSTR Path
,
164 FIXME("%p %s %p\n", iface
, debugstr_w(Path
), pbstrResult
);
169 static HRESULT WINAPI
filesys_GetFileName(IFileSystem3
*iface
, BSTR Path
,
172 FIXME("%p %s %p\n", iface
, debugstr_w(Path
), pbstrResult
);
177 static HRESULT WINAPI
filesys_GetBaseName(IFileSystem3
*iface
, BSTR Path
,
180 FIXME("%p %s %p\n", iface
, debugstr_w(Path
), pbstrResult
);
185 static HRESULT WINAPI
filesys_GetExtensionName(IFileSystem3
*iface
, BSTR Path
,
188 FIXME("%p %s %p\n", iface
, debugstr_w(Path
), pbstrResult
);
193 static HRESULT WINAPI
filesys_GetAbsolutePathName(IFileSystem3
*iface
, BSTR Path
,
196 FIXME("%p %s %p\n", iface
, debugstr_w(Path
), pbstrResult
);
201 static HRESULT WINAPI
filesys_GetTempName(IFileSystem3
*iface
, BSTR
*pbstrResult
)
203 FIXME("%p %p\n", iface
, pbstrResult
);
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
);
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
;
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
);
234 static HRESULT WINAPI
filesys_GetDrive(IFileSystem3
*iface
, BSTR DriveSpec
,
237 FIXME("%p %s %p\n", iface
, debugstr_w(DriveSpec
), ppdrive
);
242 static HRESULT WINAPI
filesys_GetFile(IFileSystem3
*iface
, BSTR FilePath
,
245 FIXME("%p %s %p\n", iface
, debugstr_w(FilePath
), ppfile
);
250 static HRESULT WINAPI
filesys_GetFolder(IFileSystem3
*iface
, BSTR FolderPath
,
253 FIXME("%p %s %p\n", iface
, debugstr_w(FolderPath
), ppfolder
);
258 static HRESULT WINAPI
filesys_GetSpecialFolder(IFileSystem3
*iface
,
259 SpecialFolderConst SpecialFolder
,
262 FIXME("%p %d %p\n", iface
, SpecialFolder
, ppfolder
);
267 static HRESULT WINAPI
filesys_DeleteFile(IFileSystem3
*iface
, BSTR FileSpec
,
270 FIXME("%p %s %d\n", iface
, debugstr_w(FileSpec
), Force
);
275 static HRESULT WINAPI
filesys_DeleteFolder(IFileSystem3
*iface
, BSTR FolderSpec
,
278 FIXME("%p %s %d\n", iface
, debugstr_w(FolderSpec
), Force
);
283 static HRESULT WINAPI
filesys_MoveFile(IFileSystem3
*iface
, BSTR Source
,
286 FIXME("%p %s %s\n", iface
, debugstr_w(Source
), debugstr_w(Destination
));
291 static HRESULT WINAPI
filesys_MoveFolder(IFileSystem3
*iface
,BSTR Source
,
294 FIXME("%p %s %s\n", iface
, debugstr_w(Source
), debugstr_w(Destination
));
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
);
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
);
315 static HRESULT WINAPI
filesys_CreateFolder(IFileSystem3
*iface
, BSTR Path
,
318 FIXME("%p %s %p\n", iface
, debugstr_w(Path
), ppfolder
);
323 static HRESULT WINAPI
filesys_CreateTextFile(IFileSystem3
*iface
, BSTR FileName
,
324 VARIANT_BOOL Overwrite
, VARIANT_BOOL Unicode
,
327 FIXME("%p %s %d %d %p\n", iface
, debugstr_w(FileName
), Overwrite
, Unicode
, ppts
);
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
);
341 static HRESULT WINAPI
filesys_GetStandardStream(IFileSystem3
*iface
,
342 StandardStreamTypes StandardStreamType
,
343 VARIANT_BOOL Unicode
,
346 FIXME("%p %d %d %p\n", iface
, StandardStreamType
, Unicode
, ppts
);
351 static HRESULT WINAPI
filesys_GetFileVersion(IFileSystem3
*iface
, BSTR FileName
,
354 FIXME("%p %s %p\n", iface
, debugstr_w(FileName
), FileVersion
);
359 static const struct IFileSystem3Vtbl filesys_vtbl
=
361 filesys_QueryInterface
,
364 filesys_GetTypeInfoCount
,
366 filesys_GetIDsOfNames
,
370 filesys_GetDriveName
,
371 filesys_GetParentFolderName
,
374 filesys_GetExtensionName
,
375 filesys_GetAbsolutePathName
,
379 filesys_FolderExists
,
383 filesys_GetSpecialFolder
,
385 filesys_DeleteFolder
,
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
);