ReactOS 0.4.17-dev-966-gf06eace
filesystem.c File Reference
#include <stdarg.h>
#include <limits.h>
#include <assert.h>
#include <wchar.h>
#include "windef.h"
#include "winbase.h"
#include "ole2.h"
#include "olectl.h"
#include "dispex.h"
#include "ntsecapi.h"
#include "scrrun.h"
#include "scrrun_private.h"
#include "wine/debug.h"
Include dependency graph for filesystem.c:

Go to the source code of this file.

Classes

struct  filesystem
 
struct  foldercollection
 
struct  filecollection
 
struct  drivecollection
 
struct  enumdata
 
struct  enumvariant
 
struct  drive
 
struct  folder
 
struct  file
 
struct  textstream
 

Macros

#define COBJMACROS
 

Enumerations

enum  iotype { IORead , IOWrite }
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (scrrun)
 
static struct filesystem * impl_from_IFileSystem3 (IFileSystem3 *iface)
 
static struct drive * impl_from_IDrive (IDrive *iface)
 
static struct folder * impl_from_IFolder (IFolder *iface)
 
static struct file * impl_from_IFile (IFile *iface)
 
static struct textstream * impl_from_ITextStream (ITextStream *iface)
 
static struct foldercollection * impl_from_IFolderCollection (IFolderCollection *iface)
 
static struct filecollection * impl_from_IFileCollection (IFileCollection *iface)
 
static struct drivecollection * impl_from_IDriveCollection (IDriveCollection *iface)
 
static struct enumvariant * impl_from_IEnumVARIANT (IEnumVARIANT *iface)
 
static HRESULT create_error (DWORD err)
 
static HRESULT create_folder (const WCHAR *, IFolder **)
 
static HRESULT create_file (BSTR, IFile **)
 
static HRESULT create_foldercoll_enum (struct foldercollection *, IUnknown **)
 
static HRESULT create_filecoll_enum (struct filecollection *, IUnknown **)
 
static HRESULT create_drivecoll_enum (struct drivecollection *, IUnknown **)
 
static BOOL is_dir_data (const WIN32_FIND_DATAW *data)
 
static BOOL is_file_data (const WIN32_FIND_DATAW *data)
 
static BSTR get_full_path (BSTR path, const WIN32_FIND_DATAW *data)
 
static HRESULT build_path (BSTR Path, BSTR Name, BSTR *Result)
 
static BOOL textstream_check_iomode (struct textstream *This, enum iotype type)
 
static HRESULT WINAPI textstream_QueryInterface (ITextStream *iface, REFIID riid, void **obj)
 
static ULONG WINAPI textstream_AddRef (ITextStream *iface)
 
static ULONG WINAPI textstream_Release (ITextStream *iface)
 
static HRESULT WINAPI textstream_GetTypeInfoCount (ITextStream *iface, UINT *pctinfo)
 
static HRESULT WINAPI textstream_GetTypeInfo (ITextStream *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
 
static HRESULT WINAPI textstream_GetIDsOfNames (ITextStream *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
 
static HRESULT WINAPI textstream_Invoke (ITextStream *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
static HRESULT WINAPI textstream_get_Line (ITextStream *iface, LONG *line)
 
static HRESULT WINAPI textstream_get_Column (ITextStream *iface, LONG *column)
 
static HRESULT WINAPI textstream_get_AtEndOfStream (ITextStream *iface, VARIANT_BOOL *eos)
 
static HRESULT WINAPI textstream_get_AtEndOfLine (ITextStream *iface, VARIANT_BOOL *eol)
 
static HRESULT append_read_data (struct textstream *stream, const char *buf, size_t buf_size)
 
static HRESULT read_more_data (struct textstream *stream)
 
static BOOL read_from_buffer (struct textstream *stream, size_t len, BSTR *ret, size_t skip)
 
static HRESULT WINAPI textstream_Read (ITextStream *iface, LONG len, BSTR *text)
 
static HRESULT WINAPI textstream_ReadLine (ITextStream *iface, BSTR *text)
 
static HRESULT WINAPI textstream_ReadAll (ITextStream *iface, BSTR *text)
 
static HRESULT textstream_write (struct textstream *stream, BSTR text)
 
static HRESULT WINAPI textstream_Write (ITextStream *iface, BSTR text)
 
static HRESULT textstream_writecrlf (struct textstream *stream)
 
static HRESULT WINAPI textstream_WriteLine (ITextStream *iface, BSTR text)
 
static HRESULT WINAPI textstream_WriteBlankLines (ITextStream *iface, LONG lines)
 
static HRESULT WINAPI textstream_Skip (ITextStream *iface, LONG count)
 
static HRESULT WINAPI textstream_SkipLine (ITextStream *iface)
 
static HRESULT WINAPI textstream_Close (ITextStream *iface)
 
static HRESULT WINAPI pipestream_get_Line (ITextStream *iface, LONG *line)
 
static HRESULT WINAPI pipestream_get_Column (ITextStream *iface, LONG *column)
 
static HRESULT WINAPI pipestream_get_AtEndOfStream (ITextStream *iface, VARIANT_BOOL *eos)
 
static HRESULT WINAPI pipestream_get_AtEndOfLine (ITextStream *iface, VARIANT_BOOL *eol)
 
static HRESULT WINAPI pipestream_Read (ITextStream *iface, LONG len, BSTR *text)
 
static HRESULT WINAPI pipestream_ReadLine (ITextStream *iface, BSTR *text)
 
static HRESULT WINAPI pipestream_ReadAll (ITextStream *iface, BSTR *text)
 
static HRESULT WINAPI pipestream_Write (ITextStream *iface, BSTR text)
 
static HRESULT WINAPI pipestream_WriteLine (ITextStream *iface, BSTR text)
 
static HRESULT WINAPI pipestream_WriteBlankLines (ITextStream *iface, LONG lines)
 
static HRESULT WINAPI pipestream_Skip (ITextStream *iface, LONG count)
 
static HRESULT WINAPI pipestream_SkipLine (ITextStream *iface)
 
static HRESULT create_textstream (const WCHAR *filename, DWORD disposition, IOMode mode, Tristate format, ITextStream **ret)
 
HRESULT WINAPI DoOpenPipeStream (HANDLE pipe, IOMode mode, ITextStream **ret)
 
static HRESULT WINAPI drive_QueryInterface (IDrive *iface, REFIID riid, void **obj)
 
static ULONG WINAPI drive_AddRef (IDrive *iface)
 
static ULONG WINAPI drive_Release (IDrive *iface)
 
static HRESULT WINAPI drive_GetTypeInfoCount (IDrive *iface, UINT *pctinfo)
 
static HRESULT WINAPI drive_GetTypeInfo (IDrive *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
 
static HRESULT WINAPI drive_GetIDsOfNames (IDrive *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
 
static HRESULT WINAPI drive_Invoke (IDrive *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
static HRESULT WINAPI drive_get_Path (IDrive *iface, BSTR *path)
 
static HRESULT WINAPI drive_get_DriveLetter (IDrive *iface, BSTR *letter)
 
static HRESULT WINAPI drive_get_ShareName (IDrive *iface, BSTR *share_name)
 
static HRESULT WINAPI drive_get_DriveType (IDrive *iface, DriveTypeConst *type)
 
static HRESULT WINAPI drive_get_RootFolder (IDrive *iface, IFolder **folder)
 
static HRESULT variant_from_largeint (const ULARGE_INTEGER *src, VARIANT *v)
 
static HRESULT WINAPI drive_get_AvailableSpace (IDrive *iface, VARIANT *v)
 
static HRESULT WINAPI drive_get_FreeSpace (IDrive *iface, VARIANT *v)
 
static HRESULT WINAPI drive_get_TotalSize (IDrive *iface, VARIANT *v)
 
static HRESULT WINAPI drive_get_VolumeName (IDrive *iface, BSTR *name)
 
static HRESULT WINAPI drive_put_VolumeName (IDrive *iface, BSTR name)
 
static HRESULT WINAPI drive_get_FileSystem (IDrive *iface, BSTR *fs)
 
static HRESULT WINAPI drive_get_SerialNumber (IDrive *iface, LONG *serial)
 
static HRESULT WINAPI drive_get_IsReady (IDrive *iface, VARIANT_BOOL *ready)
 
static HRESULT create_drive (WCHAR letter, IDrive **drive)
 
static HRESULT WINAPI enumvariant_QueryInterface (IEnumVARIANT *iface, REFIID riid, void **obj)
 
static ULONG WINAPI enumvariant_AddRef (IEnumVARIANT *iface)
 
static ULONG WINAPI foldercoll_enumvariant_Release (IEnumVARIANT *iface)
 
static HANDLE start_enumeration (const WCHAR *path, WIN32_FIND_DATAW *data, BOOL file)
 
static HRESULT WINAPI foldercoll_enumvariant_Next (IEnumVARIANT *iface, ULONG celt, VARIANT *var, ULONG *fetched)
 
static HRESULT WINAPI foldercoll_enumvariant_Skip (IEnumVARIANT *iface, ULONG celt)
 
static HRESULT WINAPI foldercoll_enumvariant_Reset (IEnumVARIANT *iface)
 
static HRESULT WINAPI foldercoll_enumvariant_Clone (IEnumVARIANT *iface, IEnumVARIANT **pclone)
 
static ULONG WINAPI filecoll_enumvariant_Release (IEnumVARIANT *iface)
 
static HRESULT WINAPI filecoll_enumvariant_Next (IEnumVARIANT *iface, ULONG celt, VARIANT *var, ULONG *fetched)
 
static HRESULT WINAPI filecoll_enumvariant_Skip (IEnumVARIANT *iface, ULONG celt)
 
static HRESULT WINAPI filecoll_enumvariant_Reset (IEnumVARIANT *iface)
 
static HRESULT WINAPI filecoll_enumvariant_Clone (IEnumVARIANT *iface, IEnumVARIANT **pclone)
 
static ULONG WINAPI drivecoll_enumvariant_Release (IEnumVARIANT *iface)
 
static HRESULT find_next_drive (struct enumvariant *penum)
 
static HRESULT WINAPI drivecoll_enumvariant_Next (IEnumVARIANT *iface, ULONG celt, VARIANT *var, ULONG *fetched)
 
static HRESULT WINAPI drivecoll_enumvariant_Skip (IEnumVARIANT *iface, ULONG celt)
 
static HRESULT WINAPI drivecoll_enumvariant_Reset (IEnumVARIANT *iface)
 
static HRESULT WINAPI drivecoll_enumvariant_Clone (IEnumVARIANT *iface, IEnumVARIANT **pclone)
 
static HRESULT WINAPI foldercoll_QueryInterface (IFolderCollection *iface, REFIID riid, void **obj)
 
static ULONG WINAPI foldercoll_AddRef (IFolderCollection *iface)
 
static ULONG WINAPI foldercoll_Release (IFolderCollection *iface)
 
static HRESULT WINAPI foldercoll_GetTypeInfoCount (IFolderCollection *iface, UINT *pctinfo)
 
static HRESULT WINAPI foldercoll_GetTypeInfo (IFolderCollection *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
 
static HRESULT WINAPI foldercoll_GetIDsOfNames (IFolderCollection *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
 
static HRESULT WINAPI foldercoll_Invoke (IFolderCollection *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
static HRESULT WINAPI foldercoll_Add (IFolderCollection *iface, BSTR name, IFolder **folder)
 
static HRESULT WINAPI foldercoll_get_Item (IFolderCollection *iface, VARIANT key, IFolder **folder)
 
static HRESULT WINAPI foldercoll_get__NewEnum (IFolderCollection *iface, IUnknown **newenum)
 
static HRESULT WINAPI foldercoll_get_Count (IFolderCollection *iface, LONG *count)
 
static HRESULT create_foldercoll (BSTR path, IFolderCollection **folders)
 
static HRESULT WINAPI filecoll_QueryInterface (IFileCollection *iface, REFIID riid, void **obj)
 
static ULONG WINAPI filecoll_AddRef (IFileCollection *iface)
 
static ULONG WINAPI filecoll_Release (IFileCollection *iface)
 
static HRESULT WINAPI filecoll_GetTypeInfoCount (IFileCollection *iface, UINT *pctinfo)
 
static HRESULT WINAPI filecoll_GetTypeInfo (IFileCollection *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
 
static HRESULT WINAPI filecoll_GetIDsOfNames (IFileCollection *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
 
static HRESULT WINAPI filecoll_Invoke (IFileCollection *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
static HRESULT WINAPI filecoll_get_Item (IFileCollection *iface, VARIANT Key, IFile **file)
 
static HRESULT WINAPI filecoll_get__NewEnum (IFileCollection *iface, IUnknown **ppenum)
 
static HRESULT WINAPI filecoll_get_Count (IFileCollection *iface, LONG *count)
 
static HRESULT create_filecoll (BSTR path, IFileCollection **files)
 
static HRESULT WINAPI drivecoll_QueryInterface (IDriveCollection *iface, REFIID riid, void **obj)
 
static ULONG WINAPI drivecoll_AddRef (IDriveCollection *iface)
 
static ULONG WINAPI drivecoll_Release (IDriveCollection *iface)
 
static HRESULT WINAPI drivecoll_GetTypeInfoCount (IDriveCollection *iface, UINT *pctinfo)
 
static HRESULT WINAPI drivecoll_GetTypeInfo (IDriveCollection *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
 
static HRESULT WINAPI drivecoll_GetIDsOfNames (IDriveCollection *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
 
static HRESULT WINAPI drivecoll_Invoke (IDriveCollection *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
static HRESULT WINAPI drivecoll_get_Item (IDriveCollection *iface, VARIANT key, IDrive **drive)
 
static HRESULT WINAPI drivecoll_get__NewEnum (IDriveCollection *iface, IUnknown **ppenum)
 
static HRESULT WINAPI drivecoll_get_Count (IDriveCollection *iface, LONG *count)
 
static HRESULT create_drivecoll (IDriveCollection **drives)
 
static HRESULT WINAPI folder_QueryInterface (IFolder *iface, REFIID riid, void **obj)
 
static ULONG WINAPI folder_AddRef (IFolder *iface)
 
static ULONG WINAPI folder_Release (IFolder *iface)
 
static HRESULT WINAPI folder_GetTypeInfoCount (IFolder *iface, UINT *pctinfo)
 
static HRESULT WINAPI folder_GetTypeInfo (IFolder *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
 
static HRESULT WINAPI folder_GetIDsOfNames (IFolder *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
 
static HRESULT WINAPI folder_Invoke (IFolder *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
static HRESULT WINAPI folder_get_Path (IFolder *iface, BSTR *path)
 
static HRESULT WINAPI folder_get_Name (IFolder *iface, BSTR *name)
 
static HRESULT WINAPI folder_put_Name (IFolder *iface, BSTR name)
 
static HRESULT WINAPI folder_get_ShortPath (IFolder *iface, BSTR *path)
 
static HRESULT WINAPI folder_get_ShortName (IFolder *iface, BSTR *name)
 
static HRESULT WINAPI folder_get_Drive (IFolder *iface, IDrive **drive)
 
static HRESULT WINAPI folder_get_ParentFolder (IFolder *iface, IFolder **parent)
 
static HRESULT WINAPI folder_get_Attributes (IFolder *iface, FileAttribute *attr)
 
static HRESULT WINAPI folder_put_Attributes (IFolder *iface, FileAttribute attr)
 
static HRESULT WINAPI folder_get_DateCreated (IFolder *iface, DATE *date)
 
static HRESULT WINAPI folder_get_DateLastModified (IFolder *iface, DATE *date)
 
static HRESULT WINAPI folder_get_DateLastAccessed (IFolder *iface, DATE *date)
 
static HRESULT WINAPI folder_get_Type (IFolder *iface, BSTR *type)
 
static HRESULT WINAPI folder_Delete (IFolder *iface, VARIANT_BOOL force)
 
static HRESULT WINAPI folder_Copy (IFolder *iface, BSTR dest, VARIANT_BOOL overwrite)
 
static HRESULT WINAPI folder_Move (IFolder *iface, BSTR dest)
 
static HRESULT WINAPI folder_get_IsRootFolder (IFolder *iface, VARIANT_BOOL *isroot)
 
static HRESULT WINAPI folder_get_Size (IFolder *iface, VARIANT *size)
 
static HRESULT WINAPI folder_get_SubFolders (IFolder *iface, IFolderCollection **folders)
 
static HRESULT WINAPI folder_get_Files (IFolder *iface, IFileCollection **files)
 
static HRESULT WINAPI folder_CreateTextFile (IFolder *iface, BSTR filename, VARIANT_BOOL overwrite, VARIANT_BOOL unicode, ITextStream **stream)
 
static HRESULT WINAPI file_QueryInterface (IFile *iface, REFIID riid, void **obj)
 
static ULONG WINAPI file_AddRef (IFile *iface)
 
static ULONG WINAPI file_Release (IFile *iface)
 
static HRESULT WINAPI file_GetTypeInfoCount (IFile *iface, UINT *pctinfo)
 
static HRESULT WINAPI file_GetTypeInfo (IFile *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
 
static HRESULT WINAPI file_GetIDsOfNames (IFile *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
 
static HRESULT WINAPI file_Invoke (IFile *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
static HRESULT WINAPI file_get_Path (IFile *iface, BSTR *path)
 
static HRESULT WINAPI file_get_Name (IFile *iface, BSTR *name)
 
static HRESULT WINAPI file_put_Name (IFile *iface, BSTR pbstrName)
 
static HRESULT WINAPI file_get_ShortPath (IFile *iface, BSTR *pbstrPath)
 
static HRESULT WINAPI file_get_ShortName (IFile *iface, BSTR *pbstrName)
 
static HRESULT WINAPI file_get_Drive (IFile *iface, IDrive **ppdrive)
 
static HRESULT WINAPI file_get_ParentFolder (IFile *iface, IFolder **ppfolder)
 
static HRESULT WINAPI file_get_Attributes (IFile *iface, FileAttribute *pfa)
 
static HRESULT WINAPI file_put_Attributes (IFile *iface, FileAttribute pfa)
 
static HRESULT get_date_from_filetime (const FILETIME *ft, DATE *date)
 
static HRESULT WINAPI file_get_DateCreated (IFile *iface, DATE *date)
 
static HRESULT WINAPI file_get_DateLastModified (IFile *iface, DATE *date)
 
static HRESULT WINAPI file_get_DateLastAccessed (IFile *iface, DATE *pdate)
 
static HRESULT WINAPI file_get_Size (IFile *iface, VARIANT *pvarSize)
 
static HRESULT WINAPI file_get_Type (IFile *iface, BSTR *pbstrType)
 
static HRESULT WINAPI file_Delete (IFile *iface, VARIANT_BOOL Force)
 
static HRESULT WINAPI file_Copy (IFile *iface, BSTR Destination, VARIANT_BOOL OverWriteFiles)
 
static HRESULT WINAPI file_Move (IFile *iface, BSTR Destination)
 
static HRESULT WINAPI file_OpenAsTextStream (IFile *iface, IOMode mode, Tristate format, ITextStream **stream)
 
static HRESULT WINAPI filesys_QueryInterface (IFileSystem3 *iface, REFIID riid, void **ppvObject)
 
static ULONG WINAPI filesys_AddRef (IFileSystem3 *iface)
 
static ULONG WINAPI filesys_Release (IFileSystem3 *iface)
 
static HRESULT WINAPI filesys_GetTypeInfoCount (IFileSystem3 *iface, UINT *pctinfo)
 
static HRESULT WINAPI filesys_GetTypeInfo (IFileSystem3 *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
 
static HRESULT WINAPI filesys_GetIDsOfNames (IFileSystem3 *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
 
static HRESULT WINAPI filesys_Invoke (IFileSystem3 *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
static HRESULT WINAPI filesys_get_Drives (IFileSystem3 *iface, IDriveCollection **ppdrives)
 
static HRESULT WINAPI filesys_BuildPath (IFileSystem3 *iface, BSTR Path, BSTR Name, BSTR *Result)
 
static HRESULT WINAPI filesys_GetDriveName (IFileSystem3 *iface, BSTR path, BSTR *drive)
 
static DWORD get_parent_folder_name (const WCHAR *path, DWORD len)
 
static HRESULT WINAPI filesys_GetParentFolderName (IFileSystem3 *iface, BSTR Path, BSTR *pbstrResult)
 
static HRESULT WINAPI filesys_GetFileName (IFileSystem3 *iface, BSTR Path, BSTR *pbstrResult)
 
static HRESULT WINAPI filesys_GetBaseName (IFileSystem3 *iface, BSTR Path, BSTR *pbstrResult)
 
static HRESULT WINAPI filesys_GetExtensionName (IFileSystem3 *iface, BSTR path, BSTR *ext)
 
static HRESULT WINAPI filesys_GetAbsolutePathName (IFileSystem3 *iface, BSTR path, BSTR *pbstrResult)
 
static HRESULT WINAPI filesys_GetTempName (IFileSystem3 *iface, BSTR *result)
 
static HRESULT WINAPI filesys_DriveExists (IFileSystem3 *iface, BSTR DriveSpec, VARIANT_BOOL *pfExists)
 
static HRESULT WINAPI filesys_FileExists (IFileSystem3 *iface, BSTR path, VARIANT_BOOL *ret)
 
static HRESULT WINAPI filesys_FolderExists (IFileSystem3 *iface, BSTR path, VARIANT_BOOL *ret)
 
static HRESULT WINAPI filesys_GetDrive (IFileSystem3 *iface, BSTR DriveSpec, IDrive **ppdrive)
 
static HRESULT WINAPI filesys_GetFile (IFileSystem3 *iface, BSTR FilePath, IFile **ppfile)
 
static HRESULT WINAPI filesys_GetFolder (IFileSystem3 *iface, BSTR FolderPath, IFolder **folder)
 
static HRESULT WINAPI filesys_GetSpecialFolder (IFileSystem3 *iface, SpecialFolderConst SpecialFolder, IFolder **folder)
 
static HRESULT delete_file (const WCHAR *file, DWORD file_len, VARIANT_BOOL force)
 
static HRESULT WINAPI filesys_DeleteFile (IFileSystem3 *iface, BSTR FileSpec, VARIANT_BOOL Force)
 
static HRESULT delete_folder (const WCHAR *folder, DWORD folder_len, VARIANT_BOOL force)
 
static HRESULT WINAPI filesys_DeleteFolder (IFileSystem3 *iface, BSTR FolderSpec, VARIANT_BOOL Force)
 
static HRESULT WINAPI filesys_MoveFile (IFileSystem3 *iface, BSTR source, BSTR destination)
 
static HRESULT WINAPI filesys_MoveFolder (IFileSystem3 *iface, BSTR Source, BSTR Destination)
 
static HRESULT copy_file (const WCHAR *source, DWORD source_len, const WCHAR *destination, DWORD destination_len, VARIANT_BOOL overwrite)
 
static HRESULT WINAPI filesys_CopyFile (IFileSystem3 *iface, BSTR Source, BSTR Destination, VARIANT_BOOL OverWriteFiles)
 
static HRESULT copy_folder (const WCHAR *source, DWORD source_len, const WCHAR *destination, DWORD destination_len, VARIANT_BOOL overwrite)
 
static HRESULT WINAPI filesys_CopyFolder (IFileSystem3 *iface, BSTR Source, BSTR Destination, VARIANT_BOOL OverWriteFiles)
 
static HRESULT WINAPI filesys_CreateFolder (IFileSystem3 *iface, BSTR path, IFolder **folder)
 
static HRESULT WINAPI filesys_CreateTextFile (IFileSystem3 *iface, BSTR filename, VARIANT_BOOL overwrite, VARIANT_BOOL unicode, ITextStream **stream)
 
static HRESULT WINAPI filesys_OpenTextFile (IFileSystem3 *iface, BSTR filename, IOMode mode, VARIANT_BOOL create, Tristate format, ITextStream **stream)
 
static HRESULT WINAPI filesys_GetStandardStream (IFileSystem3 *iface, StandardStreamTypes StandardStreamType, VARIANT_BOOL Unicode, ITextStream **ppts)
 
static void get_versionstring (VS_FIXEDFILEINFO *info, WCHAR *ver)
 
static HRESULT WINAPI filesys_GetFileVersion (IFileSystem3 *iface, BSTR name, BSTR *version)
 
HRESULT WINAPI FileSystem_CreateInstance (IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv)
 

Variables

static const ITextStreamVtbl textstreamvtbl
 
static const ITextStreamVtbl pipestreamvtbl
 
static const IDriveVtbl drivevtbl
 
static const IEnumVARIANTVtbl foldercollenumvariantvtbl
 
static const IEnumVARIANTVtbl filecollenumvariantvtbl
 
static const IEnumVARIANTVtbl drivecollenumvariantvtbl
 
static const IFolderCollectionVtbl foldercollvtbl
 
static const IFileCollectionVtbl filecollectionvtbl
 
static const IDriveCollectionVtbl drivecollectionvtbl
 
static const IFolderVtbl foldervtbl
 
static const IFileVtbl file_vtbl
 
static const struct IFileSystem3Vtbl filesys_vtbl
 
static struct filesystem filesystem
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 19 of file filesystem.c.

Enumeration Type Documentation

◆ iotype

Enumerator
IORead 
IOWrite 

Definition at line 134 of file filesystem.c.

134 {
135 IORead,
136 IOWrite
137};
@ IOWrite
Definition: filesystem.c:136
@ IORead
Definition: filesystem.c:135

Function Documentation

◆ append_read_data()

static HRESULT append_read_data ( struct textstream *  stream,
const char *  buf,
size_t  buf_size 
)
static

Definition at line 435 of file filesystem.c.

436{
437 LARGE_INTEGER revert;
438 size_t len;
439 WCHAR *new_buf;
440
441 revert.QuadPart = 0;
442 if (stream->unicode)
443 {
444 len = buf_size / sizeof(WCHAR);
445 if (buf_size & 1) revert.QuadPart = -1;
446 }
447 else
448 {
449 for (len = 0; len < buf_size; len++)
450 {
451 if (!IsDBCSLeadByte(buf[len])) continue;
452 if (len + 1 == buf_size)
453 {
454 revert.QuadPart = -1;
455 buf_size--;
456 break;
457 }
458 len++;
459 }
460 len = MultiByteToWideChar(CP_ACP, 0, buf, buf_size, NULL, 0);
461 }
462 if (!len)
463 return S_OK;
464 if (revert.QuadPart)
465 SetFilePointerEx(stream->file, revert, NULL, FILE_CURRENT);
466
467 if (!stream->read_buf_size)
468 new_buf = malloc(len * sizeof(WCHAR));
469 else
470 new_buf = realloc(stream->read_buf, (len + stream->read_buf_size) * sizeof(WCHAR));
471 if (!new_buf) return E_OUTOFMEMORY;
472
473 if (stream->unicode)
474 memcpy(new_buf + stream->read_buf_size, buf, len * sizeof(WCHAR));
475 else
476 MultiByteToWideChar(CP_ACP, 0, buf, buf_size, new_buf + stream->read_buf_size, len);
477 stream->read_buf = new_buf;
478 stream->read_buf_size += len;
479 return S_OK;
480}
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define realloc
Definition: debug_ros.c:6
#define malloc
Definition: debug_ros.c:4
#define NULL
Definition: types.h:112
#define CP_ACP
Definition: compat.h:109
#define MultiByteToWideChar
Definition: compat.h:110
BOOL WINAPI SetFilePointerEx(HANDLE hFile, LARGE_INTEGER liDistanceToMove, PLARGE_INTEGER lpNewFilePointer, DWORD dwMoveMethod)
Definition: fileinfo.c:177
BOOL WINAPI IsDBCSLeadByte(BYTE testchar)
Definition: locale.c:2126
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLenum GLsizei len
Definition: glext.h:6722
#define S_OK
Definition: intsafe.h:52
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
short WCHAR
Definition: pedump.c:58
Definition: parse.h:23
LONGLONG QuadPart
Definition: typedefs.h:114
#define FILE_CURRENT
Definition: winbase.h:116

Referenced by create_textstream(), and read_more_data().

◆ build_path()

static HRESULT build_path ( BSTR  Path,
BSTR  Name,
BSTR *  Result 
)
static

Definition at line 228 of file filesystem.c.

229{
230 BSTR ret;
231
232 if (Path && Name)
233 {
234 int path_len = SysStringLen(Path), name_len = SysStringLen(Name);
235
236 /* if both parts have backslashes strip one from Path */
237 if (Path[path_len-1] == '\\' && Name[0] == '\\')
238 {
239 path_len -= 1;
240
241 ret = SysAllocStringLen(NULL, path_len + name_len);
242 if (ret)
243 {
244 lstrcpyW(ret, Path);
245 ret[path_len] = 0;
246 lstrcatW(ret, Name);
247 }
248 }
249 else if (Path[path_len-1] != '\\' && Name[0] != '\\')
250 {
251 ret = SysAllocStringLen(NULL, path_len + name_len + 1);
252 if (ret)
253 {
254 lstrcpyW(ret, Path);
255 if (Path[path_len-1] != ':')
256 wcscat(ret, L"\\");
257 lstrcatW(ret, Name);
258 }
259 }
260 else
261 {
262 ret = SysAllocStringLen(NULL, path_len + name_len);
263 if (ret)
264 {
265 lstrcpyW(ret, Path);
266 lstrcatW(ret, Name);
267 }
268 }
269 }
270 else if (Path || Name)
272 else
274
275 if (!ret) return E_OUTOFMEMORY;
276 *Result = ret;
277
278 return S_OK;
279}
PRTL_UNICODE_STRING_BUFFER Path
LPWSTR Name
Definition: desk.c:124
OLECHAR * BSTR
Definition: compat.h:2293
#define lstrcpyW
Definition: compat.h:749
return ret
Definition: mutex.c:147
#define L(x)
Definition: resources.c:13
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
static DWORD path_len
Definition: batch.c:31
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:240
UINT WINAPI SysStringLen(BSTR str)
Definition: oleaut.c:198
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
Definition: oleaut.c:341
wcscat
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:409

Referenced by filesys_BuildPath(), and folder_CreateTextFile().

◆ copy_file()

static HRESULT copy_file ( const WCHAR *  source,
DWORD  source_len,
const WCHAR *  destination,
DWORD  destination_len,
VARIANT_BOOL  overwrite 
)
inlinestatic

Definition at line 3817 of file filesystem.c.

3819{
3820 DWORD attrs;
3821 WCHAR src_path[MAX_PATH], dst_path[MAX_PATH];
3822 DWORD src_len, dst_len, name_len;
3823 WIN32_FIND_DATAW ffd;
3824 HANDLE f;
3825 HRESULT hr;
3826
3827 if(!source[0] || !destination[0])
3828 return E_INVALIDARG;
3829
3830 attrs = GetFileAttributesW(destination);
3831 if(attrs==INVALID_FILE_ATTRIBUTES || !(attrs & FILE_ATTRIBUTE_DIRECTORY)) {
3832 attrs = GetFileAttributesW(source);
3833 if(attrs == INVALID_FILE_ATTRIBUTES)
3834 return create_error(GetLastError());
3835 else if(attrs & FILE_ATTRIBUTE_DIRECTORY)
3836 return CTL_E_FILENOTFOUND;
3837
3838 if(!CopyFileW(source, destination, !overwrite))
3839 return create_error(GetLastError());
3840 return S_OK;
3841 }
3842
3843 f = FindFirstFileW(source, &ffd);
3844 if(f == INVALID_HANDLE_VALUE)
3845 return CTL_E_FILENOTFOUND;
3846
3847 src_len = get_parent_folder_name(source, source_len);
3848 if(src_len+1 >= MAX_PATH) {
3849 FindClose(f);
3850 return E_FAIL;
3851 }
3852 if(src_len) {
3853 memcpy(src_path, source, src_len*sizeof(WCHAR));
3854 src_path[src_len++] = '\\';
3855 }
3856
3857 dst_len = destination_len;
3858 if(dst_len+1 >= MAX_PATH) {
3859 FindClose(f);
3860 return E_FAIL;
3861 }
3862 memcpy(dst_path, destination, dst_len*sizeof(WCHAR));
3863 if(dst_path[dst_len-1]!= '\\' && dst_path[dst_len-1]!='/')
3864 dst_path[dst_len++] = '\\';
3865
3867 do {
3869 continue;
3870
3871 name_len = lstrlenW(ffd.cFileName);
3872 if(src_len+name_len+1>=MAX_PATH || dst_len+name_len+1>=MAX_PATH) {
3873 FindClose(f);
3874 return E_FAIL;
3875 }
3876 memcpy(src_path+src_len, ffd.cFileName, (name_len+1)*sizeof(WCHAR));
3877 memcpy(dst_path+dst_len, ffd.cFileName, (name_len+1)*sizeof(WCHAR));
3878
3879 TRACE("copying %s to %s\n", debugstr_w(src_path), debugstr_w(dst_path));
3880
3881 if(!CopyFileW(src_path, dst_path, !overwrite)) {
3882 FindClose(f);
3883 return create_error(GetLastError());
3884 }else {
3885 hr = S_OK;
3886 }
3887 } while(FindNextFileW(f, &ffd));
3888 FindClose(f);
3889
3890 return hr;
3891}
#define E_INVALIDARG
Definition: ddrawi.h:101
#define E_FAIL
Definition: ddrawi.h:102
HRESULT hr
Definition: delayimp.cpp:582
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define MAX_PATH
Definition: compat.h:34
#define lstrlenW
Definition: compat.h:750
BOOL WINAPI CopyFileW(IN LPCWSTR lpExistingFileName, IN LPCWSTR lpNewFileName, IN BOOL bFailIfExists)
Definition: copy.c:367
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:636
HANDLE WINAPI FindFirstFileW(IN LPCWSTR lpFileName, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:320
BOOL WINAPI FindClose(HANDLE hFindFile)
Definition: find.c:502
BOOL WINAPI FindNextFileW(IN HANDLE hFindFile, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:382
static DWORD get_parent_folder_name(const WCHAR *path, DWORD len)
Definition: filesystem.c:3293
static HRESULT create_error(DWORD err)
Definition: filesystem.c:184
unsigned long DWORD
Definition: ntddk_ex.h:95
GLfloat f
Definition: glext.h:7540
#define f
Definition: ke_i.h:83
#define debugstr_w
Definition: kernel32.h:32
#define FILE_ATTRIBUTE_DEVICE
Definition: disk.h:27
#define FILE_ATTRIBUTE_DIRECTORY
Definition: nt_native.h:705
#define CTL_E_FILENOTFOUND
Definition: olectl.h:274
#define TRACE(s)
Definition: solgame.cpp:4
_Field_z_ WCHAR cFileName[MAX_PATH]
Definition: minwinbase.h:291
DWORD dwFileAttributes
Definition: minwinbase.h:283
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
DWORD WINAPI GetLastError(void)
Definition: except.c:1042

Referenced by copy_folder(), and filesys_CopyFile().

◆ copy_folder()

static HRESULT copy_folder ( const WCHAR *  source,
DWORD  source_len,
const WCHAR *  destination,
DWORD  destination_len,
VARIANT_BOOL  overwrite 
)
static

Definition at line 3905 of file filesystem.c.

3907{
3908 DWORD tmp, src_len, dst_len, name_len;
3910 WIN32_FIND_DATAW ffd;
3911 HANDLE f;
3912 HRESULT hr;
3913 BOOL copied = FALSE;
3914
3915 if(!source[0] || !destination[0])
3916 return E_INVALIDARG;
3917
3918 dst_len = destination_len;
3919 if(dst_len+1 >= MAX_PATH)
3920 return E_FAIL;
3921 memcpy(dst, destination, (dst_len+1)*sizeof(WCHAR));
3922
3923 if(dst[dst_len-1]!='\\' && dst[dst_len-1]!='/' &&
3926 if(!CreateDirectoryW(dst, NULL)) {
3927 if(overwrite && GetLastError()==ERROR_ALREADY_EXISTS) {
3928 tmp = GetFileAttributesW(dst);
3931 }else {
3932 return create_error(GetLastError());
3933 }
3934 }
3935 copied = TRUE;
3936
3937 src_len = source_len;
3938 if(src_len+2 >= MAX_PATH)
3939 return E_FAIL;
3940 memcpy(src, source, src_len*sizeof(WCHAR));
3941 src[src_len++] = '\\';
3942 src[src_len] = '*';
3943 src[src_len+1] = 0;
3944
3945 hr = copy_file(src, src_len+1, dst, dst_len, overwrite);
3947 return create_error(GetLastError());
3948
3949 f = FindFirstFileW(src, &ffd);
3950 }else {
3951 src_len = get_parent_folder_name(source, source_len);
3952 if(src_len+2 >= MAX_PATH)
3953 return E_FAIL;
3954 memcpy(src, source, src_len*sizeof(WCHAR));
3955 if(src_len)
3956 src[src_len++] = '\\';
3957
3958 f = FindFirstFileW(source, &ffd);
3959 }
3960 if(f == INVALID_HANDLE_VALUE)
3961 return CTL_E_PATHNOTFOUND;
3962
3963 dst[dst_len++] = '\\';
3964 dst[dst_len] = 0;
3965
3966 do {
3968 continue;
3969 if(ffd.cFileName[0]=='.' && (ffd.cFileName[1]==0 ||
3970 (ffd.cFileName[1]=='.' && ffd.cFileName[2]==0)))
3971 continue;
3972
3973 name_len = lstrlenW(ffd.cFileName);
3974 if(dst_len+name_len>=MAX_PATH || src_len+name_len+2>=MAX_PATH) {
3975 FindClose(f);
3976 return E_FAIL;
3977 }
3978 memcpy(dst+dst_len, ffd.cFileName, name_len*sizeof(WCHAR));
3979 dst[dst_len+name_len] = 0;
3980 memcpy(src+src_len, ffd.cFileName, name_len*sizeof(WCHAR));
3981 src[src_len+name_len] = '\\';
3982 src[src_len+name_len+1] = '*';
3983 src[src_len+name_len+2] = 0;
3984
3985 TRACE("copying %s to %s\n", debugstr_w(src), debugstr_w(dst));
3986
3987 if(!CreateDirectoryW(dst, NULL)) {
3988 if(overwrite && GetLastError()==ERROR_ALREADY_EXISTS) {
3989 tmp = GetFileAttributesW(dst);
3991 FindClose(f);
3993 }
3994 }
3995
3996 FindClose(f);
3997 return create_error(GetLastError());
3998 }
3999 copied = TRUE;
4000
4001 hr = copy_file(src, src_len+name_len+2, dst, dst_len+name_len, overwrite);
4002 if(FAILED(hr) && hr!=CTL_E_FILENOTFOUND) {
4003 FindClose(f);
4004 return hr;
4005 }
4006
4007 hr = copy_folder(src, src_len+name_len+2, dst, dst_len+name_len, overwrite);
4008 if(FAILED(hr) && hr!=CTL_E_PATHNOTFOUND) {
4009 FindClose(f);
4010 return hr;
4011 }
4012 } while(FindNextFileW(f, &ffd));
4013 FindClose(f);
4014
4015 return copied ? S_OK : CTL_E_PATHNOTFOUND;
4016}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
BOOL WINAPI CreateDirectoryW(IN LPCWSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
Definition: dir.c:58
static HRESULT copy_file(const WCHAR *source, DWORD source_len, const WCHAR *destination, DWORD destination_len, VARIANT_BOOL overwrite)
Definition: filesystem.c:3817
static HRESULT copy_folder(const WCHAR *source, DWORD source_len, const WCHAR *destination, DWORD destination_len, VARIANT_BOOL overwrite)
Definition: filesystem.c:3905
unsigned int BOOL
Definition: ntddk_ex.h:94
GLenum src
Definition: glext.h:6340
GLenum GLenum dst
Definition: glext.h:6340
#define FAILED(hr)
Definition: intsafe.h:51
#define ERROR_ALREADY_EXISTS
Definition: disk.h:80
#define CTL_E_PATHNOTFOUND
Definition: olectl.h:288
#define CTL_E_FILEALREADYEXISTS
Definition: olectl.h:278

Referenced by copy_folder(), and filesys_CopyFolder().

◆ create_drive()

static HRESULT create_drive ( WCHAR  letter,
IDrive **  drive 
)
static

Definition at line 1321 of file filesystem.c.

1322{
1323 struct drive *object;
1324
1325 *drive = NULL;
1326
1327 object = malloc(sizeof(*object));
1328 if (!object) return E_OUTOFMEMORY;
1329
1330 object->IDrive_iface.lpVtbl = &drivevtbl;
1331 object->ref = 1;
1332 wcscpy(object->root, L"A:\\");
1333 *object->root = letter;
1334
1335 init_classinfo(&CLSID_Drive, (IUnknown *)&object->IDrive_iface, &object->classinfo);
1336 *drive = &object->IDrive_iface;
1337
1338 return S_OK;
1339}
static const IDriveVtbl drivevtbl
Definition: filesystem.c:1298
void init_classinfo(const GUID *guid, IUnknown *outer, struct provideclassinfo *classinfo)
Definition: scrrun.c:230
wcscpy
IDrive IDrive_iface
Definition: filesystem.c:99

Referenced by drivecoll_enumvariant_Next(), and filesys_GetDrive().

◆ create_drivecoll()

static HRESULT create_drivecoll ( IDriveCollection **  drives)
static

Definition at line 2360 of file filesystem.c.

2361{
2362 struct drivecollection *This;
2363 DWORD mask;
2364
2365 *drives = NULL;
2366
2367 This = malloc(sizeof(*This));
2368 if (!This) return E_OUTOFMEMORY;
2369
2370 This->IDriveCollection_iface.lpVtbl = &drivecollectionvtbl;
2371 This->ref = 1;
2372 This->drives = mask = GetLogicalDrives();
2373 /* count set bits */
2374 for (This->count = 0; mask; This->count++)
2375 mask &= mask - 1;
2376
2377 init_classinfo(&CLSID_Drives, (IUnknown *)&This->IDriveCollection_iface, &This->classinfo);
2378 *drives = &This->IDriveCollection_iface;
2379 return S_OK;
2380}
DWORD WINAPI DECLSPEC_HOTPATCH GetLogicalDrives(void)
Definition: volume.c:513
static const IDriveCollectionVtbl drivecollectionvtbl
Definition: filesystem.c:2347
GLenum GLint GLuint mask
Definition: glext.h:6028

Referenced by filesys_get_Drives().

◆ create_drivecoll_enum()

static HRESULT create_drivecoll_enum ( struct drivecollection *  collection,
IUnknown **  newenum 
)
static

Definition at line 1796 of file filesystem.c.

1797{
1798 struct enumvariant *This;
1799
1800 *newenum = NULL;
1801
1802 This = malloc(sizeof(*This));
1803 if (!This) return E_OUTOFMEMORY;
1804
1805 This->IEnumVARIANT_iface.lpVtbl = &drivecollenumvariantvtbl;
1806 This->ref = 1;
1807 This->data.u.drivecoll.coll = collection;
1808 This->data.u.drivecoll.cur = -1;
1809 IDriveCollection_AddRef(&collection->IDriveCollection_iface);
1810
1811 *newenum = (IUnknown*)&This->IEnumVARIANT_iface;
1812
1813 return S_OK;
1814}
static const IEnumVARIANTVtbl drivecollenumvariantvtbl
Definition: filesystem.c:1786

Referenced by drivecoll_enumvariant_Clone(), and drivecoll_get__NewEnum().

◆ create_error()

static HRESULT create_error ( DWORD  err)
inlinestatic

Definition at line 184 of file filesystem.c.

185{
186 switch(err) {
192 default:
193 FIXME("Unsupported error code: %ld\n", err);
194 return E_FAIL;
195 }
196}
#define FIXME(fmt,...)
Definition: precomp.h:53
#define ERROR_ACCESS_DENIED
Definition: compat.h:97
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
#define CTL_E_PERMISSIONDENIED
Definition: olectl.h:285
#define err(...)
#define ERROR_PATH_NOT_FOUND
Definition: winerror.h:228
#define ERROR_FILE_EXISTS
Definition: winerror.h:287

Referenced by copy_file(), copy_folder(), create_file(), create_textstream(), delete_file(), delete_folder(), file_get_Attributes(), file_get_Size(), file_put_Attributes(), filesys_MoveFile(), read_more_data(), textstream_write(), and textstream_writecrlf().

◆ create_file()

static HRESULT create_file ( BSTR  path,
IFile **  file 
)
static

Definition at line 3103 of file filesystem.c.

3104{
3105 struct file *f;
3106 DWORD len, attrs;
3107
3108 *file = NULL;
3109
3110 f = malloc(sizeof(struct file));
3111 if(!f)
3112 return E_OUTOFMEMORY;
3113
3114 f->IFile_iface.lpVtbl = &file_vtbl;
3115 f->ref = 1;
3116
3118 if (!len)
3119 {
3120 free(f);
3121 return E_FAIL;
3122 }
3123
3124 f->path = malloc(len*sizeof(WCHAR));
3125 if(!f->path)
3126 {
3127 free(f);
3128 return E_OUTOFMEMORY;
3129 }
3130
3131 if (!GetFullPathNameW(path, len, f->path, NULL))
3132 {
3133 free(f->path);
3134 free(f);
3135 return E_FAIL;
3136 }
3137
3138 attrs = GetFileAttributesW(f->path);
3140 {
3141 free(f->path);
3142 free(f);
3143 return create_error(GetLastError());
3144 }
3145
3146 init_classinfo(&CLSID_File, (IUnknown *)&f->IFile_iface, &f->classinfo);
3147 *file = &f->IFile_iface;
3148 return S_OK;
3149}
#define free
Definition: debug_ros.c:5
DWORD WINAPI GetFullPathNameW(IN LPCWSTR lpFileName, IN DWORD nBufferLength, OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart)
Definition: path.c:1164
static const IFileVtbl file_vtbl
Definition: filesystem.c:3075
Definition: fci.c:123
IFile IFile_iface
Definition: filesystem.c:113

◆ create_filecoll()

static HRESULT create_filecoll ( BSTR  path,
IFileCollection **  files 
)
static

Definition at line 2188 of file filesystem.c.

2189{
2190 struct filecollection *This;
2191
2192 *files = NULL;
2193
2194 This = malloc(sizeof(*This));
2195 if (!This) return E_OUTOFMEMORY;
2196
2197 This->IFileCollection_iface.lpVtbl = &filecollectionvtbl;
2198 This->ref = 1;
2199 This->path = SysAllocString(path);
2200 if (!This->path)
2201 {
2202 free(This);
2203 return E_OUTOFMEMORY;
2204 }
2205
2206 init_classinfo(&CLSID_Files, (IUnknown *)&This->IFileCollection_iface, &This->classinfo);
2207 *files = &This->IFileCollection_iface;
2208 return S_OK;
2209}
static const IFileCollectionVtbl filecollectionvtbl
Definition: filesystem.c:2175

Referenced by folder_get_Files().

◆ create_filecoll_enum()

static HRESULT create_filecoll_enum ( struct filecollection *  collection,
IUnknown **  newenum 
)
static

Definition at line 1673 of file filesystem.c.

1674{
1675 struct enumvariant *This;
1676
1677 *newenum = NULL;
1678
1679 This = malloc(sizeof(*This));
1680 if (!This) return E_OUTOFMEMORY;
1681
1682 This->IEnumVARIANT_iface.lpVtbl = &filecollenumvariantvtbl;
1683 This->ref = 1;
1684 This->data.u.filecoll.find = NULL;
1685 This->data.u.filecoll.coll = collection;
1686 IFileCollection_AddRef(&collection->IFileCollection_iface);
1687
1688 *newenum = (IUnknown*)&This->IEnumVARIANT_iface;
1689
1690 return S_OK;
1691}
static const IEnumVARIANTVtbl filecollenumvariantvtbl
Definition: filesystem.c:1663

Referenced by filecoll_enumvariant_Clone(), and filecoll_get__NewEnum().

◆ create_folder()

HRESULT create_folder ( const WCHAR *  path,
IFolder **  folder 
)
static

Definition at line 2715 of file filesystem.c.

2716{
2717 struct folder *object;
2718 DWORD len;
2719
2720 *folder = NULL;
2721
2722 TRACE("%s\n", debugstr_w(path));
2723
2724 if (!(object = malloc(sizeof(*object))))
2725 return E_OUTOFMEMORY;
2726
2727 object->IFolder_iface.lpVtbl = &foldervtbl;
2728 object->ref = 1;
2729
2731 if (!len)
2732 {
2733 free(object);
2734 return E_FAIL;
2735 }
2736
2737 object->path = SysAllocStringLen(NULL, len);
2738 if(!object->path)
2739 {
2740 free(object);
2741 return E_OUTOFMEMORY;
2742 }
2743
2744 if (!GetFullPathNameW(path, len, object->path, NULL))
2745 {
2746 SysFreeString(object->path);
2747 free(object);
2748 return E_FAIL;
2749 }
2750
2751 init_classinfo(&CLSID_Folder, (IUnknown *)&object->IFolder_iface, &object->classinfo);
2752 *folder = &object->IFolder_iface;
2753
2754 return S_OK;
2755}
static const IFolderVtbl foldervtbl
Definition: filesystem.c:2684
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:273
Definition: fci.c:112
IFolder IFolder_iface
Definition: filesystem.c:106

Referenced by filesys_CreateFolder(), filesys_GetFolder(), filesys_GetSpecialFolder(), and foldercoll_enumvariant_Next().

◆ create_foldercoll()

static HRESULT create_foldercoll ( BSTR  path,
IFolderCollection **  folders 
)
static

Definition at line 1994 of file filesystem.c.

1995{
1996 struct foldercollection *This;
1997
1998 *folders = NULL;
1999
2000 This = malloc(sizeof(*This));
2001 if (!This) return E_OUTOFMEMORY;
2002
2003 This->IFolderCollection_iface.lpVtbl = &foldercollvtbl;
2004 This->ref = 1;
2005 This->path = SysAllocString(path);
2006 if (!This->path)
2007 {
2008 free(This);
2009 return E_OUTOFMEMORY;
2010 }
2011
2012 init_classinfo(&CLSID_Folders, (IUnknown *)&This->IFolderCollection_iface, &This->classinfo);
2013 *folders = &This->IFolderCollection_iface;
2014
2015 return S_OK;
2016}
static const IFolderCollectionVtbl foldercollvtbl
Definition: filesystem.c:1980

Referenced by folder_get_SubFolders().

◆ create_foldercoll_enum()

static HRESULT create_foldercoll_enum ( struct foldercollection *  collection,
IUnknown **  newenum 
)
static

Definition at line 1531 of file filesystem.c.

1532{
1533 struct enumvariant *This;
1534
1535 *newenum = NULL;
1536
1537 This = malloc(sizeof(*This));
1538 if (!This) return E_OUTOFMEMORY;
1539
1540 This->IEnumVARIANT_iface.lpVtbl = &foldercollenumvariantvtbl;
1541 This->ref = 1;
1542 This->data.u.foldercoll.find = NULL;
1543 This->data.u.foldercoll.coll = collection;
1544 IFolderCollection_AddRef(&collection->IFolderCollection_iface);
1545
1546 *newenum = (IUnknown*)&This->IEnumVARIANT_iface;
1547
1548 return S_OK;
1549}
static const IEnumVARIANTVtbl foldercollenumvariantvtbl
Definition: filesystem.c:1521

Referenced by foldercoll_enumvariant_Clone(), and foldercoll_get__NewEnum().

◆ create_textstream()

static HRESULT create_textstream ( const WCHAR *  filename,
DWORD  disposition,
IOMode  mode,
Tristate  format,
ITextStream **  ret 
)
static

Definition at line 856 of file filesystem.c.

857{
858 static const unsigned short utf16bom = 0xfeff;
859 struct textstream *stream;
860 DWORD access = 0;
861 HRESULT hr;
862
863 /* map access mode */
864 switch (mode)
865 {
866 case ForReading:
868 break;
869 case ForWriting:
871 break;
872 case ForAppending:
874 break;
875 default:
876 return E_INVALIDARG;
877 }
878
879 if (!(stream = calloc(1, sizeof(*stream))))
880 return E_OUTOFMEMORY;
881
882 stream->ITextStream_iface.lpVtbl = &textstreamvtbl;
883 stream->ref = 1;
884 stream->mode = mode;
885
886 stream->file = CreateFileW(filename, access, 0, NULL, disposition, FILE_ATTRIBUTE_NORMAL, NULL);
887 if (stream->file == INVALID_HANDLE_VALUE)
888 {
890 free(stream);
891 return hr;
892 }
893
894 if (mode == ForReading)
896 else
897 stream->size.QuadPart = 0;
898
899 if (mode == ForWriting)
900 {
901 stream->unicode = format == TristateTrue;
902 /* Write Unicode BOM */
903 if (stream->unicode && (disposition == CREATE_ALWAYS || disposition == CREATE_NEW || disposition == TRUNCATE_EXISTING)) {
904 DWORD written = 0;
905 BOOL ret = WriteFile(stream->file, &utf16bom, sizeof(utf16bom), &written, NULL);
906 if (!ret || written != sizeof(utf16bom)) {
907 ITextStream_Release(&stream->ITextStream_iface);
908 return create_error(GetLastError());
909 }
910 }
911 }
912 else
913 {
914 DWORD read, buf_offset = 0;
915 BYTE buf[64];
916
917 if (format == TristateUseDefault || mode == ForReading)
918 {
919 if (!ReadFile(stream->file, buf, sizeof(buf), &read, NULL))
920 {
921 ITextStream_Release(&stream->ITextStream_iface);
922 return create_error(GetLastError());
923 }
924 }
925
926 if (format == TristateUseDefault)
927 stream->unicode = IsTextUnicode(buf, read, NULL);
928 else
929 stream->unicode = format != TristateFalse;
930
931 if (mode == ForReading)
932 {
933 if (stream->unicode && read >= 2 && buf[0] == 0xff && buf[1] == 0xfe)
934 buf_offset += 2; /* skip utf16 BOM */
935
936 hr = append_read_data(stream, (const char *)buf + buf_offset, read - buf_offset);
937 if (FAILED(hr))
938 {
939 ITextStream_Release(&stream->ITextStream_iface);
940 return hr;
941 }
942
943 stream->eof = read != sizeof(buf);
944 }
945 else
946 {
947 LONG filePosHigh = 0;
948 DWORD filePosLow = SetFilePointer(stream->file, 0, &filePosHigh, FILE_END);
949 if(stream->unicode && filePosHigh == 0 && filePosLow == 0) {
950 /* unicode ForAppending to an empty file, write BOM */
951 DWORD written = 0;
952 BOOL ret = WriteFile(stream->file, &utf16bom, sizeof(utf16bom), &written, NULL);
953 if (!ret || written != sizeof(utf16bom)) {
954 ITextStream_Release(&stream->ITextStream_iface);
955 return create_error(GetLastError());
956 }
957 }
958 }
959 }
960
961 init_classinfo(&CLSID_TextStream, (IUnknown *)&stream->ITextStream_iface, &stream->classinfo);
962 *ret = &stream->ITextStream_iface;
963 return S_OK;
964}
#define read
Definition: acwin.h:97
BOOL WINAPI IsTextUnicode(IN CONST VOID *lpv, IN INT iSize, IN OUT LPINT lpiResult OPTIONAL)
Definition: unicode.c:27
#define ReadFile(a, b, c, d, e)
Definition: compat.h:742
#define SetFilePointer
Definition: compat.h:743
#define GENERIC_READ
Definition: compat.h:135
#define CreateFileW
Definition: compat.h:741
#define GetFileSizeEx
Definition: compat.h:757
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
BOOL WINAPI WriteFile(_In_ HANDLE hFile, _In_reads_bytes_opt_(nNumberOfBytesToWrite) LPCVOID lpBuffer, _In_ DWORD nNumberOfBytesToWrite, _Out_opt_ LPDWORD lpNumberOfBytesWritten, _Inout_opt_ LPOVERLAPPED lpOverlapped)
Definition: rw.c:25
static HRESULT append_read_data(struct textstream *stream, const char *buf, size_t buf_size)
Definition: filesystem.c:435
static const ITextStreamVtbl textstreamvtbl
Definition: filesystem.c:722
GLenum mode
Definition: glext.h:6217
GLuint GLint GLboolean GLint GLenum access
Definition: glext.h:7866
const char * filename
Definition: ioapi.h:137
#define CREATE_ALWAYS
Definition: disk.h:72
#define TRUNCATE_EXISTING
Definition: disk.h:71
#define CREATE_NEW
Definition: disk.h:69
static const char utf16bom[]
Definition: filesystem.c:50
@ TristateFalse
Definition: scrrun.idl:62
@ TristateTrue
Definition: scrrun.idl:61
@ ForWriting
Definition: scrrun.idl:55
@ ForAppending
Definition: scrrun.idl:56
@ ForReading
Definition: scrrun.idl:54
#define GENERIC_WRITE
Definition: nt_native.h:90
long LONG
Definition: pedump.c:60
#define calloc
Definition: rosglue.h:14
unsigned int size
Definition: parse.h:27
#define FILE_END
Definition: winbase.h:117
unsigned char BYTE
Definition: xxhash.c:193

Referenced by file_OpenAsTextStream(), filesys_CreateTextFile(), filesys_OpenTextFile(), and folder_CreateTextFile().

◆ delete_file()

static HRESULT delete_file ( const WCHAR *  file,
DWORD  file_len,
VARIANT_BOOL  force 
)
inlinestatic

Definition at line 3666 of file filesystem.c.

3667{
3669 DWORD len, name_len;
3670 WIN32_FIND_DATAW ffd;
3671 HANDLE f;
3672
3673 f = FindFirstFileW(file, &ffd);
3674 if(f == INVALID_HANDLE_VALUE)
3675 return create_error(GetLastError());
3676
3677 len = get_parent_folder_name(file, file_len);
3678 if(len+1 >= MAX_PATH) {
3679 FindClose(f);
3680 return E_FAIL;
3681 }
3682 if(len) {
3683 memcpy(path, file, len*sizeof(WCHAR));
3684 path[len++] = '\\';
3685 }
3686
3687 do {
3689 continue;
3690
3691 name_len = lstrlenW(ffd.cFileName);
3692 if(len+name_len+1 >= MAX_PATH) {
3693 FindClose(f);
3694 return E_FAIL;
3695 }
3696 memcpy(path+len, ffd.cFileName, (name_len+1)*sizeof(WCHAR));
3697
3698 TRACE("deleting %s\n", debugstr_w(path));
3699
3700 if(!DeleteFileW(path)) {
3702 || !DeleteFileW(path)) {
3703 FindClose(f);
3704 return create_error(GetLastError());
3705 }
3706 }
3707 } while(FindNextFileW(f, &ffd));
3708 FindClose(f);
3709
3710 return S_OK;
3711}
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
Definition: delete.c:39
BOOL WINAPI SetFileAttributesW(LPCWSTR lpFileName, DWORD dwFileAttributes)
Definition: fileinfo.c:779
BOOL force
Definition: metahost.c:100

◆ delete_folder()

static HRESULT delete_folder ( const WCHAR *  folder,
DWORD  folder_len,
VARIANT_BOOL  force 
)
static

Definition at line 3724 of file filesystem.c.

3725{
3727 DWORD len, name_len;
3728 WIN32_FIND_DATAW ffd;
3729 HANDLE f;
3730 HRESULT hr;
3731
3732 f = FindFirstFileW(folder, &ffd);
3733 if(f == INVALID_HANDLE_VALUE)
3734 return create_error(GetLastError());
3735
3736 len = get_parent_folder_name(folder, folder_len);
3737 if(len+1 >= MAX_PATH) {
3738 FindClose(f);
3739 return E_FAIL;
3740 }
3741 if(len) {
3742 memcpy(path, folder, len*sizeof(WCHAR));
3743 path[len++] = '\\';
3744 }
3745
3746 do {
3748 continue;
3749 if(ffd.cFileName[0]=='.' && (ffd.cFileName[1]==0 ||
3750 (ffd.cFileName[1]=='.' && ffd.cFileName[2]==0)))
3751 continue;
3752
3753 name_len = lstrlenW(ffd.cFileName);
3754 if(len+name_len+3 >= MAX_PATH) {
3755 FindClose(f);
3756 return E_FAIL;
3757 }
3758 memcpy(path+len, ffd.cFileName, name_len*sizeof(WCHAR));
3759 path[len+name_len] = '\\';
3760 path[len+name_len+1] = '*';
3761 path[len+name_len+2] = 0;
3762
3763 hr = delete_file(path, len+name_len+2, force);
3764 if(FAILED(hr)) {
3765 FindClose(f);
3766 return hr;
3767 }
3768
3769 hr = delete_folder(path, len+name_len+2, force);
3770 if(FAILED(hr)) {
3771 FindClose(f);
3772 return hr;
3773 }
3774
3775 path[len+name_len] = 0;
3776 TRACE("deleting %s\n", debugstr_w(path));
3777
3778 if(!RemoveDirectoryW(path)) {
3779 FindClose(f);
3780 return create_error(GetLastError());
3781 }
3782 } while(FindNextFileW(f, &ffd));
3783 FindClose(f);
3784
3785 return S_OK;
3786}
BOOL WINAPI RemoveDirectoryW(IN LPCWSTR lpPathName)
Definition: dir.c:700
static HRESULT delete_folder(const WCHAR *folder, DWORD folder_len, VARIANT_BOOL force)
Definition: filesystem.c:3724
#define delete_file(f)
Definition: reg_test.h:97

Referenced by delete_folder(), and filesys_DeleteFolder().

◆ DoOpenPipeStream()

HRESULT WINAPI DoOpenPipeStream ( HANDLE  pipe,
IOMode  mode,
ITextStream **  ret 
)

Definition at line 966 of file filesystem.c.

967{
968 struct textstream *stream;
969
970 TRACE("%p, %d, %p.\n", pipe, mode, ret);
971
972 if (!(stream = calloc(1, sizeof(*stream))))
973 return E_OUTOFMEMORY;
974
975 stream->ITextStream_iface.lpVtbl = &pipestreamvtbl;
976 stream->ref = 1;
977 stream->mode = mode;
978 stream->file = pipe;
979
980 init_classinfo(&CLSID_TextStream, (IUnknown *)&stream->ITextStream_iface, &stream->classinfo);
981 *ret = &stream->ITextStream_iface;
982
983 return S_OK;
984}
static const ITextStreamVtbl pipestreamvtbl
Definition: filesystem.c:832

Referenced by WshExec_create().

◆ drive_AddRef()

static ULONG WINAPI drive_AddRef ( IDrive *  iface)
static

Definition at line 1011 of file filesystem.c.

1012{
1013 struct drive *drive = impl_from_IDrive(iface);
1015
1016 TRACE("%p, refcount %ld.\n", iface, ref);
1017
1018 return ref;
1019}
#define InterlockedIncrement
Definition: armddk.h:53
static struct drive * impl_from_IDrive(IDrive *iface)
Definition: filesystem.c:144
LONG ref
Definition: filesystem.c:100
Definition: send.c:48
uint32_t ULONG
Definition: typedefs.h:59

◆ drive_get_AvailableSpace()

static HRESULT WINAPI drive_get_AvailableSpace ( IDrive *  iface,
VARIANT *  v 
)
static

Definition at line 1177 of file filesystem.c.

1178{
1179 struct drive *This = impl_from_IDrive(iface);
1181
1182 TRACE("(%p)->(%p)\n", This, v);
1183
1184 if (!v)
1185 return E_POINTER;
1186
1187 if (!GetDiskFreeSpaceExW(This->root, &avail, NULL, NULL))
1188 return E_FAIL;
1189
1190 return variant_from_largeint(&avail, v);
1191}
static int avail
Definition: adh-main.c:39
BOOL WINAPI GetDiskFreeSpaceExW(IN LPCWSTR lpDirectoryName OPTIONAL, OUT PULARGE_INTEGER lpFreeBytesAvailableToCaller, OUT PULARGE_INTEGER lpTotalNumberOfBytes, OUT PULARGE_INTEGER lpTotalNumberOfFreeBytes)
Definition: disk.c:342
static HRESULT variant_from_largeint(const ULARGE_INTEGER *src, VARIANT *v)
Definition: filesystem.c:1159
const GLdouble * v
Definition: gl.h:2040
#define E_POINTER
Definition: winerror.h:3480

◆ drive_get_DriveLetter()

static HRESULT WINAPI drive_get_DriveLetter ( IDrive *  iface,
BSTR *  letter 
)
static

Definition at line 1098 of file filesystem.c.

1099{
1100 struct drive *This = impl_from_IDrive(iface);
1101
1102 TRACE("(%p)->(%p)\n", This, letter);
1103
1104 if (!letter)
1105 return E_POINTER;
1106
1107 *letter = SysAllocStringLen(This->root, 1);
1108 if (!*letter)
1109 return E_OUTOFMEMORY;
1110
1111 return S_OK;
1112}

◆ drive_get_DriveType()

static HRESULT WINAPI drive_get_DriveType ( IDrive *  iface,
DriveTypeConst *  type 
)
static

Definition at line 1121 of file filesystem.c.

1122{
1123 struct drive *This = impl_from_IDrive(iface);
1124
1125 TRACE("(%p)->(%p)\n", This, type);
1126
1127 switch (GetDriveTypeW(This->root))
1128 {
1129 case DRIVE_REMOVABLE:
1130 *type = Removable;
1131 break;
1132 case DRIVE_FIXED:
1133 *type = Fixed;
1134 break;
1135 case DRIVE_REMOTE:
1136 *type = Remote;
1137 break;
1138 case DRIVE_CDROM:
1139 *type = CDRom;
1140 break;
1141 case DRIVE_RAMDISK:
1142 *type = RamDisk;
1143 break;
1144 default:
1145 *type = UnknownType;
1146 break;
1147 }
1148
1149 return S_OK;
1150}
UINT WINAPI GetDriveTypeW(IN LPCWSTR lpRootPathName)
Definition: disk.c:497
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
@ UnknownType
Definition: scrrun.idl:89
@ RamDisk
Definition: scrrun.idl:94
@ Remote
Definition: scrrun.idl:92
@ Removable
Definition: arc.h:90
#define DRIVE_REMOTE
Definition: winbase.h:278
#define DRIVE_RAMDISK
Definition: winbase.h:280
#define DRIVE_CDROM
Definition: winbase.h:279
#define DRIVE_FIXED
Definition: winbase.h:277
#define DRIVE_REMOVABLE
Definition: winbase.h:276

◆ drive_get_FileSystem()

static HRESULT WINAPI drive_get_FileSystem ( IDrive *  iface,
BSTR *  fs 
)
static

Definition at line 1250 of file filesystem.c.

1251{
1252 struct drive *This = impl_from_IDrive(iface);
1253 WCHAR nameW[MAX_PATH+1];
1254 BOOL ret;
1255
1256 TRACE("(%p)->(%p)\n", This, fs);
1257
1258 if (!fs)
1259 return E_POINTER;
1260
1261 *fs = NULL;
1263 if (ret)
1265 return ret ? S_OK : E_FAIL;
1266}
static const WCHAR nameW[]
Definition: main.c:49
#define ARRAY_SIZE(A)
Definition: main.h:20
BOOL WINAPI GetVolumeInformationW(IN LPCWSTR lpRootPathName, IN LPWSTR lpVolumeNameBuffer, IN DWORD nVolumeNameSize, OUT LPDWORD lpVolumeSerialNumber OPTIONAL, OUT LPDWORD lpMaximumComponentLength OPTIONAL, OUT LPDWORD lpFileSystemFlags OPTIONAL, OUT LPWSTR lpFileSystemNameBuffer OPTIONAL, IN DWORD nFileSystemNameSize)
Definition: volume.c:226
Definition: ffs.h:70

◆ drive_get_FreeSpace()

static HRESULT WINAPI drive_get_FreeSpace ( IDrive *  iface,
VARIANT *  v 
)
static

Definition at line 1193 of file filesystem.c.

1194{
1195 struct drive *This = impl_from_IDrive(iface);
1196 ULARGE_INTEGER freespace;
1197
1198 TRACE("(%p)->(%p)\n", This, v);
1199
1200 if (!v)
1201 return E_POINTER;
1202
1203 if (!GetDiskFreeSpaceExW(This->root, &freespace, NULL, NULL))
1204 return E_FAIL;
1205
1206 return variant_from_largeint(&freespace, v);
1207}

◆ drive_get_IsReady()

static HRESULT WINAPI drive_get_IsReady ( IDrive *  iface,
VARIANT_BOOL *  ready 
)
static

Definition at line 1282 of file filesystem.c.

1283{
1284 struct drive *This = impl_from_IDrive(iface);
1285 ULARGE_INTEGER freespace;
1286 BOOL ret;
1287
1288 TRACE("(%p)->(%p)\n", This, ready);
1289
1290 if (!ready)
1291 return E_POINTER;
1292
1293 ret = GetDiskFreeSpaceExW(This->root, &freespace, NULL, NULL);
1294 *ready = ret ? VARIANT_TRUE : VARIANT_FALSE;
1295 return S_OK;
1296}

◆ drive_get_Path()

static HRESULT WINAPI drive_get_Path ( IDrive *  iface,
BSTR *  path 
)
static

Definition at line 1091 of file filesystem.c.

1092{
1093 struct drive *This = impl_from_IDrive(iface);
1094 FIXME("(%p)->(%p): stub\n", This, path);
1095 return E_NOTIMPL;
1096}
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ drive_get_RootFolder()

static HRESULT WINAPI drive_get_RootFolder ( IDrive *  iface,
IFolder **  folder 
)
static

Definition at line 1152 of file filesystem.c.

1153{
1154 struct drive *This = impl_from_IDrive(iface);
1155 FIXME("(%p)->(%p): stub\n", This, folder);
1156 return E_NOTIMPL;
1157}

◆ drive_get_SerialNumber()

static HRESULT WINAPI drive_get_SerialNumber ( IDrive *  iface,
LONG *  serial 
)
static

Definition at line 1268 of file filesystem.c.

1269{
1270 struct drive *This = impl_from_IDrive(iface);
1271 BOOL ret;
1272
1273 TRACE("(%p)->(%p)\n", This, serial);
1274
1275 if (!serial)
1276 return E_POINTER;
1277
1278 ret = GetVolumeInformationW(This->root, NULL, 0, (DWORD*)serial, NULL, NULL, NULL, 0);
1279 return ret ? S_OK : E_FAIL;
1280}
uint32_t serial
Definition: fsck.fat.h:29

◆ drive_get_ShareName()

static HRESULT WINAPI drive_get_ShareName ( IDrive *  iface,
BSTR *  share_name 
)
static

Definition at line 1114 of file filesystem.c.

1115{
1116 struct drive *This = impl_from_IDrive(iface);
1117 FIXME("(%p)->(%p): stub\n", This, share_name);
1118 return E_NOTIMPL;
1119}

◆ drive_get_TotalSize()

static HRESULT WINAPI drive_get_TotalSize ( IDrive *  iface,
VARIANT *  v 
)
static

Definition at line 1209 of file filesystem.c.

1210{
1211 struct drive *This = impl_from_IDrive(iface);
1213
1214 TRACE("(%p)->(%p)\n", This, v);
1215
1216 if (!v)
1217 return E_POINTER;
1218
1219 if (!GetDiskFreeSpaceExW(This->root, NULL, &total, NULL))
1220 return E_FAIL;
1221
1222 return variant_from_largeint(&total, v);
1223}
size_t total

◆ drive_get_VolumeName()

static HRESULT WINAPI drive_get_VolumeName ( IDrive *  iface,
BSTR *  name 
)
static

Definition at line 1225 of file filesystem.c.

1226{
1227 struct drive *This = impl_from_IDrive(iface);
1228 WCHAR nameW[MAX_PATH+1];
1229 BOOL ret;
1230
1231 TRACE("(%p)->(%p)\n", This, name);
1232
1233 if (!name)
1234 return E_POINTER;
1235
1236 *name = NULL;
1238 if (ret)
1240 return ret ? S_OK : E_FAIL;
1241}
Definition: name.c:39

◆ drive_GetIDsOfNames()

static HRESULT WINAPI drive_GetIDsOfNames ( IDrive *  iface,
REFIID  riid,
LPOLESTR *  rgszNames,
UINT  cNames,
LCID  lcid,
DISPID *  rgDispId 
)
static

Definition at line 1050 of file filesystem.c.

1053{
1055 HRESULT hr;
1056
1057 TRACE("%p, %s, %p, %u, %lx, %p.\n", iface, debugstr_guid(riid), rgszNames, cNames, lcid, rgDispId);
1058
1060 if(SUCCEEDED(hr))
1061 {
1062 hr = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId);
1063 ITypeInfo_Release(typeinfo);
1064 }
1065
1066 return hr;
1067}
HRESULT get_typeinfo(enum type_id tid, ITypeInfo **ret)
Definition: apps.c:125
LCID lcid
Definition: locale.c:5660
REFIID riid
Definition: atlbase.h:39
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define debugstr_guid
Definition: kernel32.h:35
@ IDrive_tid

◆ drive_GetTypeInfo()

static HRESULT WINAPI drive_GetTypeInfo ( IDrive *  iface,
UINT  iTInfo,
LCID  lcid,
ITypeInfo **  ppTInfo 
)
static

Definition at line 1042 of file filesystem.c.

1044{
1045 TRACE("%p, %u, %lx, %p.\n", iface, iTInfo, lcid, ppTInfo);
1046
1047 return get_typeinfo(IDrive_tid, ppTInfo);
1048}

◆ drive_GetTypeInfoCount()

static HRESULT WINAPI drive_GetTypeInfoCount ( IDrive *  iface,
UINT *  pctinfo 
)
static

Definition at line 1034 of file filesystem.c.

1035{
1036 struct drive *This = impl_from_IDrive(iface);
1037 TRACE("(%p)->(%p)\n", This, pctinfo);
1038 *pctinfo = 1;
1039 return S_OK;
1040}

◆ drive_Invoke()

static HRESULT WINAPI drive_Invoke ( IDrive *  iface,
DISPID  dispIdMember,
REFIID  riid,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pDispParams,
VARIANT *  pVarResult,
EXCEPINFO *  pExcepInfo,
UINT *  puArgErr 
)
static

Definition at line 1069 of file filesystem.c.

1073{
1075 HRESULT hr;
1076
1077 TRACE("%p, %ld, %s, %lx, %d, %p, %p, %p, %p.\n", iface, dispIdMember, debugstr_guid(riid),
1078 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
1079
1081 if(SUCCEEDED(hr))
1082 {
1083 hr = ITypeInfo_Invoke(typeinfo, iface, dispIdMember, wFlags,
1084 pDispParams, pVarResult, pExcepInfo, puArgErr);
1085 ITypeInfo_Release(typeinfo);
1086 }
1087
1088 return hr;
1089}
WINBASEAPI _In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon_undoc.h:337

◆ drive_put_VolumeName()

static HRESULT WINAPI drive_put_VolumeName ( IDrive *  iface,
BSTR  name 
)
static

Definition at line 1243 of file filesystem.c.

1244{
1245 struct drive *This = impl_from_IDrive(iface);
1246 FIXME("(%p)->(%s): stub\n", This, debugstr_w(name));
1247 return E_NOTIMPL;
1248}

◆ drive_QueryInterface()

static HRESULT WINAPI drive_QueryInterface ( IDrive *  iface,
REFIID  riid,
void **  obj 
)
static

Definition at line 986 of file filesystem.c.

987{
988 struct drive *This = impl_from_IDrive(iface);
989
990 TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), obj);
991
992 *obj = NULL;
993
994 if (IsEqualIID( riid, &IID_IDrive ) ||
997 {
998 *obj = &This->IDrive_iface;
999 }
1001 {
1002 *obj = &This->classinfo.IProvideClassInfo_iface;
1003 }
1004 else
1005 return E_NOINTERFACE;
1006
1007 IUnknown_AddRef((IUnknown*)*obj);
1008 return S_OK;
1009}
const GUID IID_IUnknown
const GUID IID_IProvideClassInfo
const GUID IID_IDispatch
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define E_NOINTERFACE
Definition: winerror.h:3479

◆ drive_Release()

static ULONG WINAPI drive_Release ( IDrive *  iface)
static

Definition at line 1021 of file filesystem.c.

1022{
1023 struct drive *drive = impl_from_IDrive(iface);
1025
1026 TRACE("%p, refcount %ld.\n", iface, ref);
1027
1028 if (!ref)
1029 free(drive);
1030
1031 return ref;
1032}
#define InterlockedDecrement
Definition: armddk.h:52

◆ drivecoll_AddRef()

static ULONG WINAPI drivecoll_AddRef ( IDriveCollection *  iface)
static

Definition at line 2236 of file filesystem.c.

2237{
2240
2241 TRACE("%p, refcount %ld.\n", iface, ref);
2242
2243 return ref;
2244}
static struct drivecollection * impl_from_IDriveCollection(IDriveCollection *iface)
Definition: filesystem.c:174
LONG ref
Definition: collection.c:58

◆ drivecoll_enumvariant_Clone()

static HRESULT WINAPI drivecoll_enumvariant_Clone ( IEnumVARIANT *  iface,
IEnumVARIANT **  pclone 
)
static

Definition at line 1779 of file filesystem.c.

1780{
1781 struct enumvariant *This = impl_from_IEnumVARIANT(iface);
1782 TRACE("(%p)->(%p)\n", This, pclone);
1783 return create_drivecoll_enum(This->data.u.drivecoll.coll, (IUnknown**)pclone);
1784}
static HRESULT create_drivecoll_enum(struct drivecollection *, IUnknown **)
Definition: filesystem.c:1796
static struct enumvariant * impl_from_IEnumVARIANT(IEnumVARIANT *iface)
Definition: filesystem.c:179

◆ drivecoll_enumvariant_Next()

static HRESULT WINAPI drivecoll_enumvariant_Next ( IEnumVARIANT *  iface,
ULONG  celt,
VARIANT *  var,
ULONG *  fetched 
)
static

Definition at line 1723 of file filesystem.c.

1724{
1725 struct enumvariant *This = impl_from_IEnumVARIANT(iface);
1726 ULONG count = 0;
1727
1728 TRACE("%p, %lu, %p, %p.\n", iface, celt, var, fetched);
1729
1730 if (fetched)
1731 *fetched = 0;
1732
1733 if (!celt) return S_OK;
1734
1735 while (find_next_drive(This) == S_OK)
1736 {
1737 IDrive *drive;
1738 HRESULT hr;
1739
1740 hr = create_drive('A' + This->data.u.drivecoll.cur, &drive);
1741 if (FAILED(hr)) return hr;
1742
1745
1746 if (++count >= celt) break;
1747 }
1748
1749 if (fetched)
1750 *fetched = count;
1751
1752 return (count < celt) ? S_FALSE : S_OK;
1753}
@ VT_DISPATCH
Definition: compat.h:2304
static HRESULT find_next_drive(struct enumvariant *penum)
Definition: filesystem.c:1709
static HRESULT create_drive(WCHAR letter, IDrive **drive)
Definition: filesystem.c:1321
GLuint GLuint GLsizei count
Definition: gl.h:1545
const char * var
Definition: shader.c:5879
#define V_VT(A)
Definition: oleauto.h:211
#define V_DISPATCH(A)
Definition: oleauto.h:239
#define S_FALSE
Definition: winerror.h:3451

◆ drivecoll_enumvariant_Release()

static ULONG WINAPI drivecoll_enumvariant_Release ( IEnumVARIANT *  iface)
static

Definition at line 1693 of file filesystem.c.

1694{
1695 struct enumvariant *This = impl_from_IEnumVARIANT(iface);
1697
1698 TRACE("%p, refcount %ld.\n", iface, ref);
1699
1700 if (!ref)
1701 {
1702 IDriveCollection_Release(&This->data.u.drivecoll.coll->IDriveCollection_iface);
1703 free(This);
1704 }
1705
1706 return ref;
1707}
LONG ref
Definition: selection.c:59

◆ drivecoll_enumvariant_Reset()

static HRESULT WINAPI drivecoll_enumvariant_Reset ( IEnumVARIANT *  iface)
static

Definition at line 1769 of file filesystem.c.

1770{
1771 struct enumvariant *This = impl_from_IEnumVARIANT(iface);
1772
1773 TRACE("(%p)\n", This);
1774
1775 This->data.u.drivecoll.cur = -1;
1776 return S_OK;
1777}

◆ drivecoll_enumvariant_Skip()

static HRESULT WINAPI drivecoll_enumvariant_Skip ( IEnumVARIANT *  iface,
ULONG  celt 
)
static

Definition at line 1755 of file filesystem.c.

1756{
1757 struct enumvariant *This = impl_from_IEnumVARIANT(iface);
1758
1759 TRACE("%p, %lu.\n", iface, celt);
1760
1761 if (!celt) return S_OK;
1762
1763 while (celt && find_next_drive(This) == S_OK)
1764 celt--;
1765
1766 return celt ? S_FALSE : S_OK;
1767}

◆ drivecoll_get__NewEnum()

static HRESULT WINAPI drivecoll_get__NewEnum ( IDriveCollection *  iface,
IUnknown **  ppenum 
)
static

Definition at line 2323 of file filesystem.c.

2324{
2326
2327 TRACE("(%p)->(%p)\n", This, ppenum);
2328
2329 if(!ppenum)
2330 return E_POINTER;
2331
2332 return create_drivecoll_enum(This, ppenum);
2333}

◆ drivecoll_get_Count()

static HRESULT WINAPI drivecoll_get_Count ( IDriveCollection *  iface,
LONG *  count 
)
static

Definition at line 2335 of file filesystem.c.

2336{
2338
2339 TRACE("(%p)->(%p)\n", This, count);
2340
2341 if (!count) return E_POINTER;
2342
2343 *count = This->count;
2344 return S_OK;
2345}

◆ drivecoll_get_Item()

static HRESULT WINAPI drivecoll_get_Item ( IDriveCollection *  iface,
VARIANT  key,
IDrive **  drive 
)
static

Definition at line 2316 of file filesystem.c.

2317{
2319 FIXME("(%p)->(%p): stub\n", This, drive);
2320 return E_NOTIMPL;
2321}

◆ drivecoll_GetIDsOfNames()

static HRESULT WINAPI drivecoll_GetIDsOfNames ( IDriveCollection *  iface,
REFIID  riid,
LPOLESTR *  rgszNames,
UINT  cNames,
LCID  lcid,
DISPID *  rgDispId 
)
static

Definition at line 2275 of file filesystem.c.

2278{
2280 HRESULT hr;
2281
2282 TRACE("%p, %s, %p, %u, %lx, %p.\n", iface, debugstr_guid(riid), rgszNames, cNames, lcid, rgDispId);
2283
2285 if(SUCCEEDED(hr))
2286 {
2287 hr = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId);
2288 ITypeInfo_Release(typeinfo);
2289 }
2290
2291 return hr;
2292}
@ IDriveCollection_tid

◆ drivecoll_GetTypeInfo()

static HRESULT WINAPI drivecoll_GetTypeInfo ( IDriveCollection *  iface,
UINT  iTInfo,
LCID  lcid,
ITypeInfo **  ppTInfo 
)
static

Definition at line 2267 of file filesystem.c.

2269{
2270 TRACE("%p, %u, %lx, %p.\n", iface, iTInfo, lcid, ppTInfo);
2271
2272 return get_typeinfo(IDriveCollection_tid, ppTInfo);
2273}

◆ drivecoll_GetTypeInfoCount()

static HRESULT WINAPI drivecoll_GetTypeInfoCount ( IDriveCollection *  iface,
UINT *  pctinfo 
)
static

Definition at line 2259 of file filesystem.c.

2260{
2262 TRACE("(%p)->(%p)\n", This, pctinfo);
2263 *pctinfo = 1;
2264 return S_OK;
2265}

◆ drivecoll_Invoke()

static HRESULT WINAPI drivecoll_Invoke ( IDriveCollection *  iface,
DISPID  dispIdMember,
REFIID  riid,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pDispParams,
VARIANT *  pVarResult,
EXCEPINFO *  pExcepInfo,
UINT *  puArgErr 
)
static

Definition at line 2294 of file filesystem.c.

2298{
2300 HRESULT hr;
2301
2302 TRACE("%p, %ld, %s, %lx, %d, %p, %p, %p, %p.\n", iface, dispIdMember, debugstr_guid(riid),
2303 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
2304
2306 if(SUCCEEDED(hr))
2307 {
2308 hr = ITypeInfo_Invoke(typeinfo, iface, dispIdMember, wFlags,
2309 pDispParams, pVarResult, pExcepInfo, puArgErr);
2310 ITypeInfo_Release(typeinfo);
2311 }
2312
2313 return hr;
2314}

◆ drivecoll_QueryInterface()

static HRESULT WINAPI drivecoll_QueryInterface ( IDriveCollection *  iface,
REFIID  riid,
void **  obj 
)
static

Definition at line 2211 of file filesystem.c.

2212{
2214
2215 TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), obj);
2216
2217 *obj = NULL;
2218
2219 if (IsEqualIID( riid, &IID_IDriveCollection ) ||
2222 {
2223 *obj = &This->IDriveCollection_iface;
2224 }
2226 {
2227 *obj = &This->classinfo.IProvideClassInfo_iface;
2228 }
2229 else
2230 return E_NOINTERFACE;
2231
2232 IUnknown_AddRef((IUnknown*)*obj);
2233 return S_OK;
2234}

◆ drivecoll_Release()

static ULONG WINAPI drivecoll_Release ( IDriveCollection *  iface)
static

Definition at line 2246 of file filesystem.c.

2247{
2250
2251 TRACE("%p, refcount %ld.\n", iface, ref);
2252
2253 if (!ref)
2255
2256 return ref;
2257}

◆ enumvariant_AddRef()

static ULONG WINAPI enumvariant_AddRef ( IEnumVARIANT *  iface)
static

Definition at line 1361 of file filesystem.c.

1362{
1363 struct enumvariant *This = impl_from_IEnumVARIANT(iface);
1365 TRACE("%p, refcount %ld.\n", iface, ref);
1366 return ref;
1367}

◆ enumvariant_QueryInterface()

static HRESULT WINAPI enumvariant_QueryInterface ( IEnumVARIANT *  iface,
REFIID  riid,
void **  obj 
)
static

Definition at line 1341 of file filesystem.c.

1342{
1343 struct enumvariant *This = impl_from_IEnumVARIANT(iface);
1344
1345 TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), obj);
1346
1347 *obj = NULL;
1348
1349 if (IsEqualIID( riid, &IID_IEnumVARIANT ) ||
1351 {
1352 *obj = iface;
1353 IEnumVARIANT_AddRef(iface);
1354 }
1355 else
1356 return E_NOINTERFACE;
1357
1358 return S_OK;
1359}

◆ file_AddRef()

static ULONG WINAPI file_AddRef ( IFile *  iface)
static

Definition at line 2782 of file filesystem.c.

2783{
2784 struct file *file = impl_from_IFile(iface);
2786
2787 TRACE("%p, refcount %ld.\n", iface, ref);
2788
2789 return ref;
2790}
static struct file * impl_from_IFile(IFile *iface)
Definition: filesystem.c:154
LONG ref
Definition: filesystem.c:114

◆ file_Copy()

static HRESULT WINAPI file_Copy ( IFile *  iface,
BSTR  Destination,
VARIANT_BOOL  OverWriteFiles 
)
static

Definition at line 3052 of file filesystem.c.

3053{
3054 struct file *This = impl_from_IFile(iface);
3055 FIXME("(%p)->(%s %x)\n", This, debugstr_w(Destination), OverWriteFiles);
3056 return E_NOTIMPL;
3057}
_In_ PUNICODE_STRING _Inout_ PUNICODE_STRING Destination
Definition: rtlfuncs.h:3051

◆ file_Delete()

static HRESULT WINAPI file_Delete ( IFile *  iface,
VARIANT_BOOL  Force 
)
static

Definition at line 3045 of file filesystem.c.

3046{
3047 struct file *This = impl_from_IFile(iface);
3048 FIXME("(%p)->(%x)\n", This, Force);
3049 return E_NOTIMPL;
3050}
_Inout_ PVCB _In_ BOOLEAN Force
Definition: cdprocs.h:1417

◆ file_get_Attributes()

static HRESULT WINAPI file_get_Attributes ( IFile *  iface,
FileAttribute *  pfa 
)
static

Definition at line 2938 of file filesystem.c.

2939{
2940 struct file *This = impl_from_IFile(iface);
2941 DWORD fa;
2942
2943 TRACE("(%p)->(%p)\n", This, pfa);
2944
2945 if(!pfa)
2946 return E_POINTER;
2947
2948 fa = GetFileAttributesW(This->path);
2950 return create_error(GetLastError());
2951
2955 return S_OK;
2956}
#define FILE_ATTRIBUTE_READONLY
Definition: nt_native.h:702
#define FILE_ATTRIBUTE_COMPRESSED
Definition: nt_native.h:711
#define FILE_ATTRIBUTE_HIDDEN
Definition: nt_native.h:703
#define FILE_ATTRIBUTE_SYSTEM
Definition: nt_native.h:704
#define FILE_ATTRIBUTE_ARCHIVE
Definition: nt_native.h:706
#define FILE_ATTRIBUTE_REPARSE_POINT
Definition: ntifs_ex.h:381
f_args fa
Definition: format.c:280

◆ file_get_DateCreated()

static HRESULT WINAPI file_get_DateCreated ( IFile *  iface,
DATE *  date 
)
static

Definition at line 2982 of file filesystem.c.

2983{
2984 struct file *This = impl_from_IFile(iface);
2986
2987 TRACE("(%p)->(%p)\n", This, date);
2988
2991
2992 return E_FAIL;
2993}
BOOL WINAPI GetFileAttributesExW(LPCWSTR lpFileName, GET_FILEEX_INFO_LEVELS fInfoLevelId, LPVOID lpFileInformation)
Definition: fileinfo.c:536
static HRESULT get_date_from_filetime(const FILETIME *ft, DATE *date)
Definition: filesystem.c:2967
@ GetFileExInfoStandard
Definition: minwinbase.h:356
__u16 date
Definition: mkdosfs.c:8

◆ file_get_DateLastAccessed()

static HRESULT WINAPI file_get_DateLastAccessed ( IFile *  iface,
DATE *  pdate 
)
static

Definition at line 3008 of file filesystem.c.

3009{
3010 struct file *This = impl_from_IFile(iface);
3011 FIXME("(%p)->(%p)\n", This, pdate);
3012 return E_NOTIMPL;
3013}

◆ file_get_DateLastModified()

static HRESULT WINAPI file_get_DateLastModified ( IFile *  iface,
DATE *  date 
)
static

Definition at line 2995 of file filesystem.c.

2996{
2997 struct file *This = impl_from_IFile(iface);
2999
3000 TRACE("(%p)->(%p)\n", This, date);
3001
3004
3005 return E_FAIL;
3006}

◆ file_get_Drive()

static HRESULT WINAPI file_get_Drive ( IFile *  iface,
IDrive **  ppdrive 
)
static

Definition at line 2924 of file filesystem.c.

2925{
2926 struct file *This = impl_from_IFile(iface);
2927 FIXME("(%p)->(%p)\n", This, ppdrive);
2928 return E_NOTIMPL;
2929}

◆ file_get_Name()

static HRESULT WINAPI file_get_Name ( IFile *  iface,
BSTR *  name 
)
static

Definition at line 2878 of file filesystem.c.

2879{
2880 struct file *This = impl_from_IFile(iface);
2881 WCHAR *ptr;
2882
2883 TRACE("(%p)->(%p)\n", This, name);
2884
2885 if(!name)
2886 return E_POINTER;
2887
2888 *name = NULL;
2889
2890 ptr = wcsrchr(This->path, '\\');
2891 if (ptr)
2892 {
2893 *name = SysAllocString(ptr+1);
2894 TRACE("%s\n", debugstr_w(*name));
2895 if (!*name) return E_OUTOFMEMORY;
2896 }
2897 else
2898 return E_FAIL;
2899
2900 return S_OK;
2901}
#define wcsrchr
Definition: compat.h:16
static PVOID ptr
Definition: dispmode.c:27

◆ file_get_ParentFolder()

static HRESULT WINAPI file_get_ParentFolder ( IFile *  iface,
IFolder **  ppfolder 
)
static

Definition at line 2931 of file filesystem.c.

2932{
2933 struct file *This = impl_from_IFile(iface);
2934 FIXME("(%p)->(%p)\n", This, ppfolder);
2935 return E_NOTIMPL;
2936}

◆ file_get_Path()

static HRESULT WINAPI file_get_Path ( IFile *  iface,
BSTR *  path 
)
static

Definition at line 2862 of file filesystem.c.

2863{
2864 struct file *This = impl_from_IFile(iface);
2865
2866 TRACE("(%p)->(%p)\n", This, path);
2867
2868 if (!path)
2869 return E_POINTER;
2870
2871 *path = SysAllocString(This->path);
2872 if (!*path)
2873 return E_OUTOFMEMORY;
2874
2875 return S_OK;
2876}

◆ file_get_ShortName()

static HRESULT WINAPI file_get_ShortName ( IFile *  iface,
BSTR *  pbstrName 
)
static

Definition at line 2917 of file filesystem.c.

2918{
2919 struct file *This = impl_from_IFile(iface);
2920 FIXME("(%p)->(%p)\n", This, pbstrName);
2921 return E_NOTIMPL;
2922}

◆ file_get_ShortPath()

static HRESULT WINAPI file_get_ShortPath ( IFile *  iface,
BSTR *  pbstrPath 
)
static

Definition at line 2910 of file filesystem.c.

2911{
2912 struct file *This = impl_from_IFile(iface);
2913 FIXME("(%p)->(%p)\n", This, pbstrPath);
2914 return E_NOTIMPL;
2915}

◆ file_get_Size()

static HRESULT WINAPI file_get_Size ( IFile *  iface,
VARIANT *  pvarSize 
)
static

Definition at line 3015 of file filesystem.c.

3016{
3017 struct file *This = impl_from_IFile(iface);
3020 HANDLE f;
3021
3022 TRACE("(%p)->(%p)\n", This, pvarSize);
3023
3024 if(!pvarSize)
3025 return E_POINTER;
3026
3027 f = FindFirstFileW(This->path, &fd);
3028 if(f == INVALID_HANDLE_VALUE)
3029 return create_error(GetLastError());
3030 FindClose(f);
3031
3032 size.u.LowPart = fd.nFileSizeLow;
3033 size.u.HighPart = fd.nFileSizeHigh;
3034
3035 return variant_from_largeint(&size, pvarSize);
3036}
GLsizeiptr size
Definition: glext.h:5919
static int fd
Definition: io.c:51

◆ file_get_Type()

static HRESULT WINAPI file_get_Type ( IFile *  iface,
BSTR *  pbstrType 
)
static

Definition at line 3038 of file filesystem.c.

3039{
3040 struct file *This = impl_from_IFile(iface);
3041 FIXME("(%p)->(%p)\n", This, pbstrType);
3042 return E_NOTIMPL;
3043}

◆ file_GetIDsOfNames()

static HRESULT WINAPI file_GetIDsOfNames ( IFile *  iface,
REFIID  riid,
LPOLESTR *  rgszNames,
UINT  cNames,
LCID  lcid,
DISPID *  rgDispId 
)
static

Definition at line 2826 of file filesystem.c.

2828{
2830 HRESULT hr;
2831
2832 TRACE("%p, %s, %p, %u, %lx, %p.\n", iface, debugstr_guid(riid),
2833 rgszNames, cNames, lcid, rgDispId);
2834
2836 if(SUCCEEDED(hr)) {
2837 hr = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId);
2838 ITypeInfo_Release(typeinfo);
2839 }
2840 return hr;
2841}
@ IFile_tid

◆ file_GetTypeInfo()

static HRESULT WINAPI file_GetTypeInfo ( IFile *  iface,
UINT  iTInfo,
LCID  lcid,
ITypeInfo **  ppTInfo 
)
static

Definition at line 2818 of file filesystem.c.

2820{
2821 TRACE("%p, %u, %lx, %p.\n", iface, iTInfo, lcid, ppTInfo);
2822
2823 return get_typeinfo(IFile_tid, ppTInfo);
2824}

◆ file_GetTypeInfoCount()

static HRESULT WINAPI file_GetTypeInfoCount ( IFile *  iface,
UINT *  pctinfo 
)
static

Definition at line 2808 of file filesystem.c.

2809{
2810 struct file *This = impl_from_IFile(iface);
2811
2812 TRACE("(%p)->(%p)\n", This, pctinfo);
2813
2814 *pctinfo = 1;
2815 return S_OK;
2816}

◆ file_Invoke()

static HRESULT WINAPI file_Invoke ( IFile *  iface,
DISPID  dispIdMember,
REFIID  riid,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pDispParams,
VARIANT *  pVarResult,
EXCEPINFO *  pExcepInfo,
UINT *  puArgErr 
)
static

Definition at line 2843 of file filesystem.c.

2845{
2847 HRESULT hr;
2848
2849 TRACE("%p, %ld, %s, %lx, %d, %p, %p, %p, %p.\n", iface, dispIdMember, debugstr_guid(riid),
2850 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
2851
2853 if(SUCCEEDED(hr))
2854 {
2855 hr = ITypeInfo_Invoke(typeinfo, iface, dispIdMember, wFlags,
2856 pDispParams, pVarResult, pExcepInfo, puArgErr);
2857 ITypeInfo_Release(typeinfo);
2858 }
2859 return hr;
2860}

◆ file_Move()

static HRESULT WINAPI file_Move ( IFile *  iface,
BSTR  Destination 
)
static

Definition at line 3059 of file filesystem.c.

3060{
3061 struct file *This = impl_from_IFile(iface);
3062 FIXME("(%p)->(%s)\n", This, debugstr_w(Destination));
3063 return E_NOTIMPL;
3064}

◆ file_OpenAsTextStream()

static HRESULT WINAPI file_OpenAsTextStream ( IFile *  iface,
IOMode  mode,
Tristate  format,
ITextStream **  stream 
)
static

Definition at line 3066 of file filesystem.c.

3067{
3068 struct file *This = impl_from_IFile(iface);
3069
3070 TRACE("(%p)->(%d %d %p)\n", This, mode, format, stream);
3071
3073}
#define OPEN_EXISTING
Definition: compat.h:775
static HRESULT create_textstream(const WCHAR *filename, DWORD disposition, IOMode mode, Tristate format, ITextStream **ret)
Definition: filesystem.c:856

◆ file_put_Attributes()

static HRESULT WINAPI file_put_Attributes ( IFile *  iface,
FileAttribute  pfa 
)
static

Definition at line 2958 of file filesystem.c.

2959{
2960 struct file *This = impl_from_IFile(iface);
2961
2962 TRACE("(%p)->(%x)\n", This, pfa);
2963
2964 return SetFileAttributesW(This->path, pfa) ? S_OK : create_error(GetLastError());
2965}

◆ file_put_Name()

static HRESULT WINAPI file_put_Name ( IFile *  iface,
BSTR  pbstrName 
)
static

Definition at line 2903 of file filesystem.c.

2904{
2905 struct file *This = impl_from_IFile(iface);
2906 FIXME("(%p)->(%s)\n", This, debugstr_w(pbstrName));
2907 return E_NOTIMPL;
2908}

◆ file_QueryInterface()

static HRESULT WINAPI file_QueryInterface ( IFile *  iface,
REFIID  riid,
void **  obj 
)
static

Definition at line 2757 of file filesystem.c.

2758{
2759 struct file *This = impl_from_IFile(iface);
2760
2761 TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), obj);
2762
2763 *obj = NULL;
2764
2765 if (IsEqualIID(riid, &IID_IFile) ||
2768 {
2769 *obj = &This->IFile_iface;
2770 }
2772 {
2773 *obj = &This->classinfo.IProvideClassInfo_iface;
2774 }
2775 else
2776 return E_NOINTERFACE;
2777
2778 IUnknown_AddRef((IUnknown*)*obj);
2779 return S_OK;
2780}

◆ file_Release()

static ULONG WINAPI file_Release ( IFile *  iface)
static

Definition at line 2792 of file filesystem.c.

2793{
2794 struct file *file = impl_from_IFile(iface);
2796
2797 TRACE("%p, refcount %ld.\n", iface, ref);
2798
2799 if (!ref)
2800 {
2801 free(file->path);
2802 free(file);
2803 }
2804
2805 return ref;
2806}
WCHAR * path
Definition: filesystem.c:116

◆ filecoll_AddRef()

static ULONG WINAPI filecoll_AddRef ( IFileCollection *  iface)
static

Definition at line 2043 of file filesystem.c.

2044{
2047
2048 TRACE("%p, refcount %ld.\n", iface, ref);
2049
2050 return ref;
2051}
static struct filecollection * impl_from_IFileCollection(IFileCollection *iface)
Definition: filesystem.c:169

◆ filecoll_enumvariant_Clone()

static HRESULT WINAPI filecoll_enumvariant_Clone ( IEnumVARIANT *  iface,
IEnumVARIANT **  pclone 
)
static

Definition at line 1656 of file filesystem.c.

1657{
1658 struct enumvariant *This = impl_from_IEnumVARIANT(iface);
1659 TRACE("(%p)->(%p)\n", This, pclone);
1660 return create_filecoll_enum(This->data.u.filecoll.coll, (IUnknown**)pclone);
1661}
static HRESULT create_filecoll_enum(struct filecollection *, IUnknown **)
Definition: filesystem.c:1673

◆ filecoll_enumvariant_Next()

static HRESULT WINAPI filecoll_enumvariant_Next ( IEnumVARIANT *  iface,
ULONG  celt,
VARIANT *  var,
ULONG *  fetched 
)
static

Definition at line 1568 of file filesystem.c.

1569{
1570 struct enumvariant *This = impl_from_IEnumVARIANT(iface);
1571 HANDLE handle = This->data.u.filecoll.find;
1573 ULONG count = 0;
1574
1575 TRACE("%p, %ld, %p, %p.\n", iface, celt, var, fetched);
1576
1577 if (fetched)
1578 *fetched = 0;
1579
1580 if (!celt) return S_OK;
1581
1582 if (!handle)
1583 {
1584 handle = start_enumeration(This->data.u.filecoll.coll->path, &data, TRUE);
1585 if (!handle) return S_FALSE;
1586 This->data.u.filecoll.find = handle;
1587 }
1588 else if (!FindNextFileW(handle, &data))
1589 return S_FALSE;
1590
1591 do
1592 {
1593 if (is_file_data(&data))
1594 {
1595 IFile *file;
1596 HRESULT hr;
1597 BSTR str;
1598
1599 str = get_full_path(This->data.u.filecoll.coll->path, &data);
1600 hr = create_file(str, &file);
1602 if (FAILED(hr)) return hr;
1603
1606 if (++count >= celt) break;
1607 }
1608 } while (FindNextFileW(handle, &data));
1609
1610 if (fetched)
1611 *fetched = count;
1612
1613 return (count < celt) ? S_FALSE : S_OK;
1614}
static BOOL is_file_data(const WIN32_FIND_DATAW *data)
Definition: filesystem.c:211
static BSTR get_full_path(BSTR path, const WIN32_FIND_DATAW *data)
Definition: filesystem.c:216
static HANDLE start_enumeration(const WCHAR *path, WIN32_FIND_DATAW *data, BOOL file)
Definition: filesystem.c:1386
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define create_file(name, size)
Definition: asmcache.c:811
const WCHAR * str

◆ filecoll_enumvariant_Release()

static ULONG WINAPI filecoll_enumvariant_Release ( IEnumVARIANT *  iface)
static

Definition at line 1551 of file filesystem.c.

1552{
1553 struct enumvariant *This = impl_from_IEnumVARIANT(iface);
1555
1556 TRACE("%p, refcount %ld.\n", iface, ref);
1557
1558 if (!ref)
1559 {
1560 IFileCollection_Release(&This->data.u.filecoll.coll->IFileCollection_iface);
1561 FindClose(This->data.u.filecoll.find);
1562 free(This);
1563 }
1564
1565 return ref;
1566}

◆ filecoll_enumvariant_Reset()

static HRESULT WINAPI filecoll_enumvariant_Reset ( IEnumVARIANT *  iface)
static

Definition at line 1644 of file filesystem.c.

1645{
1646 struct enumvariant *This = impl_from_IEnumVARIANT(iface);
1647
1648 TRACE("(%p)\n", This);
1649
1650 FindClose(This->data.u.filecoll.find);
1651 This->data.u.filecoll.find = NULL;
1652
1653 return S_OK;
1654}

◆ filecoll_enumvariant_Skip()

static HRESULT WINAPI filecoll_enumvariant_Skip ( IEnumVARIANT *  iface,
ULONG  celt 
)
static

Definition at line 1616 of file filesystem.c.

1617{
1618 struct enumvariant *This = impl_from_IEnumVARIANT(iface);
1619 HANDLE handle = This->data.u.filecoll.find;
1621
1622 TRACE("%p, %lu.\n", iface, celt);
1623
1624 if (!celt) return S_OK;
1625
1626 if (!handle)
1627 {
1628 handle = start_enumeration(This->data.u.filecoll.coll->path, &data, TRUE);
1629 if (!handle) return S_FALSE;
1630 This->data.u.filecoll.find = handle;
1631 }
1632 else if (!FindNextFileW(handle, &data))
1633 return S_FALSE;
1634
1635 do
1636 {
1637 if (is_file_data(&data))
1638 --celt;
1639 } while (celt && FindNextFileW(handle, &data));
1640
1641 return celt ? S_FALSE : S_OK;
1642}

◆ filecoll_get__NewEnum()

static HRESULT WINAPI filecoll_get__NewEnum ( IFileCollection *  iface,
IUnknown **  ppenum 
)
static

Definition at line 2133 of file filesystem.c.

2134{
2136
2137 TRACE("(%p)->(%p)\n", This, ppenum);
2138
2139 if(!ppenum)
2140 return E_POINTER;
2141
2142 return create_filecoll_enum(This, ppenum);
2143}

◆ filecoll_get_Count()

static HRESULT WINAPI filecoll_get_Count ( IFileCollection *  iface,
LONG *  count 
)
static

Definition at line 2145 of file filesystem.c.

2146{
2150 HANDLE handle;
2151
2152 TRACE("(%p)->(%p)\n", This, count);
2153
2154 if(!count)
2155 return E_POINTER;
2156
2157 *count = 0;
2158
2159 wcscpy(pathW, This->path);
2160 wcscat(pathW, L"\\*");
2164
2165 do
2166 {
2167 if (is_file_data(&data))
2168 *count += 1;
2169 } while (FindNextFileW(handle, &data));
2171
2172 return S_OK;
2173}
static const WCHAR pathW[]
Definition: path.c:2368
static HRESULT HRESULT_FROM_WIN32(unsigned int x)
Definition: winerror.h:210

◆ filecoll_get_Item()

static HRESULT WINAPI filecoll_get_Item ( IFileCollection *  iface,
VARIANT  Key,
IFile **  file 
)
static

Definition at line 2126 of file filesystem.c.

2127{
2129 FIXME("(%p)->(%p)\n", This, file);
2130 return E_NOTIMPL;
2131}

◆ filecoll_GetIDsOfNames()

static HRESULT WINAPI filecoll_GetIDsOfNames ( IFileCollection *  iface,
REFIID  riid,
LPOLESTR *  rgszNames,
UINT  cNames,
LCID  lcid,
DISPID *  rgDispId 
)
static

Definition at line 2085 of file filesystem.c.

2088{
2090 HRESULT hr;
2091
2092 TRACE("%p, %s, %p, %u, %lx, %p.\n", iface, debugstr_guid(riid), rgszNames, cNames, lcid, rgDispId);
2093
2095 if(SUCCEEDED(hr))
2096 {
2097 hr = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId);
2098 ITypeInfo_Release(typeinfo);
2099 }
2100
2101 return hr;
2102}
@ IFileCollection_tid

◆ filecoll_GetTypeInfo()

static HRESULT WINAPI filecoll_GetTypeInfo ( IFileCollection *  iface,
UINT  iTInfo,
LCID  lcid,
ITypeInfo **  ppTInfo 
)
static

Definition at line 2077 of file filesystem.c.

2079{
2080 TRACE("%p, %u, %lx, %p.\n", iface, iTInfo, lcid, ppTInfo);
2081
2082 return get_typeinfo(IFileCollection_tid, ppTInfo);
2083}

◆ filecoll_GetTypeInfoCount()

static HRESULT WINAPI filecoll_GetTypeInfoCount ( IFileCollection *  iface,
UINT *  pctinfo 
)
static

Definition at line 2069 of file filesystem.c.

2070{
2072 TRACE("(%p)->(%p)\n", This, pctinfo);
2073 *pctinfo = 1;
2074 return S_OK;
2075}

◆ filecoll_Invoke()

static HRESULT WINAPI filecoll_Invoke ( IFileCollection *  iface,
DISPID  dispIdMember,
REFIID  riid,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pDispParams,
VARIANT *  pVarResult,
EXCEPINFO *  pExcepInfo,
UINT *  puArgErr 
)
static

Definition at line 2104 of file filesystem.c.

2108{
2110 HRESULT hr;
2111
2112 TRACE("%p, %ld, %s, %lx, %d, %p, %p, %p, %p.\n", iface, dispIdMember, debugstr_guid(riid),
2113 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
2114
2116 if(SUCCEEDED(hr))
2117 {
2118 hr = ITypeInfo_Invoke(typeinfo, iface, dispIdMember, wFlags,
2119 pDispParams, pVarResult, pExcepInfo, puArgErr);
2120 ITypeInfo_Release(typeinfo);
2121 }
2122
2123 return hr;
2124}

◆ filecoll_QueryInterface()

static HRESULT WINAPI filecoll_QueryInterface ( IFileCollection *  iface,
REFIID  riid,
void **  obj 
)
static

Definition at line 2018 of file filesystem.c.

2019{
2021
2022 TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), obj);
2023
2024 *obj = NULL;
2025
2026 if (IsEqualIID( riid, &IID_IFileCollection ) ||
2029 {
2030 *obj = &This->IFileCollection_iface;
2031 }
2033 {
2034 *obj = &This->classinfo.IProvideClassInfo_iface;
2035 }
2036 else
2037 return E_NOINTERFACE;
2038
2039 IUnknown_AddRef((IUnknown*)*obj);
2040 return S_OK;
2041}

◆ filecoll_Release()

static ULONG WINAPI filecoll_Release ( IFileCollection *  iface)
static

Definition at line 2053 of file filesystem.c.

2054{
2057
2058 TRACE("%p, refcount %ld.\n", iface, ref);
2059
2060 if (!ref)
2061 {
2064 }
2065
2066 return ref;
2067}

◆ filesys_AddRef()

static ULONG WINAPI filesys_AddRef ( IFileSystem3 *  iface)
static

Definition at line 3191 of file filesystem.c.

3192{
3193 TRACE("%p\n", iface);
3194
3195 return 2;
3196}

◆ filesys_BuildPath()

static HRESULT WINAPI filesys_BuildPath ( IFileSystem3 *  iface,
BSTR  Path,
BSTR  Name,
BSTR *  Result 
)
static

Definition at line 3268 of file filesystem.c.

3270{
3271 TRACE("%p %s %s %p\n", iface, debugstr_w(Path), debugstr_w(Name), Result);
3272
3273 if (!Result) return E_POINTER;
3274
3275 return build_path(Path, Name, Result);
3276}
static HRESULT build_path(BSTR Path, BSTR Name, BSTR *Result)
Definition: filesystem.c:228

◆ filesys_CopyFile()

static HRESULT WINAPI filesys_CopyFile ( IFileSystem3 *  iface,
BSTR  Source,
BSTR  Destination,
VARIANT_BOOL  OverWriteFiles 
)
static

Definition at line 3893 of file filesystem.c.

3895{
3896 TRACE("%p %s %s %d\n", iface, debugstr_w(Source), debugstr_w(Destination), OverWriteFiles);
3897
3898 if(!Source || !Destination)
3899 return E_POINTER;
3900
3902 SysStringLen(Destination), OverWriteFiles);
3903}
_In_ UINT _In_ UINT _In_ PNDIS_PACKET Source
Definition: ndis.h:3169

◆ filesys_CopyFolder()

static HRESULT WINAPI filesys_CopyFolder ( IFileSystem3 *  iface,
BSTR  Source,
BSTR  Destination,
VARIANT_BOOL  OverWriteFiles 
)
static

Definition at line 4018 of file filesystem.c.

4020{
4021 TRACE("%p %s %s %d\n", iface, debugstr_w(Source), debugstr_w(Destination), OverWriteFiles);
4022
4023 if(!Source || !Destination)
4024 return E_POINTER;
4025
4027 SysStringLen(Destination), OverWriteFiles);
4028}

◆ filesys_CreateFolder()

static HRESULT WINAPI filesys_CreateFolder ( IFileSystem3 *  iface,
BSTR  path,
IFolder **  folder 
)
static

Definition at line 4030 of file filesystem.c.

4032{
4033 BOOL ret;
4034
4035 TRACE("(%p)->(%s %p)\n", iface, debugstr_w(path), folder);
4036
4038 if (!ret)
4039 {
4040 *folder = NULL;
4043 }
4044
4045 return create_folder(path, folder);
4046}
static HRESULT create_folder(const WCHAR *, IFolder **)
Definition: filesystem.c:2715

◆ filesys_CreateTextFile()

static HRESULT WINAPI filesys_CreateTextFile ( IFileSystem3 *  iface,
BSTR  filename,
VARIANT_BOOL  overwrite,
VARIANT_BOOL  unicode,
ITextStream **  stream 
)
static

Definition at line 4048 of file filesystem.c.

4051{
4052 DWORD disposition;
4053
4054 TRACE("%p %s %d %d %p\n", iface, debugstr_w(filename), overwrite, unicode, stream);
4055
4056 disposition = overwrite == VARIANT_TRUE ? CREATE_ALWAYS : CREATE_NEW;
4057 return create_textstream(filename, disposition, ForWriting, unicode ? TristateTrue : TristateFalse, stream);
4058}

◆ filesys_DeleteFile()

static HRESULT WINAPI filesys_DeleteFile ( IFileSystem3 *  iface,
BSTR  FileSpec,
VARIANT_BOOL  Force 
)
static

Definition at line 3713 of file filesystem.c.

3715{
3716 TRACE("%p %s %d\n", iface, debugstr_w(FileSpec), Force);
3717
3718 if(!FileSpec)
3719 return E_POINTER;
3720
3721 return delete_file(FileSpec, SysStringLen(FileSpec), Force);
3722}

◆ filesys_DeleteFolder()

static HRESULT WINAPI filesys_DeleteFolder ( IFileSystem3 *  iface,
BSTR  FolderSpec,
VARIANT_BOOL  Force 
)
static

Definition at line 3788 of file filesystem.c.

3790{
3791 TRACE("%p %s %d\n", iface, debugstr_w(FolderSpec), Force);
3792
3793 if(!FolderSpec)
3794 return E_POINTER;
3795
3796 return delete_folder(FolderSpec, SysStringLen(FolderSpec), Force);
3797}

◆ filesys_DriveExists()

static HRESULT WINAPI filesys_DriveExists ( IFileSystem3 *  iface,
BSTR  DriveSpec,
VARIANT_BOOL *  pfExists 
)
static

Definition at line 3503 of file filesystem.c.

3505{
3506 UINT len;
3507 WCHAR driveletter;
3508 TRACE("%p %s %p\n", iface, debugstr_w(DriveSpec), pfExists);
3509
3510 if (!pfExists) return E_POINTER;
3511
3512 *pfExists = VARIANT_FALSE;
3513 len = SysStringLen(DriveSpec);
3514
3515 if (len >= 1) {
3516 driveletter = towupper(DriveSpec[0]);
3517 if (driveletter >= 'A' && driveletter <= 'Z'
3518 && (len < 2 || DriveSpec[1] == ':')
3519 && (len < 3 || DriveSpec[2] == '\\')) {
3520 const WCHAR root[] = {driveletter, ':', '\\', 0};
3521 UINT drivetype = GetDriveTypeW(root);
3522 *pfExists = drivetype != DRIVE_NO_ROOT_DIR && drivetype != DRIVE_UNKNOWN ? VARIANT_TRUE : VARIANT_FALSE;
3523 }
3524 }
3525
3526 return S_OK;
3527}
unsigned int UINT
Definition: sysinfo.c:13
#define towupper(c)
Definition: wctype.h:99
#define DRIVE_UNKNOWN
Definition: winbase.h:281
#define DRIVE_NO_ROOT_DIR
Definition: winbase.h:282

◆ filesys_FileExists()

static HRESULT WINAPI filesys_FileExists ( IFileSystem3 *  iface,
BSTR  path,
VARIANT_BOOL *  ret 
)
static

Definition at line 3529 of file filesystem.c.

3530{
3531 DWORD attrs;
3532 TRACE("%p %s %p\n", iface, debugstr_w(path), ret);
3533
3534 if (!ret) return E_POINTER;
3535
3536 attrs = GetFileAttributesW(path);
3537 *ret = attrs != INVALID_FILE_ATTRIBUTES && !(attrs & FILE_ATTRIBUTE_DIRECTORY) ? VARIANT_TRUE : VARIANT_FALSE;
3538 return S_OK;
3539}

◆ filesys_FolderExists()

static HRESULT WINAPI filesys_FolderExists ( IFileSystem3 *  iface,
BSTR  path,
VARIANT_BOOL *  ret 
)
static

Definition at line 3541 of file filesystem.c.

3542{
3543 DWORD attrs;
3544 TRACE("%p %s %p\n", iface, debugstr_w(path), ret);
3545
3546 if (!ret) return E_POINTER;
3547
3548 attrs = GetFileAttributesW(path);
3549 *ret = attrs != INVALID_FILE_ATTRIBUTES && (attrs & FILE_ATTRIBUTE_DIRECTORY) ? VARIANT_TRUE : VARIANT_FALSE;
3550
3551 return S_OK;
3552}

◆ filesys_get_Drives()

static HRESULT WINAPI filesys_get_Drives ( IFileSystem3 *  iface,
IDriveCollection **  ppdrives 
)
static

Definition at line 3262 of file filesystem.c.

3263{
3264 TRACE("%p %p\n", iface, ppdrives);
3265 return create_drivecoll(ppdrives);
3266}
static HRESULT create_drivecoll(IDriveCollection **drives)
Definition: filesystem.c:2360

◆ filesys_GetAbsolutePathName()

static HRESULT WINAPI filesys_GetAbsolutePathName ( IFileSystem3 *  iface,
BSTR  path,
BSTR *  pbstrResult 
)
static

Definition at line 3437 of file filesystem.c.

3438{
3439 WCHAR buf[MAX_PATH], ch;
3440 DWORD i, beg, len, exp_len;
3441 WIN32_FIND_DATAW fdata;
3442 HANDLE fh;
3443
3444 TRACE("%p, %s, %p.\n", iface, debugstr_w(path), pbstrResult);
3445
3446 if(!pbstrResult)
3447 return E_POINTER;
3448
3450 if(!len)
3451 return E_FAIL;
3452
3453 buf[0] = towupper(buf[0]);
3454 if(len>3 && buf[len-1] == '\\')
3455 buf[--len] = 0;
3456
3457 for(beg=3, i=3; i<=len; i++) {
3458 if(buf[i]!='\\' && buf[i])
3459 continue;
3460
3461 ch = buf[i];
3462 buf[i] = 0;
3463 fh = FindFirstFileW(buf, &fdata);
3464 if(fh == INVALID_HANDLE_VALUE)
3465 break;
3466
3467 exp_len = lstrlenW(fdata.cFileName);
3468 if(exp_len == i-beg)
3469 memcpy(buf+beg, fdata.cFileName, exp_len*sizeof(WCHAR));
3470 FindClose(fh);
3471 buf[i] = ch;
3472 beg = i+1;
3473 }
3474
3475 *pbstrResult = SysAllocString(buf);
3476 if(!*pbstrResult)
3477 return E_OUTOFMEMORY;
3478 return S_OK;
3479}
unsigned char ch[4][2]
Definition: console.c:118
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248

◆ filesys_GetBaseName()

static HRESULT WINAPI filesys_GetBaseName ( IFileSystem3 *  iface,
BSTR  Path,
BSTR *  pbstrResult 
)
static

Definition at line 3377 of file filesystem.c.

3379{
3380 int i, end;
3381
3382 TRACE("%p %s %p\n", iface, debugstr_w(Path), pbstrResult);
3383
3384 if(!pbstrResult)
3385 return E_POINTER;
3386
3387 if(!Path) {
3388 *pbstrResult = NULL;
3389 return S_OK;
3390 }
3391
3392 for(end=lstrlenW(Path)-1; end>=0; end--)
3393 if(Path[end]!='/' && Path[end]!='\\')
3394 break;
3395
3396 for(i=end; i>=0; i--) {
3397 if(Path[i]=='.' && Path[end+1]!='.')
3398 end = i-1;
3399 if(Path[i]=='/' || Path[i]=='\\')
3400 break;
3401 }
3402 i++;
3403
3404 if((i>end && Path[end+1]!='.') || (i==0 && end==1 && Path[1]==':')) {
3405 *pbstrResult = NULL;
3406 return S_OK;
3407 }
3408
3409 *pbstrResult = SysAllocStringLen(Path+i, end-i+1);
3410 if(!*pbstrResult)
3411 return E_OUTOFMEMORY;
3412 return S_OK;
3413}
GLuint GLuint end
Definition: gl.h:1545

◆ filesys_GetDrive()

static HRESULT WINAPI filesys_GetDrive ( IFileSystem3 *  iface,
BSTR  DriveSpec,
IDrive **  ppdrive 
)
static

Definition at line 3554 of file filesystem.c.

3556{
3557 UINT len;
3558 HRESULT hr;
3559 WCHAR driveletter;
3560 VARIANT_BOOL drive_exists;
3561
3562 TRACE("%p %s %p\n", iface, debugstr_w(DriveSpec), ppdrive);
3563
3564 if (!ppdrive)
3565 return E_POINTER;
3566
3567 *ppdrive = NULL;
3568
3569 /* DriveSpec may be one of: 'x', 'x:', 'x:\', '\\computer\share' */
3570 len = SysStringLen(DriveSpec);
3571 if (!len)
3572 return E_INVALIDARG;
3573 else if (len <= 3) {
3574 driveletter = towupper(DriveSpec[0]);
3575 if (driveletter < 'A' || driveletter > 'Z'
3576 || (len >= 2 && DriveSpec[1] != ':')
3577 || (len == 3 && DriveSpec[2] != '\\'))
3578 return E_INVALIDARG;
3579 hr = IFileSystem3_DriveExists(iface, DriveSpec, &drive_exists);
3580 if (FAILED(hr))
3581 return hr;
3582 if (drive_exists == VARIANT_FALSE)
3584 return create_drive(driveletter, ppdrive);
3585 } else {
3586 if (DriveSpec[0] != '\\' || DriveSpec[1] != '\\')
3587 return E_INVALIDARG;
3588 FIXME("%s not implemented yet\n", debugstr_w(DriveSpec));
3589 return E_NOTIMPL;
3590 }
3591}
short VARIANT_BOOL
Definition: compat.h:2290
#define CTL_E_DEVICEUNAVAILABLE
Definition: olectl.h:284

◆ filesys_GetDriveName()

static HRESULT WINAPI filesys_GetDriveName ( IFileSystem3 *  iface,
BSTR  path,
BSTR *  drive 
)
static

Definition at line 3278 of file filesystem.c.

3279{
3280 TRACE("(%p)->(%s %p)\n", iface, debugstr_w(path), drive);
3281
3282 if (!drive)
3283 return E_POINTER;
3284
3285 *drive = NULL;
3286
3287 if (path && lstrlenW(path) > 1 && path[1] == ':')
3289
3290 return S_OK;
3291}

◆ filesys_GetExtensionName()

static HRESULT WINAPI filesys_GetExtensionName ( IFileSystem3 *  iface,
BSTR  path,
BSTR *  ext 
)
static

Definition at line 3415 of file filesystem.c.

3417{
3418 INT len;
3419
3420 TRACE("%p %s %p\n", iface, debugstr_w(path), ext);
3421
3422 *ext = NULL;
3424 while (len) {
3425 if (path[len-1] == '.') {
3426 *ext = SysAllocString(&path[len]);
3427 if (!*ext)
3428 return E_OUTOFMEMORY;
3429 break;
3430 }
3431 len--;
3432 }
3433
3434 return S_OK;
3435}
static const WCHAR *const ext[]
Definition: module.c:53
int32_t INT
Definition: typedefs.h:58

◆ filesys_GetFile()

static HRESULT WINAPI filesys_GetFile ( IFileSystem3 *  iface,
BSTR  FilePath,
IFile **  ppfile 
)
static

Definition at line 3593 of file filesystem.c.

3595{
3596 TRACE("%p %s %p\n", iface, debugstr_w(FilePath), ppfile);
3597
3598 if(!ppfile)
3599 return E_POINTER;
3600 if(!FilePath)
3601 return E_INVALIDARG;
3602
3603 return create_file(FilePath, ppfile);
3604}
PCWSTR FilePath

◆ filesys_GetFileName()

static HRESULT WINAPI filesys_GetFileName ( IFileSystem3 *  iface,
BSTR  Path,
BSTR *  pbstrResult 
)
static

Definition at line 3342 of file filesystem.c.

3344{
3345 int i, end;
3346
3347 TRACE("%p %s %p\n", iface, debugstr_w(Path), pbstrResult);
3348
3349 if(!pbstrResult)
3350 return E_POINTER;
3351
3352 if(!Path) {
3353 *pbstrResult = NULL;
3354 return S_OK;
3355 }
3356
3357 for(end=lstrlenW(Path)-1; end>=0; end--)
3358 if(Path[end]!='/' && Path[end]!='\\')
3359 break;
3360
3361 for(i=end; i>=0; i--)
3362 if(Path[i]=='/' || Path[i]=='\\')
3363 break;
3364 i++;
3365
3366 if(i>end || (i==0 && end==1 && Path[1]==':')) {
3367 *pbstrResult = NULL;
3368 return S_OK;
3369 }
3370
3371 *pbstrResult = SysAllocStringLen(Path+i, end-i+1);
3372 if(!*pbstrResult)
3373 return E_OUTOFMEMORY;
3374 return S_OK;
3375}

◆ filesys_GetFileVersion()

static HRESULT WINAPI filesys_GetFileVersion ( IFileSystem3 *  iface,
BSTR  name,
BSTR *  version 
)
static

Definition at line 4100 of file filesystem.c.

4101{
4103 WCHAR ver[30];
4104 void *ptr;
4105 DWORD len;
4106 BOOL ret;
4107
4108 TRACE("%p %s %p\n", iface, debugstr_w(name), version);
4109
4111 if (!len)
4113
4114 ptr = malloc(len);
4115 if (!GetFileVersionInfoW(name, 0, len, ptr))
4116 {
4117 free(ptr);
4119 }
4120
4121 ret = VerQueryValueW(ptr, L"\\", (void **)&info, NULL);
4122 if (!ret)
4123 {
4124 free(ptr);
4126 }
4127
4128 get_versionstring(info, ver);
4129 free(ptr);
4130
4131 *version = SysAllocString(ver);
4132 TRACE("version=%s\n", debugstr_w(ver));
4133
4134 return S_OK;
4135}
static const WCHAR version[]
Definition: asmname.c:66
BOOL WINAPI GetFileVersionInfoW(LPCWSTR filename, DWORD handle, DWORD datasize, LPVOID data)
Definition: version.c:967
BOOL WINAPI VerQueryValueW(LPCVOID pBlock, LPCWSTR lpSubBlock, LPVOID *lplpBuffer, PUINT puLen)
Definition: version.c:1171
DWORD WINAPI GetFileVersionInfoSizeW(LPCWSTR filename, LPDWORD handle)
Definition: version.c:738
static void get_versionstring(VS_FIXEDFILEINFO *info, WCHAR *ver)
Definition: filesystem.c:4086

◆ filesys_GetFolder()

static HRESULT WINAPI filesys_GetFolder ( IFileSystem3 *  iface,
BSTR  FolderPath,
IFolder **  folder 
)
static

Definition at line 3606 of file filesystem.c.

3608{
3609 DWORD attrs;
3610
3611 TRACE("%p %s %p\n", iface, debugstr_w(FolderPath), folder);
3612
3613 if(!folder)
3614 return E_POINTER;
3615
3616 *folder = NULL;
3617 if(!FolderPath)
3618 return E_INVALIDARG;
3619
3620 attrs = GetFileAttributesW(FolderPath);
3621 if((attrs == INVALID_FILE_ATTRIBUTES) || !(attrs & FILE_ATTRIBUTE_DIRECTORY))
3622 return CTL_E_PATHNOTFOUND;
3623
3624 return create_folder(FolderPath, folder);
3625}

◆ filesys_GetIDsOfNames()

static HRESULT WINAPI filesys_GetIDsOfNames ( IFileSystem3 *  iface,
REFIID  riid,
LPOLESTR *  rgszNames,
UINT  cNames,
LCID  lcid,
DISPID *  rgDispId 
)
static

Definition at line 3221 of file filesystem.c.

3224{
3226 HRESULT hr;
3227
3228 TRACE("%p, %s, %p, %u, %lx, %p.\n", iface, debugstr_guid(riid), rgszNames, cNames, lcid, rgDispId);
3229
3231 if(SUCCEEDED(hr))
3232 {
3233 hr = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId);
3234 ITypeInfo_Release(typeinfo);
3235 }
3236
3237 return hr;
3238}
@ IFileSystem3_tid

◆ filesys_GetParentFolderName()

static HRESULT WINAPI filesys_GetParentFolderName ( IFileSystem3 *  iface,
BSTR  Path,
BSTR *  pbstrResult 
)
static

Definition at line 3320 of file filesystem.c.

3322{
3323 DWORD len;
3324
3325 TRACE("%p %s %p\n", iface, debugstr_w(Path), pbstrResult);
3326
3327 if(!pbstrResult)
3328 return E_POINTER;
3329
3331 if(!len) {
3332 *pbstrResult = NULL;
3333 return S_OK;
3334 }
3335
3336 *pbstrResult = SysAllocStringLen(Path, len);
3337 if(!*pbstrResult)
3338 return E_OUTOFMEMORY;
3339 return S_OK;
3340}

◆ filesys_GetSpecialFolder()

static HRESULT WINAPI filesys_GetSpecialFolder ( IFileSystem3 *  iface,
SpecialFolderConst  SpecialFolder,
IFolder **  folder 
)
static

Definition at line 3627 of file filesystem.c.

3630{
3632 DWORD ret;
3633
3634 TRACE("%p %d %p\n", iface, SpecialFolder, folder);
3635
3636 if (!folder)
3637 return E_POINTER;
3638
3639 *folder = NULL;
3640
3641 switch (SpecialFolder)
3642 {
3643 case WindowsFolder:
3645 break;
3646 case SystemFolder:
3648 break;
3649 case TemporaryFolder:
3651 /* we don't want trailing backslash */
3652 if (ret && pathW[ret-1] == '\\')
3653 pathW[ret-1] = 0;
3654 break;
3655 default:
3656 FIXME("unknown special folder type, %d\n", SpecialFolder);
3657 return E_INVALIDARG;
3658 }
3659
3660 if (!ret)
3662
3663 return create_folder(pathW, folder);
3664}
DWORD WINAPI GetTempPathW(IN DWORD count, OUT LPWSTR path)
Definition: path.c:2098
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2331
UINT WINAPI GetWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2370
@ SystemFolder
Definition: scrrun.idl:83
@ TemporaryFolder
Definition: scrrun.idl:84
@ WindowsFolder
Definition: scrrun.idl:82

◆ filesys_GetStandardStream()

static HRESULT WINAPI filesys_GetStandardStream ( IFileSystem3 *  iface,
StandardStreamTypes  StandardStreamType,
VARIANT_BOOL  Unicode,
ITextStream **  ppts 
)
static

Definition at line 4076 of file filesystem.c.

4080{
4081 FIXME("%p %d %d %p\n", iface, StandardStreamType, Unicode, ppts);
4082
4083 return E_NOTIMPL;
4084}

◆ filesys_GetTempName()

static HRESULT WINAPI filesys_GetTempName ( IFileSystem3 *  iface,
BSTR *  result 
)
static

Definition at line 3481 of file filesystem.c.

3482{
3483 DWORD random;
3484
3485 TRACE("%p, %p.\n", iface, result);
3486
3487 if (!result)
3488 return E_POINTER;
3489
3490 if (!(*result = SysAllocStringLen(NULL, 12)))
3491 return E_OUTOFMEMORY;
3492
3493 if(!RtlGenRandom(&random, sizeof(random)))
3494 {
3496 return E_FAIL;
3497 }
3498
3499 swprintf(*result, 13, L"rad%05X.tmp", random & 0xfffff);
3500 return S_OK;
3501}
#define swprintf
Definition: precomp.h:40
GLuint64EXT * result
Definition: glext.h:11304
#define RtlGenRandom
Definition: ntsecapi.h:691
#define random
Definition: rosdhcp.h:94

◆ filesys_GetTypeInfo()

static HRESULT WINAPI filesys_GetTypeInfo ( IFileSystem3 *  iface,
UINT  iTInfo,
LCID  lcid,
ITypeInfo **  ppTInfo 
)
static

Definition at line 3213 of file filesystem.c.

3215{
3216 TRACE("%p, %u, %lx, %p.\n", iface, iTInfo, lcid, ppTInfo);
3217
3218 return get_typeinfo(IFileSystem3_tid, ppTInfo);
3219}

◆ filesys_GetTypeInfoCount()

static HRESULT WINAPI filesys_GetTypeInfoCount ( IFileSystem3 *  iface,
UINT *  pctinfo 
)
static

Definition at line 3205 of file filesystem.c.

3206{
3207 TRACE("(%p)->(%p)\n", iface, pctinfo);
3208
3209 *pctinfo = 1;
3210 return S_OK;
3211}

◆ filesys_Invoke()

static HRESULT WINAPI filesys_Invoke ( IFileSystem3 *  iface,
DISPID  dispIdMember,
REFIID  riid,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pDispParams,
VARIANT *  pVarResult,
EXCEPINFO *  pExcepInfo,
UINT *  puArgErr 
)
static

Definition at line 3240 of file filesystem.c.

3244{
3246 HRESULT hr;
3247
3248 TRACE("%p, %ld, %s, %lx, %d, %p, %p, %p, %p.\n", iface, dispIdMember, debugstr_guid(riid),
3249 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
3250
3252 if(SUCCEEDED(hr))
3253 {
3254 hr = ITypeInfo_Invoke(typeinfo, iface, dispIdMember, wFlags,
3255 pDispParams, pVarResult, pExcepInfo, puArgErr);
3256 ITypeInfo_Release(typeinfo);
3257 }
3258
3259 return hr;
3260}

◆ filesys_MoveFile()

static HRESULT WINAPI filesys_MoveFile ( IFileSystem3 *  iface,
BSTR  source,
BSTR  destination 
)
static

Definition at line 3799 of file filesystem.c.

3800{
3801 TRACE("%p %s %s\n", iface, debugstr_w(source), debugstr_w(destination));
3802
3803 if(!source || !destination)
3804 return E_INVALIDARG;
3805
3806 return MoveFileW(source, destination) ? S_OK : create_error(GetLastError());
3807}
BOOL WINAPI MoveFileW(IN LPCWSTR lpExistingFileName, IN LPCWSTR lpNewFileName)
Definition: move.c:1058

◆ filesys_MoveFolder()

static HRESULT WINAPI filesys_MoveFolder ( IFileSystem3 *  iface,
BSTR  Source,
BSTR  Destination 
)
static

Definition at line 3809 of file filesystem.c.

3811{
3812 FIXME("%p %s %s\n", iface, debugstr_w(Source), debugstr_w(Destination));
3813
3814 return E_NOTIMPL;
3815}

◆ filesys_OpenTextFile()

static HRESULT WINAPI filesys_OpenTextFile ( IFileSystem3 *  iface,
BSTR  filename,
IOMode  mode,
VARIANT_BOOL  create,
Tristate  format,
ITextStream **  stream 
)
static

Definition at line 4060 of file filesystem.c.

4063{
4064 DWORD disposition;
4065
4066 TRACE("(%p)->(%s %d %d %d %p)\n", iface, debugstr_w(filename), mode, create, format, stream);
4067
4068 if(mode == ForWriting) {
4069 disposition = create == VARIANT_TRUE ? CREATE_ALWAYS : TRUNCATE_EXISTING;
4070 } else {
4071 disposition = create == VARIANT_TRUE ? OPEN_ALWAYS : OPEN_EXISTING;
4072 }
4073 return create_textstream(filename, disposition, mode, format, stream);
4074}
#define OPEN_ALWAYS
Definition: disk.h:70
static const struct access_res create[16]
Definition: package.c:7546

◆ filesys_QueryInterface()

static HRESULT WINAPI filesys_QueryInterface ( IFileSystem3 *  iface,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 3151 of file filesystem.c.

3152{
3153 struct filesystem *This = impl_from_IFileSystem3(iface);
3154
3155 TRACE("%p %s %p\n", iface, debugstr_guid(riid), ppvObject);
3156
3157 if ( IsEqualGUID( riid, &IID_IFileSystem3 ) ||
3158 IsEqualGUID( riid, &IID_IFileSystem ) ||
3161 {
3162 *ppvObject = &This->IFileSystem3_iface;
3163 }
3165 {
3166 *ppvObject = &This->classinfo.IProvideClassInfo_iface;
3167 }
3168 else if ( IsEqualGUID( riid, &IID_IDispatchEx ))
3169 {
3170 TRACE("Interface IDispatchEx not supported - returning NULL\n");
3171 *ppvObject = NULL;
3172 return E_NOINTERFACE;
3173 }
3174 else if ( IsEqualGUID( riid, &IID_IObjectWithSite ))
3175 {
3176 TRACE("Interface IObjectWithSite not supported - returning NULL\n");
3177 *ppvObject = NULL;
3178 return E_NOINTERFACE;
3179 }
3180 else
3181 {
3182 FIXME("Unsupported interface %s\n", debugstr_guid(riid));
3183 return E_NOINTERFACE;
3184 }
3185
3186 IUnknown_AddRef((IUnknown*)*ppvObject);
3187
3188 return S_OK;
3189}
static struct filesystem * impl_from_IFileSystem3(IFileSystem3 *iface)
Definition: filesystem.c:139
const IID IID_IObjectWithSite
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147

◆ filesys_Release()

static ULONG WINAPI filesys_Release ( IFileSystem3 *  iface)
static

Definition at line 3198 of file filesystem.c.

3199{
3200 TRACE("%p\n", iface);
3201
3202 return 1;
3203}

◆ FileSystem_CreateInstance()

HRESULT WINAPI FileSystem_CreateInstance ( IClassFactory *  iface,
IUnknown *  outer,
REFIID  riid,
void **  ppv 
)

Definition at line 4177 of file filesystem.c.

4178{
4179 TRACE("(%p %s %p)\n", outer, debugstr_guid(riid), ppv);
4180
4183 return IFileSystem3_QueryInterface(&filesystem.IFileSystem3_iface, riid, ppv);
4184}
static const struct IFileSystem3Vtbl filesys_vtbl
Definition: filesystem.c:4137
REFIID LPVOID * ppv
Definition: atlbase.h:39
static IUnknown * outer
Definition: compobj.c:82
IFileSystem3 IFileSystem3_iface
Definition: filesystem.c:44
struct provideclassinfo classinfo
Definition: filesystem.c:43

◆ find_next_drive()

static HRESULT find_next_drive ( struct enumvariant *  penum)
static

Definition at line 1709 of file filesystem.c.

1710{
1711 int i = penum->data.u.drivecoll.cur == -1 ? 0 : penum->data.u.drivecoll.cur + 1;
1712
1713 for (; i < 32; i++)
1714 if (penum->data.u.drivecoll.coll->drives & (1 << i))
1715 {
1716 penum->data.u.drivecoll.cur = i;
1717 return S_OK;
1718 }
1719
1720 return S_FALSE;
1721}
struct enumdata data
Definition: filesystem.c:94

Referenced by drivecoll_enumvariant_Next(), and drivecoll_enumvariant_Skip().

◆ folder_AddRef()

static ULONG WINAPI folder_AddRef ( IFolder *  iface)
static

Definition at line 2407 of file filesystem.c.

2408{
2409 struct folder *folder = impl_from_IFolder(iface);
2411
2412 TRACE("%p, refcount %ld.\n", iface, ref);
2413
2414 return ref;
2415}
static struct folder * impl_from_IFolder(IFolder *iface)
Definition: filesystem.c:149
LONG ref
Definition: filesystem.c:107

◆ folder_Copy()

static HRESULT WINAPI folder_Copy ( IFolder *  iface,
BSTR  dest,
VARIANT_BOOL  overwrite 
)
static

Definition at line 2612 of file filesystem.c.

2613{
2614 struct folder *This = impl_from_IFolder(iface);
2615 FIXME("(%p)->(%s %x): stub\n", This, debugstr_w(dest), overwrite);
2616 return E_NOTIMPL;
2617}
static char * dest
Definition: rtl.c:149

◆ folder_CreateTextFile()

static HRESULT WINAPI folder_CreateTextFile ( IFolder *  iface,
BSTR  filename,
VARIANT_BOOL  overwrite,
VARIANT_BOOL  unicode,
ITextStream **  stream 
)
static

Definition at line 2664 of file filesystem.c.

2666{
2667 DWORD disposition;
2668 BSTR path;
2669 HRESULT hres;
2670
2671 struct folder *This = impl_from_IFolder(iface);
2672
2673 TRACE("%p %s %d %d %p\n", iface, debugstr_w(filename), overwrite, unicode, stream);
2674
2675 hres = build_path(This->path, filename, &path);
2676 if (FAILED(hres)) return hres;
2677
2678 disposition = overwrite == VARIANT_TRUE ? CREATE_ALWAYS : CREATE_NEW;
2679 hres = create_textstream(path, disposition, ForWriting, unicode ? TristateTrue : TristateFalse, stream);
2681 return hres;
2682}
HRESULT hres
Definition: protocol.c:432

◆ folder_Delete()

static HRESULT WINAPI folder_Delete ( IFolder *  iface,
VARIANT_BOOL  force 
)
static

Definition at line 2605 of file filesystem.c.

2606{
2607 struct folder *This = impl_from_IFolder(iface);
2608 FIXME("(%p)->(%x): stub\n", This, force);
2609 return E_NOTIMPL;
2610}

◆ folder_get_Attributes()

static HRESULT WINAPI folder_get_Attributes ( IFolder *  iface,
FileAttribute *  attr 
)
static

Definition at line 2563 of file filesystem.c.

2564{
2565 struct folder *This = impl_from_IFolder(iface);
2566 FIXME("(%p)->(%p): stub\n", This, attr);
2567 return E_NOTIMPL;
2568}
Definition: cookie.c:202

◆ folder_get_DateCreated()

static HRESULT WINAPI folder_get_DateCreated ( IFolder *  iface,
DATE *  date 
)
static

Definition at line 2577 of file filesystem.c.

2578{
2579 struct folder *This = impl_from_IFolder(iface);
2580 FIXME("(%p)->(%p): stub\n", This, date);
2581 return E_NOTIMPL;
2582}

◆ folder_get_DateLastAccessed()

static HRESULT WINAPI folder_get_DateLastAccessed ( IFolder *  iface,
DATE *  date 
)
static

Definition at line 2591 of file filesystem.c.

2592{
2593 struct folder *This = impl_from_IFolder(iface);
2594 FIXME("(%p)->(%p): stub\n", This, date);
2595 return E_NOTIMPL;
2596}

◆ folder_get_DateLastModified()

static HRESULT WINAPI folder_get_DateLastModified ( IFolder *  iface,
DATE *  date 
)
static

Definition at line 2584 of file filesystem.c.

2585{
2586 struct folder *This = impl_from_IFolder(iface);
2587 FIXME("(%p)->(%p): stub\n", This, date);
2588 return E_NOTIMPL;
2589}

◆ folder_get_Drive()

static HRESULT WINAPI folder_get_Drive ( IFolder *  iface,
IDrive **  drive 
)
static

Definition at line 2549 of file filesystem.c.

2550{
2551 struct folder *This = impl_from_IFolder(iface);
2552 FIXME("(%p)->(%p): stub\n", This, drive);
2553 return E_NOTIMPL;
2554}

◆ folder_get_Files()

static HRESULT WINAPI folder_get_Files ( IFolder *  iface,
IFileCollection **  files 
)
static

Definition at line 2652 of file filesystem.c.

2653{
2654 struct folder *This = impl_from_IFolder(iface);
2655
2656 TRACE("(%p)->(%p)\n", This, files);
2657
2658 if(!files)
2659 return E_POINTER;
2660
2661 return create_filecoll(This->path, files);
2662}
static HRESULT create_filecoll(BSTR path, IFileCollection **files)
Definition: filesystem.c:2188

◆ folder_get_IsRootFolder()

static HRESULT WINAPI folder_get_IsRootFolder ( IFolder *  iface,
VARIANT_BOOL *  isroot 
)
static

Definition at line 2626 of file filesystem.c.

2627{
2628 struct folder *This = impl_from_IFolder(iface);
2629 FIXME("(%p)->(%p): stub\n", This, isroot);
2630 return E_NOTIMPL;
2631}

◆ folder_get_Name()

static HRESULT WINAPI folder_get_Name ( IFolder *  iface,
BSTR *  name 
)
static

Definition at line 2503 of file filesystem.c.

2504{
2505 struct folder *This = impl_from_IFolder(iface);
2506 WCHAR *ptr;
2507
2508 TRACE("(%p)->(%p)\n", This, name);
2509
2510 if(!name)
2511 return E_POINTER;
2512
2513 *name = NULL;
2514
2515 ptr = wcsrchr(This->path, '\\');
2516 if (ptr)
2517 {
2518 *name = SysAllocString(ptr+1);
2519 TRACE("%s\n", debugstr_w(*name));
2520 if (!*name) return E_OUTOFMEMORY;
2521 }
2522 else
2523 return E_FAIL;
2524
2525 return S_OK;
2526}

◆ folder_get_ParentFolder()

static HRESULT WINAPI folder_get_ParentFolder ( IFolder *  iface,
IFolder **  parent 
)
static

Definition at line 2556 of file filesystem.c.

2557{
2558 struct folder *This = impl_from_IFolder(iface);
2559 FIXME("(%p)->(%p): stub\n", This, parent);
2560 return E_NOTIMPL;
2561}
r parent
Definition: btrfs.c:3010

◆ folder_get_Path()

static HRESULT WINAPI folder_get_Path ( IFolder *  iface,
BSTR *  path 
)
static

Definition at line 2490 of file filesystem.c.

2491{
2492 struct folder *This = impl_from_IFolder(iface);
2493
2494 TRACE("(%p)->(%p)\n", This, path);
2495
2496 if(!path)
2497 return E_POINTER;
2498
2499 *path = SysAllocString(This->path);
2500 return *path ? S_OK : E_OUTOFMEMORY;
2501}

◆ folder_get_ShortName()

static HRESULT WINAPI folder_get_ShortName ( IFolder *  iface,
BSTR *  name 
)
static

Definition at line 2542 of file filesystem.c.

2543{
2544 struct folder *This = impl_from_IFolder(iface);
2545 FIXME("(%p)->(%p): stub\n", This, name);
2546 return E_NOTIMPL;
2547}

◆ folder_get_ShortPath()

static HRESULT WINAPI folder_get_ShortPath ( IFolder *  iface,
BSTR *  path 
)
static

Definition at line 2535 of file filesystem.c.

2536{
2537 struct folder *This = impl_from_IFolder(iface);
2538 FIXME("(%p)->(%p): stub\n", This, path);
2539 return E_NOTIMPL;
2540}

◆ folder_get_Size()

static HRESULT WINAPI folder_get_Size ( IFolder *  iface,
VARIANT *  size 
)
static

Definition at line 2633 of file filesystem.c.

2634{
2635 struct folder *This = impl_from_IFolder(iface);
2636 FIXME("(%p)->(%p): stub\n", This, size);
2637 return E_NOTIMPL;
2638}

◆ folder_get_SubFolders()

static HRESULT WINAPI folder_get_SubFolders ( IFolder *  iface,
IFolderCollection **  folders 
)
static

Definition at line 2640 of file filesystem.c.

2641{
2642 struct folder *This = impl_from_IFolder(iface);
2643
2644 TRACE("(%p)->(%p)\n", This, folders);
2645
2646 if(!folders)
2647 return E_POINTER;
2648
2649 return create_foldercoll(This->path, folders);
2650}
static HRESULT create_foldercoll(BSTR path, IFolderCollection **folders)
Definition: filesystem.c:1994

◆ folder_get_Type()

static HRESULT WINAPI folder_get_Type ( IFolder *  iface,
BSTR *  type 
)
static

Definition at line 2598 of file filesystem.c.

2599{
2600 struct folder *This = impl_from_IFolder(iface);
2601 FIXME("(%p)->(%p): stub\n", This, type);
2602 return E_NOTIMPL;
2603}

◆ folder_GetIDsOfNames()

static HRESULT WINAPI folder_GetIDsOfNames ( IFolder *  iface,
REFIID  riid,
LPOLESTR *  rgszNames,
UINT  cNames,
LCID  lcid,
DISPID *  rgDispId 
)
static

Definition at line 2449 of file filesystem.c.

2452{
2454 HRESULT hr;
2455
2456 TRACE("%p, %s, %p, %u, %lx, %p.\n", iface, debugstr_guid(riid), rgszNames, cNames, lcid, rgDispId);
2457
2459 if(SUCCEEDED(hr))
2460 {
2461 hr = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId);
2462 ITypeInfo_Release(typeinfo);
2463 }
2464
2465 return hr;
2466}
@ IFolder_tid

◆ folder_GetTypeInfo()

static HRESULT WINAPI folder_GetTypeInfo ( IFolder *  iface,
UINT  iTInfo,
LCID  lcid,
ITypeInfo **  ppTInfo 
)
static

Definition at line 2441 of file filesystem.c.

2443{
2444 TRACE("%p, %u, %lx, %p.\n", iface, iTInfo, lcid, ppTInfo);
2445
2446 return get_typeinfo(IFolder_tid, ppTInfo);
2447}

◆ folder_GetTypeInfoCount()

static HRESULT WINAPI folder_GetTypeInfoCount ( IFolder *  iface,
UINT *  pctinfo 
)
static

Definition at line 2433 of file filesystem.c.

2434{
2435 struct folder *This = impl_from_IFolder(iface);
2436 TRACE("(%p)->(%p)\n", This, pctinfo);
2437 *pctinfo = 1;
2438 return S_OK;
2439}

◆ folder_Invoke()

static HRESULT WINAPI folder_Invoke ( IFolder *  iface,
DISPID  dispIdMember,
REFIID  riid,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pDispParams,
VARIANT *  pVarResult,
EXCEPINFO *  pExcepInfo,
UINT *  puArgErr 
)
static

Definition at line 2468 of file filesystem.c.

2472{
2474 HRESULT hr;
2475
2476 TRACE("%p, %ld, %s, %lx, %d, %p, %p, %p, %p.\n", iface, dispIdMember, debugstr_guid(riid),
2477 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
2478
2480 if(SUCCEEDED(hr))
2481 {
2482 hr = ITypeInfo_Invoke(typeinfo, iface, dispIdMember, wFlags,
2483 pDispParams, pVarResult, pExcepInfo, puArgErr);
2484 ITypeInfo_Release(typeinfo);
2485 }
2486
2487 return hr;
2488}

◆ folder_Move()

static HRESULT WINAPI folder_Move ( IFolder *  iface,
BSTR  dest 
)
static

Definition at line 2619 of file filesystem.c.

2620{
2621 struct folder *This = impl_from_IFolder(iface);
2622 FIXME("(%p)->(%s): stub\n", This, debugstr_w(dest));
2623 return E_NOTIMPL;
2624}

◆ folder_put_Attributes()

static HRESULT WINAPI folder_put_Attributes ( IFolder *  iface,
FileAttribute  attr 
)
static

Definition at line 2570 of file filesystem.c.

2571{
2572 struct folder *This = impl_from_IFolder(iface);
2573 FIXME("(%p)->(0x%x): stub\n", This, attr);
2574 return E_NOTIMPL;
2575}

◆ folder_put_Name()

static HRESULT WINAPI folder_put_Name ( IFolder *  iface,
BSTR  name 
)
static

Definition at line 2528 of file filesystem.c.

2529{
2530 struct folder *This = impl_from_IFolder(iface);
2531 FIXME("(%p)->(%s): stub\n", This, debugstr_w(name));
2532 return E_NOTIMPL;
2533}

◆ folder_QueryInterface()

static HRESULT WINAPI folder_QueryInterface ( IFolder *  iface,
REFIID  riid,
void **  obj 
)
static

Definition at line 2382 of file filesystem.c.

2383{
2384 struct folder *This = impl_from_IFolder(iface);
2385
2386 TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), obj);
2387
2388 *obj = NULL;
2389
2390 if (IsEqualIID( riid, &IID_IFolder ) ||
2393 {
2394 *obj = &This->IFolder_iface;
2395 }
2397 {
2398 *obj = &This->classinfo.IProvideClassInfo_iface;
2399 }
2400 else
2401 return E_NOINTERFACE;
2402
2403 IUnknown_AddRef((IUnknown*)*obj);
2404 return S_OK;
2405}

◆ folder_Release()

static ULONG WINAPI folder_Release ( IFolder *  iface)
static

Definition at line 2417 of file filesystem.c.

2418{
2419 struct folder *folder = impl_from_IFolder(iface);
2421
2422 TRACE("%p, refcount %ld.\n", iface, ref);
2423
2424 if (!ref)
2425 {
2427 free(folder);
2428 }
2429
2430 return ref;
2431}
BSTR path
Definition: filesystem.c:108

◆ foldercoll_Add()

static HRESULT WINAPI foldercoll_Add ( IFolderCollection *  iface,
BSTR  name,
IFolder **  folder 
)
static

Definition at line 1924 of file filesystem.c.

1925{
1927 FIXME("(%p)->(%s %p): stub\n", This, debugstr_w(name), folder);
1928 return E_NOTIMPL;
1929}
static struct foldercollection * impl_from_IFolderCollection(IFolderCollection *iface)
Definition: filesystem.c:164

◆ foldercoll_AddRef()

static ULONG WINAPI foldercoll_AddRef ( IFolderCollection *  iface)
static

Definition at line 1841 of file filesystem.c.

1842{
1845
1846 TRACE("%p, refcount %ld.\n", iface, ref);
1847
1848 return ref;
1849}

◆ foldercoll_enumvariant_Clone()

static HRESULT WINAPI foldercoll_enumvariant_Clone ( IEnumVARIANT *  iface,
IEnumVARIANT **  pclone 
)
static

Definition at line 1514 of file filesystem.c.

1515{
1516 struct enumvariant *This = impl_from_IEnumVARIANT(iface);
1517 TRACE("(%p)->(%p)\n", This, pclone);
1518 return create_foldercoll_enum(This->data.u.foldercoll.coll, (IUnknown**)pclone);
1519}
static HRESULT create_foldercoll_enum(struct foldercollection *, IUnknown **)
Definition: filesystem.c:1531

◆ foldercoll_enumvariant_Next()

static HRESULT WINAPI foldercoll_enumvariant_Next ( IEnumVARIANT *  iface,
ULONG  celt,
VARIANT *  var,
ULONG *  fetched 
)
static

Definition at line 1414 of file filesystem.c.

1415{
1416 struct enumvariant *This = impl_from_IEnumVARIANT(iface);
1417 HANDLE handle = This->data.u.foldercoll.find;
1419 ULONG count = 0;
1420
1421 TRACE("%p, %lu, %p, %p.\n", iface, celt, var, fetched);
1422
1423 if (fetched)
1424 *fetched = 0;
1425
1426 if (!celt) return S_OK;
1427
1428 if (!handle)
1429 {
1430 handle = start_enumeration(This->data.u.foldercoll.coll->path, &data, FALSE);
1431 if (!handle) return S_FALSE;
1432
1433 This->data.u.foldercoll.find = handle;
1434 }
1435 else
1436 {
1437 if (!FindNextFileW(handle, &data))
1438 return S_FALSE;
1439 }
1440
1441 do
1442 {
1443 if (is_dir_data(&data))
1444 {
1445 IFolder *folder;
1446 HRESULT hr;
1447 BSTR str;
1448
1449 str = get_full_path(This->data.u.foldercoll.coll->path, &data);
1452 if (FAILED(hr)) return hr;
1453
1456 count++;
1457
1458 if (count >= celt) break;
1459 }
1460 } while (FindNextFileW(handle, &data));
1461
1462 if (fetched)
1463 *fetched = count;
1464
1465 return (count < celt) ? S_FALSE : S_OK;
1466}
static BOOL is_dir_data(const WIN32_FIND_DATAW *data)
Definition: filesystem.c:204

◆ foldercoll_enumvariant_Release()

static ULONG WINAPI foldercoll_enumvariant_Release ( IEnumVARIANT *  iface)
static

Definition at line 1369 of file filesystem.c.

1370{
1371 struct enumvariant *This = impl_from_IEnumVARIANT(iface);
1373
1374 TRACE("%p, refcount %ld.\n", iface, ref);
1375
1376 if (!ref)
1377 {
1378 IFolderCollection_Release(&This->data.u.foldercoll.coll->IFolderCollection_iface);
1379 FindClose(This->data.u.foldercoll.find);
1380 free(This);
1381 }
1382
1383 return ref;
1384}

◆ foldercoll_enumvariant_Reset()

static HRESULT WINAPI foldercoll_enumvariant_Reset ( IEnumVARIANT *  iface)
static

Definition at line 1502 of file filesystem.c.

1503{
1504 struct enumvariant *This = impl_from_IEnumVARIANT(iface);
1505
1506 TRACE("(%p)\n", This);
1507
1508 FindClose(This->data.u.foldercoll.find);
1509 This->data.u.foldercoll.find = NULL;
1510
1511 return S_OK;
1512}

◆ foldercoll_enumvariant_Skip()

static HRESULT WINAPI foldercoll_enumvariant_Skip ( IEnumVARIANT *  iface,
ULONG  celt 
)
static

Definition at line 1468 of file filesystem.c.

1469{
1470 struct enumvariant *This = impl_from_IEnumVARIANT(iface);
1471 HANDLE handle = This->data.u.foldercoll.find;
1473
1474 TRACE("%p, %lu.\n", iface, celt);
1475
1476 if (!celt) return S_OK;
1477
1478 if (!handle)
1479 {
1480 handle = start_enumeration(This->data.u.foldercoll.coll->path, &data, FALSE);
1481 if (!handle) return S_FALSE;
1482
1483 This->data.u.foldercoll.find = handle;
1484 }
1485 else
1486 {
1487 if (!FindNextFileW(handle, &data))
1488 return S_FALSE;
1489 }
1490
1491 do
1492 {
1493 if (is_dir_data(&data))
1494 --celt;
1495
1496 if (!celt) break;
1497 } while (FindNextFileW(handle, &data));
1498
1499 return celt ? S_FALSE : S_OK;
1500}

◆ foldercoll_get__NewEnum()

static HRESULT WINAPI foldercoll_get__NewEnum ( IFolderCollection *  iface,
IUnknown **  newenum 
)
static

Definition at line 1938 of file filesystem.c.

1939{
1941
1942 TRACE("(%p)->(%p)\n", This, newenum);
1943
1944 if(!newenum)
1945 return E_POINTER;
1946
1947 return create_foldercoll_enum(This, newenum);
1948}

◆ foldercoll_get_Count()

static HRESULT WINAPI foldercoll_get_Count ( IFolderCollection *  iface,
LONG *  count 
)
static

Definition at line 1950 of file filesystem.c.

1951{
1955 HANDLE handle;
1956
1957 TRACE("(%p)->(%p)\n", This, count);
1958
1959 if(!count)
1960 return E_POINTER;
1961
1962 *count = 0;
1963
1964 wcscpy(pathW, This->path);
1965 wcscat(pathW, L"\\*");
1969
1970 do
1971 {
1972 if (is_dir_data(&data))
1973 *count += 1;
1974 } while (FindNextFileW(handle, &data));
1976
1977 return S_OK;
1978}

◆ foldercoll_get_Item()

static HRESULT WINAPI foldercoll_get_Item ( IFolderCollection *  iface,
VARIANT  key,
IFolder **  folder 
)
static

Definition at line 1931 of file filesystem.c.

1932{
1934 FIXME("(%p)->(%p): stub\n", This, folder);
1935 return E_NOTIMPL;
1936}

◆ foldercoll_GetIDsOfNames()

static HRESULT WINAPI foldercoll_GetIDsOfNames ( IFolderCollection *  iface,
REFIID  riid,
LPOLESTR *  rgszNames,
UINT  cNames,
LCID  lcid,
DISPID *  rgDispId 
)
static

Definition at line 1883 of file filesystem.c.

1886{
1888 HRESULT hr;
1889
1890 TRACE("%p, %s, %p, %u, %lx, %p.\n", iface, debugstr_guid(riid), rgszNames, cNames, lcid, rgDispId);
1891
1893 if(SUCCEEDED(hr))
1894 {
1895 hr = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId);
1896 ITypeInfo_Release(typeinfo);
1897 }
1898
1899 return hr;
1900}
@ IFolderCollection_tid

◆ foldercoll_GetTypeInfo()

static HRESULT WINAPI foldercoll_GetTypeInfo ( IFolderCollection *  iface,
UINT  iTInfo,
LCID  lcid,
ITypeInfo **  ppTInfo 
)
static

Definition at line 1875 of file filesystem.c.

1877{
1878 TRACE("%p, %u, %lx, %p.\n", iface, iTInfo, lcid, ppTInfo);
1879
1880 return get_typeinfo(IFolderCollection_tid, ppTInfo);
1881}

◆ foldercoll_GetTypeInfoCount()

static HRESULT WINAPI foldercoll_GetTypeInfoCount ( IFolderCollection *  iface,
UINT *  pctinfo 
)
static

Definition at line 1867 of file filesystem.c.

1868{
1870 TRACE("(%p)->(%p)\n", This, pctinfo);
1871 *pctinfo = 1;
1872 return S_OK;
1873}

◆ foldercoll_Invoke()

static HRESULT WINAPI foldercoll_Invoke ( IFolderCollection *  iface,
DISPID  dispIdMember,
REFIID  riid,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pDispParams,
VARIANT *  pVarResult,
EXCEPINFO *  pExcepInfo,
UINT *  puArgErr 
)
static

Definition at line 1902 of file filesystem.c.

1906{
1908 HRESULT hr;
1909
1910 TRACE("%p, %ld, %s, %lx, %d, %p, %p, %p, %p.\n", iface, dispIdMember, debugstr_guid(riid),
1911 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
1912
1914 if(SUCCEEDED(hr))
1915 {
1916 hr = ITypeInfo_Invoke(typeinfo, iface, dispIdMember, wFlags,
1917 pDispParams, pVarResult, pExcepInfo, puArgErr);
1918 ITypeInfo_Release(typeinfo);
1919 }
1920
1921 return hr;
1922}

◆ foldercoll_QueryInterface()

static HRESULT WINAPI foldercoll_QueryInterface ( IFolderCollection *  iface,
REFIID  riid,
void **  obj 
)
static

Definition at line 1816 of file filesystem.c.

1817{
1819
1820 TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), obj);
1821
1822 *obj = NULL;
1823
1824 if (IsEqualIID( riid, &IID_IFolderCollection ) ||
1827 {
1828 *obj = &This->IFolderCollection_iface;
1829 }
1831 {
1832 *obj = &This->classinfo.IProvideClassInfo_iface;
1833 }
1834 else
1835 return E_NOINTERFACE;
1836
1837 IUnknown_AddRef((IUnknown*)*obj);
1838 return S_OK;
1839}

◆ foldercoll_Release()

static ULONG WINAPI foldercoll_Release ( IFolderCollection *  iface)
static

Definition at line 1851 of file filesystem.c.

1852{
1855
1856 TRACE("%p, refcount %ld.\n", iface, ref);
1857
1858 if (!ref)
1859 {
1862 }
1863
1864 return ref;
1865}

◆ get_date_from_filetime()

static HRESULT get_date_from_filetime ( const FILETIME *  ft,
DATE *  date 
)
static

Definition at line 2967 of file filesystem.c.

2968{
2969 FILETIME ftlocal;
2970 SYSTEMTIME st;
2971
2972 if (!date)
2973 return E_POINTER;
2974
2975 FileTimeToLocalFileTime(ft, &ftlocal);
2976 FileTimeToSystemTime(&ftlocal, &st);
2978
2979 return S_OK;
2980}
BOOL WINAPI FileTimeToSystemTime(IN CONST FILETIME *lpFileTime, OUT LPSYSTEMTIME lpSystemTime)
Definition: time.c:183
BOOL WINAPI FileTimeToLocalFileTime(IN CONST FILETIME *lpFileTime, OUT LPFILETIME lpLocalFileTime)
Definition: time.c:216
INT WINAPI SystemTimeToVariantTime(LPSYSTEMTIME lpSt, double *pDateOut)
Definition: variant.c:1263

Referenced by file_get_DateCreated(), and file_get_DateLastModified().

◆ get_full_path()

static BSTR get_full_path ( BSTR  path,
const WIN32_FIND_DATAW *  data 
)
static

Definition at line 216 of file filesystem.c.

217{
218 int len = SysStringLen(path);
219 WCHAR buffW[MAX_PATH];
220
221 lstrcpyW(buffW, path);
222 if (path[len-1] != '\\') wcscat(buffW, L"\\");
223 lstrcatW(buffW, data->cFileName);
224
225 return SysAllocString(buffW);
226}

Referenced by filecoll_enumvariant_Next(), and foldercoll_enumvariant_Next().

◆ get_parent_folder_name()

static DWORD get_parent_folder_name ( const WCHAR *  path,
DWORD  len 
)
inlinestatic

Definition at line 3293 of file filesystem.c.

3294{
3295 int i;
3296
3297 if(!path)
3298 return 0;
3299
3300 for(i=len-1; i>=0; i--)
3301 if(path[i]!='/' && path[i]!='\\')
3302 break;
3303
3304 for(; i>=0; i--)
3305 if(path[i]=='/' || path[i]=='\\')
3306 break;
3307
3308 for(; i>=0; i--)
3309 if(path[i]!='/' && path[i]!='\\')
3310 break;
3311
3312 if(i < 0)
3313 return 0;
3314
3315 if(path[i]==':' && i==1)
3316 i++;
3317 return i+1;
3318}

Referenced by copy_file(), copy_folder(), delete_file(), delete_folder(), and filesys_GetParentFolderName().

◆ get_versionstring()

static void get_versionstring ( VS_FIXEDFILEINFO *  info,
WCHAR *  ver 
)
static

Definition at line 4086 of file filesystem.c.

4087{
4089 WORD a, b, c, d;
4090
4091 version = (((DWORDLONG)info->dwFileVersionMS) << 32) + info->dwFileVersionLS;
4092 a = (WORD)( version >> 48);
4093 b = (WORD)((version >> 32) & 0xffff);
4094 c = (WORD)((version >> 16) & 0xffff);
4095 d = (WORD)( version & 0xffff);
4096
4097 swprintf(ver, 30, L"%d.%d.%d.%d", a, b, c, d);
4098}
unsigned short WORD
Definition: ntddk_ex.h:93
const GLubyte * c
Definition: glext.h:8905
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
unsigned long long DWORDLONG
Definition: intsafe.h:93
#define d
Definition: ke_i.h:81
#define a
Definition: ke_i.h:78
#define c
Definition: ke_i.h:80
#define b
Definition: ke_i.h:79

Referenced by filesys_GetFileVersion().

◆ impl_from_IDrive()

◆ impl_from_IDriveCollection()

static struct drivecollection * impl_from_IDriveCollection ( IDriveCollection *  iface)
inlinestatic

◆ impl_from_IEnumVARIANT()

◆ impl_from_IFile()

◆ impl_from_IFileCollection()

static struct filecollection * impl_from_IFileCollection ( IFileCollection *  iface)
inlinestatic

◆ impl_from_IFileSystem3()

static struct filesystem * impl_from_IFileSystem3 ( IFileSystem3 *  iface)
inlinestatic

Definition at line 139 of file filesystem.c.

140{
141 return CONTAINING_RECORD(iface, struct filesystem, IFileSystem3_iface);
142}

Referenced by filesys_QueryInterface().

◆ impl_from_IFolder()

◆ impl_from_IFolderCollection()

static struct foldercollection * impl_from_IFolderCollection ( IFolderCollection *  iface)
inlinestatic

◆ impl_from_ITextStream()

◆ is_dir_data()

static BOOL is_dir_data ( const WIN32_FIND_DATAW *  data)
inlinestatic

Definition at line 204 of file filesystem.c.

205{
206 return (data->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) &&
207 wcscmp(data->cFileName, L"..") &&
208 wcscmp(data->cFileName, L".");
209}
_ACRTIMP int __cdecl wcscmp(const wchar_t *, const wchar_t *)
Definition: wcs.c:1977

Referenced by foldercoll_enumvariant_Next(), foldercoll_enumvariant_Skip(), foldercoll_get_Count(), and start_enumeration().

◆ is_file_data()

static BOOL is_file_data ( const WIN32_FIND_DATAW *  data)
inlinestatic

Definition at line 211 of file filesystem.c.

212{
213 return !(data->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY);
214}

Referenced by filecoll_enumvariant_Next(), filecoll_enumvariant_Skip(), filecoll_get_Count(), and start_enumeration().

◆ pipestream_get_AtEndOfLine()

static HRESULT WINAPI pipestream_get_AtEndOfLine ( ITextStream *  iface,
VARIANT_BOOL *  eol 
)
static

Definition at line 767 of file filesystem.c.

768{
769 FIXME("%p, %p.\n", iface, eol);
770
771 return E_NOTIMPL;
772}

◆ pipestream_get_AtEndOfStream()

static HRESULT WINAPI pipestream_get_AtEndOfStream ( ITextStream *  iface,
VARIANT_BOOL *  eos 
)
static

Definition at line 760 of file filesystem.c.

761{
762 FIXME("%p, %p.\n", iface, eos);
763
764 return E_NOTIMPL;
765}

◆ pipestream_get_Column()

static HRESULT WINAPI pipestream_get_Column ( ITextStream *  iface,
LONG *  column 
)
static

Definition at line 753 of file filesystem.c.

754{
755 FIXME("%p, %p.\n", iface, column);
756
757 return E_NOTIMPL;
758}

◆ pipestream_get_Line()

static HRESULT WINAPI pipestream_get_Line ( ITextStream *  iface,
LONG *  line 
)
static

Definition at line 746 of file filesystem.c.

747{
748 FIXME("%p, %p.\n", iface, line);
749
750 return E_NOTIMPL;
751}
Definition: parser.c:49

◆ pipestream_Read()

static HRESULT WINAPI pipestream_Read ( ITextStream *  iface,
LONG  len,
BSTR *  text 
)
static

Definition at line 774 of file filesystem.c.

775{
776 FIXME("%p, %ld, %p.\n", iface, len, text);
777
778 return E_NOTIMPL;
779}
const WCHAR * text
Definition: package.c:1826

◆ pipestream_ReadAll()

static HRESULT WINAPI pipestream_ReadAll ( ITextStream *  iface,
BSTR *  text 
)
static

Definition at line 788 of file filesystem.c.

789{
790 FIXME("%p, %p.\n", iface, text);
791
792 return E_NOTIMPL;
793}

◆ pipestream_ReadLine()

static HRESULT WINAPI pipestream_ReadLine ( ITextStream *  iface,
BSTR *  text 
)
static

Definition at line 781 of file filesystem.c.

782{
783 FIXME("%p, %p.\n", iface, text);
784
785 return E_NOTIMPL;
786}

◆ pipestream_Skip()

static HRESULT WINAPI pipestream_Skip ( ITextStream *  iface,
LONG  count 
)
static

Definition at line 818 of file filesystem.c.

819{
820 FIXME("%p, %ld.\n", iface, count);
821
822 return E_NOTIMPL;
823}

◆ pipestream_SkipLine()

static HRESULT WINAPI pipestream_SkipLine ( ITextStream *  iface)
static

Definition at line 825 of file filesystem.c.

826{
827 FIXME("%p.\n", iface);
828
829 return E_NOTIMPL;
830}

◆ pipestream_Write()

static HRESULT WINAPI pipestream_Write ( ITextStream *  iface,
BSTR  text 
)
static

Definition at line 795 of file filesystem.c.

796{
797 struct textstream *stream = impl_from_ITextStream(iface);
798
799 TRACE("%p, %s.\n", iface, debugstr_w(text));
800
802}
static HRESULT textstream_write(struct textstream *stream, BSTR text)
Definition: filesystem.c:615
static struct textstream * impl_from_ITextStream(ITextStream *iface)
Definition: filesystem.c:159

◆ pipestream_WriteBlankLines()

static HRESULT WINAPI pipestream_WriteBlankLines ( ITextStream *  iface,
LONG  lines 
)
static

Definition at line 811 of file filesystem.c.

812{
813 FIXME("%p, %ld.\n", iface, lines);
814
815 return E_NOTIMPL;
816}
eMaj lines
Definition: tritemp.h:206

◆ pipestream_WriteLine()

static HRESULT WINAPI pipestream_WriteLine ( ITextStream *  iface,
BSTR  text 
)
static

Definition at line 804 of file filesystem.c.

805{
806 FIXME("%p, %s.\n", iface, debugstr_w(text));
807
808 return E_NOTIMPL;
809}

◆ read_from_buffer()

static BOOL read_from_buffer ( struct textstream *  stream,
size_t  len,
BSTR *  ret,
size_t  skip 
)
static

Definition at line 499 of file filesystem.c.

500{
501 assert(len + skip <= stream->read_buf_size);
502
503 if (!(*ret = SysAllocStringLen(stream->read_buf, len))) return FALSE;
504
505 len += skip;
506 stream->read_buf_size -= len;
507 if (stream->read_buf_size)
508 memmove(stream->read_buf, stream->read_buf + len, stream->read_buf_size * sizeof(WCHAR));
509 else
510 free(stream->read_buf);
511 return TRUE;
512}
#define skip(...)
Definition: atltest.h:64
#define assert(_expr)
Definition: assert.h:32
#define memmove(s1, s2, n)
Definition: mkisofs.h:881

Referenced by textstream_Read(), textstream_ReadAll(), and textstream_ReadLine().

◆ read_more_data()

static HRESULT read_more_data ( struct textstream *  stream)
static

Definition at line 482 of file filesystem.c.

483{
484 char buf[256];
485 DWORD read;
486
487 if (stream->eof) return S_OK;
488
489 if (!ReadFile(stream->file, buf, sizeof(buf), &read, NULL))
490 {
491 ITextStream_Release(&stream->ITextStream_iface);
492 return create_error(GetLastError());
493 }
494
495 stream->eof = read != sizeof(buf);
497}

Referenced by textstream_Read(), textstream_ReadAll(), and textstream_ReadLine().

◆ start_enumeration()

static HANDLE start_enumeration ( const WCHAR *  path,
WIN32_FIND_DATAW *  data,
BOOL  file 
)
static

Definition at line 1386 of file filesystem.c.

1387{
1389 int len;
1390 HANDLE handle;
1391
1393 len = lstrlenW(pathW);
1394 if (len && pathW[len-1] != '\\') wcscat(pathW, L"\\");
1395 wcscat(pathW, L"*");
1397 if (handle == INVALID_HANDLE_VALUE) return 0;
1398
1399 /* find first dir/file */
1400 while (1)
1401 {
1403 break;
1404
1405 if (!FindNextFileW(handle, data))
1406 {
1408 return 0;
1409 }
1410 }
1411 return handle;
1412}

Referenced by filecoll_enumvariant_Next(), filecoll_enumvariant_Skip(), foldercoll_enumvariant_Next(), and foldercoll_enumvariant_Skip().

◆ textstream_AddRef()

static ULONG WINAPI textstream_AddRef ( ITextStream *  iface)
static

Definition at line 312 of file filesystem.c.

313{
314 struct textstream *stream = impl_from_ITextStream(iface);
316
317 TRACE("%p, refcount %ld.\n", iface, ref);
318
319 return ref;
320}

◆ textstream_check_iomode()

static BOOL textstream_check_iomode ( struct textstream *  This,
enum iotype  type 
)
static

Definition at line 281 of file filesystem.c.

282{
283 if (type == IORead)
284 return This->mode == ForWriting || This->mode == ForAppending;
285 else
286 return This->mode == ForReading;
287}

Referenced by textstream_get_AtEndOfStream(), textstream_Read(), textstream_ReadAll(), textstream_ReadLine(), and textstream_write().

◆ textstream_Close()

static HRESULT WINAPI textstream_Close ( ITextStream *  iface)
static

Definition at line 707 of file filesystem.c.

708{
709 struct textstream *stream = impl_from_ITextStream(iface);
710 HRESULT hr = S_OK;
711
712 TRACE("%p.\n", iface);
713
714 if (!CloseHandle(stream->file))
715 hr = S_FALSE;
716
717 stream->file = NULL;
718
719 return hr;
720}
#define CloseHandle
Definition: compat.h:739

◆ textstream_get_AtEndOfLine()

static HRESULT WINAPI textstream_get_AtEndOfLine ( ITextStream *  iface,
VARIANT_BOOL *  eol 
)
static

Definition at line 428 of file filesystem.c.

429{
430 struct textstream *This = impl_from_ITextStream(iface);
431 FIXME("(%p)->(%p): stub\n", This, eol);
432 return E_NOTIMPL;
433}

◆ textstream_get_AtEndOfStream()

static HRESULT WINAPI textstream_get_AtEndOfStream ( ITextStream *  iface,
VARIANT_BOOL *  eos 
)
static

Definition at line 410 of file filesystem.c.

411{
412 struct textstream *This = impl_from_ITextStream(iface);
413
414 TRACE("(%p)->(%p)\n", This, eos);
415
416 if (!eos)
417 return E_POINTER;
418
420 *eos = VARIANT_TRUE;
421 return CTL_E_BADFILEMODE;
422 }
423
424 *eos = (This->eof && !This->read_buf_size) ? VARIANT_TRUE : VARIANT_FALSE;
425 return S_OK;
426}
static BOOL textstream_check_iomode(struct textstream *This, enum iotype type)
Definition: filesystem.c:281
#define CTL_E_BADFILEMODE
Definition: olectl.h:275

◆ textstream_get_Column()

static HRESULT WINAPI textstream_get_Column ( ITextStream *  iface,
LONG *  column 
)
static

Definition at line 403 of file filesystem.c.

404{
405 struct textstream *This = impl_from_ITextStream(iface);
406 FIXME("(%p)->(%p): stub\n", This, column);
407 return E_NOTIMPL;
408}

◆ textstream_get_Line()

static HRESULT WINAPI textstream_get_Line ( ITextStream *  iface,
LONG *  line 
)
static

Definition at line 396 of file filesystem.c.

397{
398 struct textstream *This = impl_from_ITextStream(iface);
399 FIXME("(%p)->(%p): stub\n", This, line);
400 return E_NOTIMPL;
401}

◆ textstream_GetIDsOfNames()

static HRESULT WINAPI textstream_GetIDsOfNames ( ITextStream *  iface,
REFIID  riid,
LPOLESTR *  rgszNames,
UINT  cNames,
LCID  lcid,
DISPID *  rgDispId 
)
static

Definition at line 355 of file filesystem.c.

358{
360 HRESULT hr;
361
362 TRACE("%p, %s, %p, %u, %lx, %p.\n", iface, debugstr_guid(riid), rgszNames, cNames, lcid, rgDispId);
363
365 if(SUCCEEDED(hr))
366 {
367 hr = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId);
368 ITypeInfo_Release(typeinfo);
369 }
370
371 return hr;
372}
@ ITextStream_tid

◆ textstream_GetTypeInfo()

static HRESULT WINAPI textstream_GetTypeInfo ( ITextStream *  iface,
UINT  iTInfo,
LCID  lcid,
ITypeInfo **  ppTInfo 
)
static

Definition at line 347 of file filesystem.c.

349{
350 TRACE("%p, %u, %lx, %p.\n", iface, iTInfo, lcid, ppTInfo);
351
352 return get_typeinfo(ITextStream_tid, ppTInfo);
353}

◆ textstream_GetTypeInfoCount()

static HRESULT WINAPI textstream_GetTypeInfoCount ( ITextStream *  iface,
UINT *  pctinfo 
)
static

Definition at line 339 of file filesystem.c.

340{
341 struct textstream *This = impl_from_ITextStream(iface);
342 TRACE("(%p)->(%p)\n", This, pctinfo);
343 *pctinfo = 1;
344 return S_OK;
345}

◆ textstream_Invoke()

static HRESULT WINAPI textstream_Invoke ( ITextStream *  iface,
DISPID  dispIdMember,
REFIID  riid,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pDispParams,
VARIANT *  pVarResult,
EXCEPINFO *  pExcepInfo,
UINT *  puArgErr 
)
static

Definition at line 374 of file filesystem.c.

378{
380 HRESULT hr;
381
382 TRACE("%p, %ld, %s, %lx, %d, %p, %p, %p, %p.\n", iface, dispIdMember, debugstr_guid(riid),
383 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
384
386 if(SUCCEEDED(hr))
387 {
388 hr = ITypeInfo_Invoke(typeinfo, iface, dispIdMember, wFlags,
389 pDispParams, pVarResult, pExcepInfo, puArgErr);
390 ITypeInfo_Release(typeinfo);
391 }
392
393 return hr;
394}

◆ textstream_QueryInterface()

static HRESULT WINAPI textstream_QueryInterface ( ITextStream *  iface,
REFIID  riid,
void **  obj 
)
static

Definition at line 289 of file filesystem.c.

290{
291 struct textstream *This = impl_from_ITextStream(iface);
292
293 TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), obj);
294
295 if (IsEqualIID(riid, &IID_ITextStream) ||
298 {
299 *obj = &This->ITextStream_iface;
300 }
302 {
303 *obj = &This->classinfo.IProvideClassInfo_iface;
304 }
305 else
306 return E_NOINTERFACE;
307
308 IUnknown_AddRef((IUnknown*)*obj);
309 return S_OK;
310}

◆ textstream_Read()

static HRESULT WINAPI textstream_Read ( ITextStream *  iface,
LONG  len,
BSTR *  text 
)
static

Definition at line 514 of file filesystem.c.

515{
516 struct textstream *This = impl_from_ITextStream(iface);
517 HRESULT hr = S_OK;
518
519 TRACE("%p, %ld, %p.\n", iface, len, text);
520
521 if (!text)
522 return E_POINTER;
523
524 *text = NULL;
525 if (len <= 0)
526 return len == 0 ? S_OK : E_INVALIDARG;
527
529 return CTL_E_BADFILEMODE;
530
531 while (!This->eof && len > This->read_buf_size)
532 {
534 return hr;
535 }
536
537 if (This->eof && !This->read_buf_size)
538 return CTL_E_ENDOFFILE;
539
540 if (len > This->read_buf_size)
541 {
542 len = This->read_buf_size;
543 hr = S_FALSE;
544 }
545
546 return read_from_buffer(This, len, text, 0) ? hr : E_OUTOFMEMORY;
547}
static HRESULT read_more_data(struct textstream *stream)
Definition: filesystem.c:482
static BOOL read_from_buffer(struct textstream *stream, size_t len, BSTR *ret, size_t skip)
Definition: filesystem.c:499

◆ textstream_ReadAll()

static HRESULT WINAPI textstream_ReadAll ( ITextStream *  iface,
BSTR *  text 
)
static

Definition at line 589 of file filesystem.c.

590{
591 struct textstream *This = impl_from_ITextStream(iface);
592 HRESULT hr;
593
594 TRACE("(%p)->(%p)\n", This, text);
595
596 if (!text)
597 return E_POINTER;
598
599 *text = NULL;
601 return CTL_E_BADFILEMODE;
602
603 while (!This->eof)
604 {
606 return hr;
607 }
608
609 if (This->eof && !This->read_buf_size)
610 return CTL_E_ENDOFFILE;
611
612 return read_from_buffer(This, This->read_buf_size, text, 0) ? S_FALSE : E_OUTOFMEMORY;
613}

◆ textstream_ReadLine()

static HRESULT WINAPI textstream_ReadLine ( ITextStream *  iface,
BSTR *  text 
)
static

Definition at line 549 of file filesystem.c.

550{
551 struct textstream *This = impl_from_ITextStream(iface);
552 unsigned int skip = 0;
553 const WCHAR *nl;
554 HRESULT hr = S_OK;
555
556 TRACE("(%p)->(%p)\n", This, text);
557
558 if (!text)
559 return E_POINTER;
560
561 *text = NULL;
563 return CTL_E_BADFILEMODE;
564
565 while (!(nl = wmemchr(This->read_buf, '\n', This->read_buf_size)) && !This->eof)
566 {
568 return hr;
569 }
570
571 if (This->eof && !This->read_buf_size)
572 return CTL_E_ENDOFFILE;
573
574 if (!nl)
575 {
576 nl = This->read_buf + This->read_buf_size;
577 hr = S_FALSE;
578 }
579 else if (nl > This->read_buf && nl[-1] == '\r')
580 {
581 nl--;
582 skip = 2;
583 }
584 else skip = 1;
585
586 return read_from_buffer(This, nl - This->read_buf, text, skip) ? hr : E_OUTOFMEMORY;
587}
static wchar_t * wmemchr(const wchar_t *s, wchar_t c, size_t n)
Definition: wchar.h:48

◆ textstream_Release()

static ULONG WINAPI textstream_Release ( ITextStream *  iface)
static

Definition at line 322 of file filesystem.c.

323{
324 struct textstream *stream = impl_from_ITextStream(iface);
326
327 TRACE("%p, refcount %ld.\n", iface, ref);
328
329 if (!ref)
330 {
331 if (stream->read_buf_size) free(stream->read_buf);
332 CloseHandle(stream->file);
333 free(stream);
334 }
335
336 return ref;
337}

◆ textstream_Skip()

static HRESULT WINAPI textstream_Skip ( ITextStream *  iface,
LONG  count 
)
static

Definition at line 693 of file filesystem.c.

694{
695 FIXME("%p, %ld stub\n", iface, count);
696
697 return E_NOTIMPL;
698}

◆ textstream_SkipLine()

static HRESULT WINAPI textstream_SkipLine ( ITextStream *  iface)
static

Definition at line 700 of file filesystem.c.

701{
702 struct textstream *This = impl_from_ITextStream(iface);
703 FIXME("(%p): stub\n", This);
704 return E_NOTIMPL;
705}

◆ textstream_Write()

static HRESULT WINAPI textstream_Write ( ITextStream *  iface,
BSTR  text 
)
static

Definition at line 643 of file filesystem.c.

644{
645 struct textstream *stream = impl_from_ITextStream(iface);
646
647 TRACE("%p, %s.\n", iface, debugstr_w(text));
648
650}

◆ textstream_write()

static HRESULT textstream_write ( struct textstream *  stream,
BSTR  text 
)
static

Definition at line 615 of file filesystem.c.

616{
617 DWORD written = 0;
618 BOOL ret;
619
621 return CTL_E_BADFILEMODE;
622
623 if (stream->unicode) {
624 ret = WriteFile(stream->file, text, SysStringByteLen(text), &written, NULL);
625 return (ret && written == SysStringByteLen(text)) ? S_OK : create_error(GetLastError());
626 } else {
628 char *buffA;
629 HRESULT hr;
630
631 buffA = malloc(len);
632 if (!buffA)
633 return E_OUTOFMEMORY;
634
636 ret = WriteFile(stream->file, buffA, len, &written, NULL);
637 hr = (ret && written == len) ? S_OK : create_error(GetLastError());
638 free(buffA);
639 return hr;
640 }
641}
#define WideCharToMultiByte
Definition: compat.h:111
UINT WINAPI SysStringByteLen(BSTR str)
Definition: oleaut.c:217

Referenced by pipestream_Write(), textstream_Write(), and textstream_WriteLine().

◆ textstream_WriteBlankLines()

static HRESULT WINAPI textstream_WriteBlankLines ( ITextStream *  iface,
LONG  lines 
)
static

Definition at line 686 of file filesystem.c.

687{
688 FIXME("%p, %ld stub\n", iface, lines);
689
690 return E_NOTIMPL;
691}

◆ textstream_writecrlf()

static HRESULT textstream_writecrlf ( struct textstream *  stream)
static

Definition at line 652 of file filesystem.c.

653{
654 static const WCHAR crlfW[] = {'\r','\n'};
655 static const char crlfA[] = {'\r','\n'};
656 DWORD written = 0, len;
657 const void *ptr;
658 BOOL ret;
659
660 if (stream->unicode) {
661 ptr = crlfW;
662 len = sizeof(crlfW);
663 }
664 else {
665 ptr = crlfA;
666 len = sizeof(crlfA);
667 }
668
669 ret = WriteFile(stream->file, ptr, len, &written, NULL);
670 return (ret && written == len) ? S_OK : create_error(GetLastError());
671}
static const WCHAR crlfW[]
Definition: httprequest.c:46

Referenced by textstream_WriteLine().

◆ textstream_WriteLine()

static HRESULT WINAPI textstream_WriteLine ( ITextStream *  iface,
BSTR  text 
)
static

Definition at line 673 of file filesystem.c.

674{
675 struct textstream *stream = impl_from_ITextStream(iface);
676 HRESULT hr;
677
678 TRACE("%p, %s.\n", iface, debugstr_w(text));
679
681 if (SUCCEEDED(hr))
683 return hr;
684}
static HRESULT textstream_writecrlf(struct textstream *stream)
Definition: filesystem.c:652

◆ variant_from_largeint()

static HRESULT variant_from_largeint ( const ULARGE_INTEGER *  src,
VARIANT *  v 
)
static

Definition at line 1159 of file filesystem.c.

1160{
1161 HRESULT hr = S_OK;
1162
1163 if (src->u.HighPart || src->u.LowPart > INT_MAX)
1164 {
1165 V_VT(v) = VT_R8;
1166 hr = VarR8FromUI8(src->QuadPart, &V_R8(v));
1167 }
1168 else
1169 {
1170 V_VT(v) = VT_I4;
1171 V_I4(v) = src->u.LowPart;
1172 }
1173
1174 return hr;
1175}
@ VT_R8
Definition: compat.h:2300
@ VT_I4
Definition: compat.h:2298
#define INT_MAX
Definition: limits.h:26
HRESULT WINAPI VarR8FromUI8(ULONG64 ullIn, double *pDblOut)
Definition: vartype.c:3317
#define V_I4(A)
Definition: oleauto.h:247
#define V_R8(A)
Definition: oleauto.h:262

Referenced by drive_get_AvailableSpace(), drive_get_FreeSpace(), drive_get_TotalSize(), and file_get_Size().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( scrrun  )

Variable Documentation

◆ drivecollectionvtbl

const IDriveCollectionVtbl drivecollectionvtbl
static
Initial value:
= {
}
static HRESULT WINAPI drivecoll_QueryInterface(IDriveCollection *iface, REFIID riid, void **obj)
Definition: filesystem.c:2211
static HRESULT WINAPI drivecoll_GetTypeInfo(IDriveCollection *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: filesystem.c:2267
static HRESULT WINAPI drivecoll_Invoke(IDriveCollection *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: filesystem.c:2294
static HRESULT WINAPI drivecoll_get_Count(IDriveCollection *iface, LONG *count)
Definition: filesystem.c:2335
static HRESULT WINAPI drivecoll_GetTypeInfoCount(IDriveCollection *iface, UINT *pctinfo)
Definition: filesystem.c:2259
static ULONG WINAPI drivecoll_Release(IDriveCollection *iface)
Definition: filesystem.c:2246
static HRESULT WINAPI drivecoll_GetIDsOfNames(IDriveCollection *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: filesystem.c:2275
static HRESULT WINAPI drivecoll_get__NewEnum(IDriveCollection *iface, IUnknown **ppenum)
Definition: filesystem.c:2323
static HRESULT WINAPI drivecoll_get_Item(IDriveCollection *iface, VARIANT key, IDrive **drive)
Definition: filesystem.c:2316
static ULONG WINAPI drivecoll_AddRef(IDriveCollection *iface)
Definition: filesystem.c:2236

Definition at line 2347 of file filesystem.c.

Referenced by create_drivecoll().

◆ drivecollenumvariantvtbl

const IEnumVARIANTVtbl drivecollenumvariantvtbl
static
Initial value:
= {
}
static HRESULT WINAPI drivecoll_enumvariant_Clone(IEnumVARIANT *iface, IEnumVARIANT **pclone)
Definition: filesystem.c:1779
static HRESULT WINAPI drivecoll_enumvariant_Skip(IEnumVARIANT *iface, ULONG celt)
Definition: filesystem.c:1755
static HRESULT WINAPI enumvariant_QueryInterface(IEnumVARIANT *iface, REFIID riid, void **obj)
Definition: filesystem.c:1341
static ULONG WINAPI enumvariant_AddRef(IEnumVARIANT *iface)
Definition: filesystem.c:1361
static ULONG WINAPI drivecoll_enumvariant_Release(IEnumVARIANT *iface)
Definition: filesystem.c:1693
static HRESULT WINAPI drivecoll_enumvariant_Next(IEnumVARIANT *iface, ULONG celt, VARIANT *var, ULONG *fetched)
Definition: filesystem.c:1723
static HRESULT WINAPI drivecoll_enumvariant_Reset(IEnumVARIANT *iface)
Definition: filesystem.c:1769

Definition at line 1786 of file filesystem.c.

Referenced by create_drivecoll_enum().

◆ drivevtbl

const IDriveVtbl drivevtbl
static
Initial value:
= {
}
static HRESULT WINAPI drive_get_FreeSpace(IDrive *iface, VARIANT *v)
Definition: filesystem.c:1193
static HRESULT WINAPI drive_get_SerialNumber(IDrive *iface, LONG *serial)
Definition: filesystem.c:1268
static HRESULT WINAPI drive_get_DriveLetter(IDrive *iface, BSTR *letter)
Definition: filesystem.c:1098
static HRESULT WINAPI drive_get_TotalSize(IDrive *iface, VARIANT *v)
Definition: filesystem.c:1209
static HRESULT WINAPI drive_get_DriveType(IDrive *iface, DriveTypeConst *type)
Definition: filesystem.c:1121
static HRESULT WINAPI drive_get_VolumeName(IDrive *iface, BSTR *name)
Definition: filesystem.c:1225
static HRESULT WINAPI drive_GetTypeInfoCount(IDrive *iface, UINT *pctinfo)
Definition: filesystem.c:1034
static HRESULT WINAPI drive_get_RootFolder(IDrive *iface, IFolder **folder)
Definition: filesystem.c:1152
static HRESULT WINAPI drive_put_VolumeName(IDrive *iface, BSTR name)
Definition: filesystem.c:1243
static HRESULT WINAPI drive_GetTypeInfo(IDrive *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: filesystem.c:1042
static HRESULT WINAPI drive_get_ShareName(IDrive *iface, BSTR *share_name)
Definition: filesystem.c:1114
static HRESULT WINAPI drive_get_AvailableSpace(IDrive *iface, VARIANT *v)
Definition: filesystem.c:1177
static ULONG WINAPI drive_Release(IDrive *iface)
Definition: filesystem.c:1021
static HRESULT WINAPI drive_Invoke(IDrive *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: filesystem.c:1069
static ULONG WINAPI drive_AddRef(IDrive *iface)
Definition: filesystem.c:1011
static HRESULT WINAPI drive_get_FileSystem(IDrive *iface, BSTR *fs)
Definition: filesystem.c:1250
static HRESULT WINAPI drive_get_IsReady(IDrive *iface, VARIANT_BOOL *ready)
Definition: filesystem.c:1282
static HRESULT WINAPI drive_QueryInterface(IDrive *iface, REFIID riid, void **obj)
Definition: filesystem.c:986
static HRESULT WINAPI drive_GetIDsOfNames(IDrive *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: filesystem.c:1050
static HRESULT WINAPI drive_get_Path(IDrive *iface, BSTR *path)
Definition: filesystem.c:1091

Definition at line 1298 of file filesystem.c.

Referenced by create_drive().

◆ file_vtbl

const IFileVtbl file_vtbl
static
Initial value:
= {
}
static HRESULT WINAPI file_Invoke(IFile *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: filesystem.c:2843
static HRESULT WINAPI file_Delete(IFile *iface, VARIANT_BOOL Force)
Definition: filesystem.c:3045
static HRESULT WINAPI file_get_DateCreated(IFile *iface, DATE *date)
Definition: filesystem.c:2982
static HRESULT WINAPI file_get_ShortName(IFile *iface, BSTR *pbstrName)
Definition: filesystem.c:2917
static HRESULT WINAPI file_GetTypeInfoCount(IFile *iface, UINT *pctinfo)
Definition: filesystem.c:2808
static HRESULT WINAPI file_get_Attributes(IFile *iface, FileAttribute *pfa)
Definition: filesystem.c:2938
static HRESULT WINAPI file_get_ParentFolder(IFile *iface, IFolder **ppfolder)
Definition: filesystem.c:2931
static HRESULT WINAPI file_get_ShortPath(IFile *iface, BSTR *pbstrPath)
Definition: filesystem.c:2910
static ULONG WINAPI file_AddRef(IFile *iface)
Definition: filesystem.c:2782
static HRESULT WINAPI file_OpenAsTextStream(IFile *iface, IOMode mode, Tristate format, ITextStream **stream)
Definition: filesystem.c:3066
static HRESULT WINAPI file_get_Drive(IFile *iface, IDrive **ppdrive)
Definition: filesystem.c:2924
static HRESULT WINAPI file_Move(IFile *iface, BSTR Destination)
Definition: filesystem.c:3059
static HRESULT WINAPI file_QueryInterface(IFile *iface, REFIID riid, void **obj)
Definition: filesystem.c:2757
static HRESULT WINAPI file_put_Attributes(IFile *iface, FileAttribute pfa)
Definition: filesystem.c:2958
static HRESULT WINAPI file_get_Type(IFile *iface, BSTR *pbstrType)
Definition: filesystem.c:3038
static HRESULT WINAPI file_get_Path(IFile *iface, BSTR *path)
Definition: filesystem.c:2862
static HRESULT WINAPI file_get_Name(IFile *iface, BSTR *name)
Definition: filesystem.c:2878
static HRESULT WINAPI file_get_DateLastModified(IFile *iface, DATE *date)
Definition: filesystem.c:2995
static HRESULT WINAPI file_Copy(IFile *iface, BSTR Destination, VARIANT_BOOL OverWriteFiles)
Definition: filesystem.c:3052
static HRESULT WINAPI file_get_Size(IFile *iface, VARIANT *pvarSize)
Definition: filesystem.c:3015
static ULONG WINAPI file_Release(IFile *iface)
Definition: filesystem.c:2792
static HRESULT WINAPI file_get_DateLastAccessed(IFile *iface, DATE *pdate)
Definition: filesystem.c:3008
static HRESULT WINAPI file_GetTypeInfo(IFile *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: filesystem.c:2818
static HRESULT WINAPI file_put_Name(IFile *iface, BSTR pbstrName)
Definition: filesystem.c:2903
static HRESULT WINAPI file_GetIDsOfNames(IFile *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: filesystem.c:2826

Definition at line 3075 of file filesystem.c.

Referenced by create_file().

◆ filecollectionvtbl

const IFileCollectionVtbl filecollectionvtbl
static
Initial value:
= {
}
static ULONG WINAPI filecoll_Release(IFileCollection *iface)
Definition: filesystem.c:2053
static HRESULT WINAPI filecoll_Invoke(IFileCollection *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: filesystem.c:2104
static HRESULT WINAPI filecoll_GetIDsOfNames(IFileCollection *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: filesystem.c:2085
static HRESULT WINAPI filecoll_get_Count(IFileCollection *iface, LONG *count)
Definition: filesystem.c:2145
static HRESULT WINAPI filecoll_get_Item(IFileCollection *iface, VARIANT Key, IFile **file)
Definition: filesystem.c:2126
static HRESULT WINAPI filecoll_get__NewEnum(IFileCollection *iface, IUnknown **ppenum)
Definition: filesystem.c:2133
static HRESULT WINAPI filecoll_GetTypeInfoCount(IFileCollection *iface, UINT *pctinfo)
Definition: filesystem.c:2069
static HRESULT WINAPI filecoll_QueryInterface(IFileCollection *iface, REFIID riid, void **obj)
Definition: filesystem.c:2018
static ULONG WINAPI filecoll_AddRef(IFileCollection *iface)
Definition: filesystem.c:2043
static HRESULT WINAPI filecoll_GetTypeInfo(IFileCollection *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: filesystem.c:2077

Definition at line 2175 of file filesystem.c.

Referenced by create_filecoll().

◆ filecollenumvariantvtbl

const IEnumVARIANTVtbl filecollenumvariantvtbl
static
Initial value:
= {
}
static HRESULT WINAPI filecoll_enumvariant_Reset(IEnumVARIANT *iface)
Definition: filesystem.c:1644
static HRESULT WINAPI filecoll_enumvariant_Clone(IEnumVARIANT *iface, IEnumVARIANT **pclone)
Definition: filesystem.c:1656
static HRESULT WINAPI filecoll_enumvariant_Skip(IEnumVARIANT *iface, ULONG celt)
Definition: filesystem.c:1616
static HRESULT WINAPI filecoll_enumvariant_Next(IEnumVARIANT *iface, ULONG celt, VARIANT *var, ULONG *fetched)
Definition: filesystem.c:1568
static ULONG WINAPI filecoll_enumvariant_Release(IEnumVARIANT *iface)
Definition: filesystem.c:1551

Definition at line 1663 of file filesystem.c.

Referenced by create_filecoll_enum().

◆ filesys_vtbl

const struct IFileSystem3Vtbl filesys_vtbl
static

Definition at line 4137 of file filesystem.c.

Referenced by FileSystem_CreateInstance().

◆ filesystem

Definition at line 4175 of file filesystem.c.

◆ foldercollenumvariantvtbl

const IEnumVARIANTVtbl foldercollenumvariantvtbl
static
Initial value:
= {
}
static HRESULT WINAPI foldercoll_enumvariant_Next(IEnumVARIANT *iface, ULONG celt, VARIANT *var, ULONG *fetched)
Definition: filesystem.c:1414
static HRESULT WINAPI foldercoll_enumvariant_Reset(IEnumVARIANT *iface)
Definition: filesystem.c:1502
static HRESULT WINAPI foldercoll_enumvariant_Clone(IEnumVARIANT *iface, IEnumVARIANT **pclone)
Definition: filesystem.c:1514
static HRESULT WINAPI foldercoll_enumvariant_Skip(IEnumVARIANT *iface, ULONG celt)
Definition: filesystem.c:1468
static ULONG WINAPI foldercoll_enumvariant_Release(IEnumVARIANT *iface)
Definition: filesystem.c:1369

Definition at line 1521 of file filesystem.c.

Referenced by create_foldercoll_enum().

◆ foldercollvtbl

const IFolderCollectionVtbl foldercollvtbl
static
Initial value:
= {
}
static ULONG WINAPI foldercoll_AddRef(IFolderCollection *iface)
Definition: filesystem.c:1841
static HRESULT WINAPI foldercoll_GetTypeInfoCount(IFolderCollection *iface, UINT *pctinfo)
Definition: filesystem.c:1867
static HRESULT WINAPI foldercoll_get_Item(IFolderCollection *iface, VARIANT key, IFolder **folder)
Definition: filesystem.c:1931
static HRESULT WINAPI foldercoll_get_Count(IFolderCollection *iface, LONG *count)
Definition: filesystem.c:1950
static HRESULT WINAPI foldercoll_QueryInterface(IFolderCollection *iface, REFIID riid, void **obj)
Definition: filesystem.c:1816
static HRESULT WINAPI foldercoll_GetIDsOfNames(IFolderCollection *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: filesystem.c:1883
static ULONG WINAPI foldercoll_Release(IFolderCollection *iface)
Definition: filesystem.c:1851
static HRESULT WINAPI foldercoll_get__NewEnum(IFolderCollection *iface, IUnknown **newenum)
Definition: filesystem.c:1938
static HRESULT WINAPI foldercoll_Add(IFolderCollection *iface, BSTR name, IFolder **folder)
Definition: filesystem.c:1924
static HRESULT WINAPI foldercoll_Invoke(IFolderCollection *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: filesystem.c:1902
static HRESULT WINAPI foldercoll_GetTypeInfo(IFolderCollection *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: filesystem.c:1875

Definition at line 1980 of file filesystem.c.

Referenced by create_foldercoll().

◆ foldervtbl

const IFolderVtbl foldervtbl
static
Initial value:
= {
}
static HRESULT WINAPI folder_get_DateLastModified(IFolder *iface, DATE *date)
Definition: filesystem.c:2584
static HRESULT WINAPI folder_get_Type(IFolder *iface, BSTR *type)
Definition: filesystem.c:2598
static HRESULT WINAPI folder_get_Size(IFolder *iface, VARIANT *size)
Definition: filesystem.c:2633
static HRESULT WINAPI folder_put_Name(IFolder *iface, BSTR name)
Definition: filesystem.c:2528
static HRESULT WINAPI folder_get_ShortName(IFolder *iface, BSTR *name)
Definition: filesystem.c:2542
static HRESULT WINAPI folder_get_Name(IFolder *iface, BSTR *name)
Definition: filesystem.c:2503
static HRESULT WINAPI folder_get_IsRootFolder(IFolder *iface, VARIANT_BOOL *isroot)
Definition: filesystem.c:2626
static HRESULT WINAPI folder_CreateTextFile(IFolder *iface, BSTR filename, VARIANT_BOOL overwrite, VARIANT_BOOL unicode, ITextStream **stream)
Definition: filesystem.c:2664
static HRESULT WINAPI folder_get_SubFolders(IFolder *iface, IFolderCollection **folders)
Definition: filesystem.c:2640
static HRESULT WINAPI folder_QueryInterface(IFolder *iface, REFIID riid, void **obj)
Definition: filesystem.c:2382
static HRESULT WINAPI folder_Delete(IFolder *iface, VARIANT_BOOL force)
Definition: filesystem.c:2605
static HRESULT WINAPI folder_Move(IFolder *iface, BSTR dest)
Definition: filesystem.c:2619
static ULONG WINAPI folder_Release(IFolder *iface)
Definition: filesystem.c:2417
static HRESULT WINAPI folder_get_Path(IFolder *iface, BSTR *path)
Definition: filesystem.c:2490
static HRESULT WINAPI folder_put_Attributes(IFolder *iface, FileAttribute attr)
Definition: filesystem.c:2570
static HRESULT WINAPI folder_get_Attributes(IFolder *iface, FileAttribute *attr)
Definition: filesystem.c:2563
static HRESULT WINAPI folder_get_ShortPath(IFolder *iface, BSTR *path)
Definition: filesystem.c:2535
static ULONG WINAPI folder_AddRef(IFolder *iface)
Definition: filesystem.c:2407
static HRESULT WINAPI folder_GetTypeInfoCount(IFolder *iface, UINT *pctinfo)
Definition: filesystem.c:2433
static HRESULT WINAPI folder_get_Files(IFolder *iface, IFileCollection **files)
Definition: filesystem.c:2652
static HRESULT WINAPI folder_get_ParentFolder(IFolder *iface, IFolder **parent)
Definition: filesystem.c:2556
static HRESULT WINAPI folder_get_Drive(IFolder *iface, IDrive **drive)
Definition: filesystem.c:2549
static HRESULT WINAPI folder_get_DateLastAccessed(IFolder *iface, DATE *date)
Definition: filesystem.c:2591
static HRESULT WINAPI folder_Copy(IFolder *iface, BSTR dest, VARIANT_BOOL overwrite)
Definition: filesystem.c:2612
static HRESULT WINAPI folder_GetTypeInfo(IFolder *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: filesystem.c:2441
static HRESULT WINAPI folder_get_DateCreated(IFolder *iface, DATE *date)
Definition: filesystem.c:2577
static HRESULT WINAPI folder_GetIDsOfNames(IFolder *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: filesystem.c:2449
static HRESULT WINAPI folder_Invoke(IFolder *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: filesystem.c:2468

Definition at line 2684 of file filesystem.c.

Referenced by create_folder().

◆ pipestreamvtbl

const ITextStreamVtbl pipestreamvtbl
static
Initial value:
=
{
}
static HRESULT WINAPI pipestream_WriteLine(ITextStream *iface, BSTR text)
Definition: filesystem.c:804
static HRESULT WINAPI textstream_GetIDsOfNames(ITextStream *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: filesystem.c:355
static HRESULT WINAPI pipestream_get_Column(ITextStream *iface, LONG *column)
Definition: filesystem.c:753
static HRESULT WINAPI pipestream_get_Line(ITextStream *iface, LONG *line)
Definition: filesystem.c:746
static HRESULT WINAPI pipestream_ReadAll(ITextStream *iface, BSTR *text)
Definition: filesystem.c:788
static HRESULT WINAPI textstream_GetTypeInfoCount(ITextStream *iface, UINT *pctinfo)
Definition: filesystem.c:339
static HRESULT WINAPI pipestream_Skip(ITextStream *iface, LONG count)
Definition: filesystem.c:818
static HRESULT WINAPI textstream_GetTypeInfo(ITextStream *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: filesystem.c:347
static HRESULT WINAPI textstream_QueryInterface(ITextStream *iface, REFIID riid, void **obj)
Definition: filesystem.c:289
static ULONG WINAPI textstream_Release(ITextStream *iface)
Definition: filesystem.c:322
static HRESULT WINAPI pipestream_get_AtEndOfStream(ITextStream *iface, VARIANT_BOOL *eos)
Definition: filesystem.c:760
static HRESULT WINAPI pipestream_Write(ITextStream *iface, BSTR text)
Definition: filesystem.c:795
static HRESULT WINAPI pipestream_Read(ITextStream *iface, LONG len, BSTR *text)
Definition: filesystem.c:774
static ULONG WINAPI textstream_AddRef(ITextStream *iface)
Definition: filesystem.c:312
static HRESULT WINAPI pipestream_ReadLine(ITextStream *iface, BSTR *text)
Definition: filesystem.c:781
static HRESULT WINAPI pipestream_SkipLine(ITextStream *iface)
Definition: filesystem.c:825
static HRESULT WINAPI textstream_Close(ITextStream *iface)
Definition: filesystem.c:707
static HRESULT WINAPI pipestream_WriteBlankLines(ITextStream *iface, LONG lines)
Definition: filesystem.c:811
static HRESULT WINAPI textstream_Invoke(ITextStream *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: filesystem.c:374
static HRESULT WINAPI pipestream_get_AtEndOfLine(ITextStream *iface, VARIANT_BOOL *eol)
Definition: filesystem.c:767

Definition at line 832 of file filesystem.c.

Referenced by DoOpenPipeStream().

◆ textstreamvtbl

const ITextStreamVtbl textstreamvtbl
static
Initial value:
=
{
}
static HRESULT WINAPI textstream_get_Line(ITextStream *iface, LONG *line)
Definition: filesystem.c:396
static HRESULT WINAPI textstream_Skip(ITextStream *iface, LONG count)
Definition: filesystem.c:693
static HRESULT WINAPI textstream_get_AtEndOfStream(ITextStream *iface, VARIANT_BOOL *eos)
Definition: filesystem.c:410
static HRESULT WINAPI textstream_ReadAll(ITextStream *iface, BSTR *text)
Definition: filesystem.c:589
static HRESULT WINAPI textstream_ReadLine(ITextStream *iface, BSTR *text)
Definition: filesystem.c:549
static HRESULT WINAPI textstream_Write(ITextStream *iface, BSTR text)
Definition: filesystem.c:643
static HRESULT WINAPI textstream_WriteLine(ITextStream *iface, BSTR text)
Definition: filesystem.c:673
static HRESULT WINAPI textstream_get_Column(ITextStream *iface, LONG *column)
Definition: filesystem.c:403
static HRESULT WINAPI textstream_SkipLine(ITextStream *iface)
Definition: filesystem.c:700
static HRESULT WINAPI textstream_WriteBlankLines(ITextStream *iface, LONG lines)
Definition: filesystem.c:686
static HRESULT WINAPI textstream_Read(ITextStream *iface, LONG len, BSTR *text)
Definition: filesystem.c:514
static HRESULT WINAPI textstream_get_AtEndOfLine(ITextStream *iface, VARIANT_BOOL *eol)
Definition: filesystem.c:428

Definition at line 722 of file filesystem.c.

Referenced by create_textstream().