[SCRRUN_WINETEST]

* Import from Wine 1.7.1.

svn path=/trunk/; revision=60075
This commit is contained in:
Amine Khaldi 2013-09-13 10:19:51 +00:00
parent 2884eb4ffb
commit eb17ba28c4
6 changed files with 1507 additions and 0 deletions

View file

@ -72,6 +72,7 @@ add_subdirectory(rpcrt4)
add_subdirectory(rsabase)
add_subdirectory(rsaenh)
add_subdirectory(schannel)
add_subdirectory(scrrun)
add_subdirectory(secur32)
add_subdirectory(serialui)
add_subdirectory(services)

View file

@ -0,0 +1,17 @@
add_definitions(
-D__ROS_LONG64__
-DUSE_WINE_TODOS)
list(APPEND SOURCE
dictionary.c
filesystem.c
testlist.c)
add_executable(scrrun_winetest ${SOURCE})
add_idl_headers(scrrun_idlheader_test scrrun.idl)
add_dependencies(scrrun_winetest scrrun_idlheader_test)
target_link_libraries(scrrun_winetest uuid)
set_module_type(scrrun_winetest win32cui)
add_importlibs(scrrun_winetest ole32 oleaut32 msvcrt kernel32)
add_cd_file(TARGET scrrun_winetest DESTINATION reactos/bin FOR all)

View file

@ -0,0 +1,102 @@
/*
* Copyright (C) 2012 Alistair Leslie-Hughes
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#define COBJMACROS
#include <stdio.h>
#include "windows.h"
#include "ole2.h"
#include "oleauto.h"
#include "dispex.h"
#include "wine/test.h"
#include "scrrun.h"
static void test_interfaces(void)
{
static const WCHAR key_add[] = {'a', 0};
static const WCHAR key_add_value[] = {'a', 0};
static const WCHAR key_non_exist[] = {'b', 0};
HRESULT hr;
IDispatch *disp;
IDispatchEx *dispex;
IDictionary *dict;
IObjectWithSite *site;
VARIANT key, value;
VARIANT_BOOL exists;
LONG count = 0;
hr = CoCreateInstance(&CLSID_Dictionary, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER,
&IID_IDispatch, (void**)&disp);
if(FAILED(hr)) {
win_skip("Could not create FileSystem object: %08x\n", hr);
return;
}
VariantInit(&key);
VariantInit(&value);
hr = IDispatch_QueryInterface(disp, &IID_IDictionary, (void**)&dict);
ok(hr == S_OK, "got 0x%08x, expected 0x%08x\n", hr, S_OK);
hr = IDispatch_QueryInterface(disp, &IID_IObjectWithSite, (void**)&site);
ok(hr == E_NOINTERFACE, "got 0x%08x, expected 0x%08x\n", hr, E_NOINTERFACE);
hr = IDispatch_QueryInterface(disp, &IID_IDispatchEx, (void**)&dispex);
ok(hr == E_NOINTERFACE, "got 0x%08x, expected 0x%08x\n", hr, E_NOINTERFACE);
V_VT(&key) = VT_BSTR;
V_BSTR(&key) = SysAllocString(key_add);
V_VT(&value) = VT_BSTR;
V_BSTR(&value) = SysAllocString(key_add_value);
hr = IDictionary_Add(dict, &key, &value);
todo_wine ok(hr == S_OK, "got 0x%08x, expected 0x%08x\n", hr, S_OK);
VariantClear(&value);
exists = VARIANT_FALSE;
hr = IDictionary_Exists(dict, &key, &exists);
todo_wine ok(hr == S_OK, "got 0x%08x, expected 0x%08x\n", hr, S_OK);
todo_wine ok(exists == VARIANT_TRUE, "Expected TRUE but got FALSE.\n");
VariantClear(&key);
exists = VARIANT_TRUE;
V_VT(&key) = VT_BSTR;
V_BSTR(&key) = SysAllocString(key_non_exist);
hr = IDictionary_Exists(dict, &key, &exists);
todo_wine ok(hr == S_OK, "got 0x%08x, expected 0x%08x\n", hr, S_OK);
todo_wine ok(exists == VARIANT_FALSE, "Expected FALSE but got TRUE.\n");
VariantClear(&key);
hr = IDictionary_get_Count(dict, &count);
ok(hr == S_OK, "got 0x%08x, expected 0x%08x\n", hr, S_OK);
todo_wine ok(count == 1, "got %d, expected 1\n", count);
IDictionary_Release(dict);
IDispatch_Release(disp);
}
START_TEST(dictionary)
{
CoInitialize(NULL);
test_interfaces();
CoUninitialize();
}

View file

@ -0,0 +1,681 @@
/*
*
* Copyright 2012 Alistair Leslie-Hughes
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#define COBJMACROS
#include <stdio.h>
#include "windows.h"
#include "ole2.h"
#include "olectl.h"
#include "oleauto.h"
#include "dispex.h"
#include "wine/test.h"
#include "initguid.h"
#include "scrrun.h"
static IFileSystem3 *fs3;
static void test_interfaces(void)
{
static const WCHAR nonexistent_dirW[] = {
'c', ':', '\\', 'N', 'o', 'n', 'e', 'x', 'i', 's', 't', 'e', 'n', 't', 0};
static const WCHAR pathW[] = {'p','a','t','h',0};
static const WCHAR file_kernel32W[] = {
'\\', 'k', 'e', 'r', 'n', 'e', 'l', '3', '2', '.', 'd', 'l', 'l', 0};
HRESULT hr;
IDispatch *disp;
IDispatchEx *dispex;
IObjectWithSite *site;
VARIANT_BOOL b;
BSTR path;
WCHAR windows_path[MAX_PATH];
WCHAR file_path[MAX_PATH];
IFileSystem3_QueryInterface(fs3, &IID_IDispatch, (void**)&disp);
GetSystemDirectoryW(windows_path, MAX_PATH);
lstrcpyW(file_path, windows_path);
lstrcatW(file_path, file_kernel32W);
hr = IDispatch_QueryInterface(disp, &IID_IObjectWithSite, (void**)&site);
ok(hr == E_NOINTERFACE, "got 0x%08x, expected 0x%08x\n", hr, E_NOINTERFACE);
hr = IDispatch_QueryInterface(disp, &IID_IDispatchEx, (void**)&dispex);
ok(hr == E_NOINTERFACE, "got 0x%08x, expected 0x%08x\n", hr, E_NOINTERFACE);
b = VARIANT_TRUE;
hr = IFileSystem3_FileExists(fs3, NULL, &b);
ok(hr == S_OK, "got 0x%08x, expected 0x%08x\n", hr, S_OK);
ok(b == VARIANT_FALSE, "got %x\n", b);
hr = IFileSystem3_FileExists(fs3, NULL, NULL);
ok(hr == E_POINTER, "got 0x%08x, expected 0x%08x\n", hr, E_POINTER);
path = SysAllocString(pathW);
b = VARIANT_TRUE;
hr = IFileSystem3_FileExists(fs3, path, &b);
ok(hr == S_OK, "got 0x%08x, expected 0x%08x\n", hr, S_OK);
ok(b == VARIANT_FALSE, "got %x\n", b);
SysFreeString(path);
path = SysAllocString(file_path);
b = VARIANT_FALSE;
hr = IFileSystem3_FileExists(fs3, path, &b);
ok(hr == S_OK, "got 0x%08x, expected 0x%08x\n", hr, S_OK);
ok(b == VARIANT_TRUE, "got %x\n", b);
SysFreeString(path);
path = SysAllocString(windows_path);
b = VARIANT_TRUE;
hr = IFileSystem3_FileExists(fs3, path, &b);
ok(hr == S_OK, "got 0x%08x, expected 0x%08x\n", hr, S_OK);
ok(b == VARIANT_FALSE, "got %x\n", b);
SysFreeString(path);
/* Folder Exists */
hr = IFileSystem3_FolderExists(fs3, NULL, NULL);
ok(hr == E_POINTER, "got 0x%08x, expected 0x%08x\n", hr, E_POINTER);
path = SysAllocString(windows_path);
hr = IFileSystem3_FolderExists(fs3, path, &b);
ok(hr == S_OK, "got 0x%08x, expected 0x%08x\n", hr, S_OK);
ok(b == VARIANT_TRUE, "Folder doesn't exists\n");
SysFreeString(path);
path = SysAllocString(nonexistent_dirW);
hr = IFileSystem3_FolderExists(fs3, path, &b);
ok(hr == S_OK, "got 0x%08x, expected 0x%08x\n", hr, S_OK);
ok(b == VARIANT_FALSE, "Folder exists\n");
SysFreeString(path);
path = SysAllocString(file_path);
hr = IFileSystem3_FolderExists(fs3, path, &b);
ok(hr == S_OK, "got 0x%08x, expected 0x%08x\n", hr, S_OK);
ok(b == VARIANT_FALSE, "Folder exists\n");
SysFreeString(path);
IDispatch_Release(disp);
}
static void test_createfolder(void)
{
HRESULT hr;
WCHAR pathW[MAX_PATH];
BSTR path;
IFolder *folder;
/* create existing directory */
GetCurrentDirectoryW(sizeof(pathW)/sizeof(WCHAR), pathW);
path = SysAllocString(pathW);
folder = (void*)0xdeabeef;
hr = IFileSystem3_CreateFolder(fs3, path, &folder);
ok(hr == CTL_E_FILEALREADYEXISTS, "got 0x%08x\n", hr);
ok(folder == NULL, "got %p\n", folder);
SysFreeString(path);
}
static void test_textstream(void)
{
static WCHAR testfileW[] = {'t','e','s','t','f','i','l','e','.','t','x','t',0};
ITextStream *stream;
VARIANT_BOOL b;
HANDLE file;
HRESULT hr;
BSTR name, data;
file = CreateFileW(testfileW, GENERIC_READ, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
CloseHandle(file);
name = SysAllocString(testfileW);
b = VARIANT_FALSE;
hr = IFileSystem3_FileExists(fs3, name, &b);
ok(hr == S_OK, "got 0x%08x, expected 0x%08x\n", hr, S_OK);
ok(b == VARIANT_TRUE, "got %x\n", b);
hr = IFileSystem3_OpenTextFile(fs3, name, ForReading, VARIANT_FALSE, TristateFalse, &stream);
ok(hr == S_OK, "got 0x%08x\n", hr);
b = 10;
hr = ITextStream_get_AtEndOfStream(stream, &b);
todo_wine {
ok(hr == S_FALSE || broken(hr == S_OK), "got 0x%08x\n", hr);
ok(b == VARIANT_TRUE, "got 0x%x\n", b);
}
ITextStream_Release(stream);
hr = IFileSystem3_OpenTextFile(fs3, name, ForWriting, VARIANT_FALSE, TristateFalse, &stream);
ok(hr == S_OK, "got 0x%08x\n", hr);
b = 10;
hr = ITextStream_get_AtEndOfStream(stream, &b);
todo_wine {
ok(hr == CTL_E_BADFILEMODE, "got 0x%08x\n", hr);
ok(b == VARIANT_TRUE || broken(b == 10), "got 0x%x\n", b);
}
b = 10;
hr = ITextStream_get_AtEndOfLine(stream, &b);
todo_wine {
ok(hr == CTL_E_BADFILEMODE, "got 0x%08x\n", hr);
ok(b == VARIANT_FALSE || broken(b == 10), "got 0x%x\n", b);
}
hr = ITextStream_Read(stream, 1, &data);
ok(hr == CTL_E_BADFILEMODE, "got 0x%08x\n", hr);
hr = ITextStream_ReadLine(stream, &data);
ok(hr == CTL_E_BADFILEMODE, "got 0x%08x\n", hr);
hr = ITextStream_ReadAll(stream, &data);
ok(hr == CTL_E_BADFILEMODE, "got 0x%08x\n", hr);
ITextStream_Release(stream);
hr = IFileSystem3_OpenTextFile(fs3, name, ForAppending, VARIANT_FALSE, TristateFalse, &stream);
ok(hr == S_OK, "got 0x%08x\n", hr);
SysFreeString(name);
b = 10;
hr = ITextStream_get_AtEndOfStream(stream, &b);
todo_wine {
ok(hr == CTL_E_BADFILEMODE, "got 0x%08x\n", hr);
ok(b == VARIANT_TRUE || broken(b == 10), "got 0x%x\n", b);
}
b = 10;
hr = ITextStream_get_AtEndOfLine(stream, &b);
todo_wine {
ok(hr == CTL_E_BADFILEMODE, "got 0x%08x\n", hr);
ok(b == VARIANT_FALSE || broken(b == 10), "got 0x%x\n", b);
}
hr = ITextStream_Read(stream, 1, &data);
ok(hr == CTL_E_BADFILEMODE, "got 0x%08x\n", hr);
hr = ITextStream_ReadLine(stream, &data);
ok(hr == CTL_E_BADFILEMODE, "got 0x%08x\n", hr);
hr = ITextStream_ReadAll(stream, &data);
ok(hr == CTL_E_BADFILEMODE, "got 0x%08x\n", hr);
ITextStream_Release(stream);
DeleteFileW(testfileW);
}
static void test_GetFileVersion(void)
{
static const WCHAR k32W[] = {'\\','k','e','r','n','e','l','3','2','.','d','l','l',0};
static const WCHAR k33W[] = {'\\','k','e','r','n','e','l','3','3','.','d','l','l',0};
WCHAR pathW[MAX_PATH], filenameW[MAX_PATH];
BSTR path, version;
HRESULT hr;
GetSystemDirectoryW(pathW, sizeof(pathW)/sizeof(WCHAR));
lstrcpyW(filenameW, pathW);
lstrcatW(filenameW, k32W);
path = SysAllocString(filenameW);
hr = IFileSystem3_GetFileVersion(fs3, path, &version);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(*version != 0, "got %s\n", wine_dbgstr_w(version));
SysFreeString(version);
SysFreeString(path);
lstrcpyW(filenameW, pathW);
lstrcatW(filenameW, k33W);
path = SysAllocString(filenameW);
version = (void*)0xdeadbeef;
hr = IFileSystem3_GetFileVersion(fs3, path, &version);
ok(broken(hr == S_OK) || hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), "got 0x%08x\n", hr);
if (hr == S_OK)
{
ok(*version == 0, "got %s\n", wine_dbgstr_w(version));
SysFreeString(version);
}
else
ok(version == (void*)0xdeadbeef, "got %p\n", version);
SysFreeString(path);
}
static void test_GetParentFolderName(void)
{
static const WCHAR path1[] = {'a',0};
static const WCHAR path2[] = {'a','/','a','/','a',0};
static const WCHAR path3[] = {'a','\\','a','\\','a',0};
static const WCHAR path4[] = {'a','/','a','/','/','\\','\\',0};
static const WCHAR path5[] = {'c',':','\\','\\','a',0};
static const WCHAR path6[] = {'a','c',':','\\','a',0};
static const WCHAR result2[] = {'a','/','a',0};
static const WCHAR result3[] = {'a','\\','a',0};
static const WCHAR result4[] = {'a',0};
static const WCHAR result5[] = {'c',':','\\',0};
static const WCHAR result6[] = {'a','c',':',0};
static const struct {
const WCHAR *path;
const WCHAR *result;
} tests[] = {
{NULL, NULL},
{path1, NULL},
{path2, result2},
{path3, result3},
{path4, result4},
{path5, result5},
{path6, result6}
};
BSTR path, result;
HRESULT hr;
int i;
hr = IFileSystem3_GetParentFolderName(fs3, NULL, NULL);
ok(hr == E_POINTER, "GetParentFolderName returned %x, expected E_POINTER\n", hr);
for(i=0; i<sizeof(tests)/sizeof(tests[0]); i++) {
result = (BSTR)0xdeadbeef;
path = tests[i].path ? SysAllocString(tests[i].path) : NULL;
hr = IFileSystem3_GetParentFolderName(fs3, path, &result);
ok(hr == S_OK, "%d) GetParentFolderName returned %x, expected S_OK\n", i, hr);
if(!tests[i].result)
ok(!result, "%d) result = %s\n", i, wine_dbgstr_w(result));
else
ok(!lstrcmpW(result, tests[i].result), "%d) result = %s\n", i, wine_dbgstr_w(result));
SysFreeString(path);
SysFreeString(result);
}
}
static void test_GetFileName(void)
{
static const WCHAR path1[] = {'a',0};
static const WCHAR path2[] = {'a','/','a','.','b',0};
static const WCHAR path3[] = {'a','\\',0};
static const WCHAR path4[] = {'c',':',0};
static const WCHAR path5[] = {'/','\\',0};
static const WCHAR result2[] = {'a','.','b',0};
static const WCHAR result3[] = {'a',0};
static const struct {
const WCHAR *path;
const WCHAR *result;
} tests[] = {
{NULL, NULL},
{path1, path1},
{path2, result2},
{path3, result3},
{path4, NULL},
{path5, NULL}
};
BSTR path, result;
HRESULT hr;
int i;
hr = IFileSystem3_GetFileName(fs3, NULL, NULL);
ok(hr == E_POINTER, "GetFileName returned %x, expected E_POINTER\n", hr);
for(i=0; i<sizeof(tests)/sizeof(tests[0]); i++) {
result = (BSTR)0xdeadbeef;
path = tests[i].path ? SysAllocString(tests[i].path) : NULL;
hr = IFileSystem3_GetFileName(fs3, path, &result);
ok(hr == S_OK, "%d) GetFileName returned %x, expected S_OK\n", i, hr);
if(!tests[i].result)
ok(!result, "%d) result = %s\n", i, wine_dbgstr_w(result));
else
ok(!lstrcmpW(result, tests[i].result), "%d) result = %s\n", i, wine_dbgstr_w(result));
SysFreeString(path);
SysFreeString(result);
}
}
static void test_GetBaseName(void)
{
static const WCHAR path1[] = {'a',0};
static const WCHAR path2[] = {'a','/','a','.','b','.','c',0};
static const WCHAR path3[] = {'a','.','b','\\',0};
static const WCHAR path4[] = {'c',':',0};
static const WCHAR path5[] = {'/','\\',0};
static const WCHAR path6[] = {'.','a',0};
static const WCHAR result1[] = {'a',0};
static const WCHAR result2[] = {'a','.','b',0};
static const WCHAR result6[] = {0};
static const struct {
const WCHAR *path;
const WCHAR *result;
} tests[] = {
{NULL, NULL},
{path1, result1},
{path2, result2},
{path3, result1},
{path4, NULL},
{path5, NULL},
{path6, result6}
};
BSTR path, result;
HRESULT hr;
int i;
hr = IFileSystem3_GetBaseName(fs3, NULL, NULL);
ok(hr == E_POINTER, "GetBaseName returned %x, expected E_POINTER\n", hr);
for(i=0; i<sizeof(tests)/sizeof(tests[0]); i++) {
result = (BSTR)0xdeadbeef;
path = tests[i].path ? SysAllocString(tests[i].path) : NULL;
hr = IFileSystem3_GetBaseName(fs3, path, &result);
ok(hr == S_OK, "%d) GetBaseName returned %x, expected S_OK\n", i, hr);
if(!tests[i].result)
ok(!result, "%d) result = %s\n", i, wine_dbgstr_w(result));
else
ok(!lstrcmpW(result, tests[i].result), "%d) result = %s\n", i, wine_dbgstr_w(result));
SysFreeString(path);
SysFreeString(result);
}
}
static void test_GetAbsolutePathName(void)
{
static const WCHAR dir1[] = {'t','e','s','t','_','d','i','r','1',0};
static const WCHAR dir2[] = {'t','e','s','t','_','d','i','r','2',0};
static const WCHAR dir_match1[] = {'t','e','s','t','_','d','i','r','*',0};
static const WCHAR dir_match2[] = {'t','e','s','t','_','d','i','*',0};
static const WCHAR cur_dir[] = {'.',0};
WIN32_FIND_DATAW fdata;
HANDLE find;
WCHAR buf[MAX_PATH], buf2[MAX_PATH];
BSTR path, result;
HRESULT hr;
hr = IFileSystem3_GetAbsolutePathName(fs3, NULL, NULL);
ok(hr == E_POINTER, "GetAbsolutePathName returned %x, expected E_POINTER\n", hr);
hr = IFileSystem3_GetAbsolutePathName(fs3, NULL, &result);
ok(hr == S_OK, "GetAbsolutePathName returned %x, expected S_OK\n", hr);
GetFullPathNameW(cur_dir, MAX_PATH, buf, NULL);
ok(!lstrcmpW(buf, result), "result = %s, expected %s\n", wine_dbgstr_w(result), wine_dbgstr_w(buf));
SysFreeString(result);
find = FindFirstFileW(dir_match2, &fdata);
if(find != INVALID_HANDLE_VALUE) {
skip("GetAbsolutePathName tests\n");
FindClose(find);
return;
}
path = SysAllocString(dir_match1);
hr = IFileSystem3_GetAbsolutePathName(fs3, path, &result);
ok(hr == S_OK, "GetAbsolutePathName returned %x, expected S_OK\n", hr);
GetFullPathNameW(dir_match1, MAX_PATH, buf2, NULL);
ok(!lstrcmpW(buf2, result), "result = %s, expected %s\n", wine_dbgstr_w(result), wine_dbgstr_w(buf2));
SysFreeString(result);
ok(CreateDirectoryW(dir1, NULL), "CreateDirectory(%s) failed\n", wine_dbgstr_w(dir1));
hr = IFileSystem3_GetAbsolutePathName(fs3, path, &result);
ok(hr == S_OK, "GetAbsolutePathName returned %x, expected S_OK\n", hr);
GetFullPathNameW(dir1, MAX_PATH, buf, NULL);
ok(!lstrcmpW(buf, result) || broken(!lstrcmpW(buf2, result)), "result = %s, expected %s\n",
wine_dbgstr_w(result), wine_dbgstr_w(buf));
SysFreeString(result);
ok(CreateDirectoryW(dir2, NULL), "CreateDirectory(%s) failed\n", wine_dbgstr_w(dir2));
hr = IFileSystem3_GetAbsolutePathName(fs3, path, &result);
ok(hr == S_OK, "GetAbsolutePathName returned %x, expected S_OK\n", hr);
if(!lstrcmpW(buf, result) || !lstrcmpW(buf2, result)) {
ok(!lstrcmpW(buf, result) || broken(!lstrcmpW(buf2, result)), "result = %s, expected %s\n",
wine_dbgstr_w(result), wine_dbgstr_w(buf));
}else {
GetFullPathNameW(dir2, MAX_PATH, buf, NULL);
ok(!lstrcmpW(buf, result), "result = %s, expected %s\n",
wine_dbgstr_w(result), wine_dbgstr_w(buf));
}
SysFreeString(result);
SysFreeString(path);
path = SysAllocString(dir_match2);
hr = IFileSystem3_GetAbsolutePathName(fs3, path, &result);
ok(hr == S_OK, "GetAbsolutePathName returned %x, expected S_OK\n", hr);
GetFullPathNameW(dir_match2, MAX_PATH, buf, NULL);
ok(!lstrcmpW(buf, result), "result = %s, expected %s\n", wine_dbgstr_w(result), wine_dbgstr_w(buf));
SysFreeString(result);
SysFreeString(path);
RemoveDirectoryW(dir1);
RemoveDirectoryW(dir2);
}
static void test_GetFile(void)
{
static const WCHAR get_file[] = {'g','e','t','_','f','i','l','e','.','t','s','t',0};
BSTR path = SysAllocString(get_file);
FileAttribute fa;
VARIANT size;
DWORD gfa;
IFile *file;
HRESULT hr;
HANDLE hf;
hr = IFileSystem3_GetFile(fs3, path, NULL);
ok(hr == E_POINTER, "GetFile returned %x, expected E_POINTER\n", hr);
hr = IFileSystem3_GetFile(fs3, NULL, &file);
ok(hr == E_INVALIDARG, "GetFile returned %x, expected E_INVALIDARG\n", hr);
if(GetFileAttributesW(path) != INVALID_FILE_ATTRIBUTES) {
skip("File already exists, skipping GetFile tests\n");
SysFreeString(path);
return;
}
file = (IFile*)0xdeadbeef;
hr = IFileSystem3_GetFile(fs3, path, &file);
ok(!file, "file != NULL\n");
ok(hr == CTL_E_FILENOTFOUND, "GetFile returned %x, expected CTL_E_FILENOTFOUND\n", hr);
hf = CreateFileW(path, GENERIC_WRITE, 0, NULL, CREATE_NEW, FILE_ATTRIBUTE_READONLY, NULL);
if(hf == INVALID_HANDLE_VALUE) {
skip("Can't create temporary file\n");
SysFreeString(path);
return;
}
CloseHandle(hf);
hr = IFileSystem3_GetFile(fs3, path, &file);
ok(hr == S_OK, "GetFile returned %x, expected S_OK\n", hr);
hr = IFile_get_Attributes(file, &fa);
gfa = GetFileAttributesW(get_file) & (FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_HIDDEN |
FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_ARCHIVE |
FILE_ATTRIBUTE_REPARSE_POINT | FILE_ATTRIBUTE_COMPRESSED);
ok(hr == S_OK, "get_Attributes returned %x, expected S_OK\n", hr);
ok(fa == gfa, "fa = %x, expected %x\n", fa, gfa);
hr = IFile_get_Size(file, &size);
ok(hr == S_OK, "get_Size returned %x, expected S_OK\n", hr);
ok(V_VT(&size) == VT_I4, "V_VT(&size) = %d, expected VT_I4\n", V_VT(&size));
ok(V_I4(&size) == 0, "V_I4(&size) = %d, expected 0\n", V_I4(&size));
IFile_Release(file);
hr = IFileSystem3_DeleteFile(fs3, path, FALSE);
ok(hr==CTL_E_PERMISSIONDENIED || broken(hr==S_OK),
"DeleteFile returned %x, expected CTL_E_PERMISSIONDENIED\n", hr);
if(hr != S_OK) {
hr = IFileSystem3_DeleteFile(fs3, path, TRUE);
ok(hr == S_OK, "DeleteFile returned %x, expected S_OK\n", hr);
}
hr = IFileSystem3_DeleteFile(fs3, path, TRUE);
ok(hr == CTL_E_FILENOTFOUND, "DeleteFile returned %x, expected CTL_E_FILENOTFOUND\n", hr);
SysFreeString(path);
}
static inline BOOL create_file(const WCHAR *name)
{
HANDLE f = CreateFileW(name, GENERIC_WRITE, 0, NULL, CREATE_NEW, 0, NULL);
CloseHandle(f);
return f != INVALID_HANDLE_VALUE;
}
static inline void create_path(const WCHAR *folder, const WCHAR *name, WCHAR *ret)
{
DWORD len = lstrlenW(folder);
memmove(ret, folder, len*sizeof(WCHAR));
ret[len] = '\\';
memmove(ret+len+1, name, (lstrlenW(name)+1)*sizeof(WCHAR));
}
static void test_CopyFolder(void)
{
static const WCHAR filesystem3_dir[] = {'f','i','l','e','s','y','s','t','e','m','3','_','t','e','s','t',0};
static const WCHAR s1[] = {'s','r','c','1',0};
static const WCHAR s[] = {'s','r','c','*',0};
static const WCHAR d[] = {'d','s','t',0};
static const WCHAR empty[] = {0};
WCHAR tmp[MAX_PATH];
BSTR bsrc, bdst;
HRESULT hr;
if(!CreateDirectoryW(filesystem3_dir, NULL)) {
skip("can't create temporary directory\n");
return;
}
create_path(filesystem3_dir, s1, tmp);
bsrc = SysAllocString(tmp);
create_path(filesystem3_dir, d, tmp);
bdst = SysAllocString(tmp);
hr = IFileSystem3_CopyFile(fs3, bsrc, bdst, VARIANT_TRUE);
ok(hr == CTL_E_FILENOTFOUND, "CopyFile returned %x, expected CTL_E_FILENOTFOUND\n", hr);
hr = IFileSystem3_CopyFolder(fs3, bsrc, bdst, VARIANT_TRUE);
ok(hr == CTL_E_PATHNOTFOUND, "CopyFolder returned %x, expected CTL_E_PATHNOTFOUND\n", hr);
ok(create_file(bsrc), "can't create %s file\n", wine_dbgstr_w(bsrc));
hr = IFileSystem3_CopyFile(fs3, bsrc, bdst, VARIANT_TRUE);
ok(hr == S_OK, "CopyFile returned %x, expected S_OK\n", hr);
hr = IFileSystem3_CopyFolder(fs3, bsrc, bdst, VARIANT_TRUE);
ok(hr == CTL_E_PATHNOTFOUND, "CopyFolder returned %x, expected CTL_E_PATHNOTFOUND\n", hr);
hr = IFileSystem3_DeleteFile(fs3, bsrc, VARIANT_FALSE);
ok(hr == S_OK, "DeleteFile returned %x, expected S_OK\n", hr);
ok(CreateDirectoryW(bsrc, NULL), "can't create %s\n", wine_dbgstr_w(bsrc));
hr = IFileSystem3_CopyFile(fs3, bsrc, bdst, VARIANT_TRUE);
ok(hr == CTL_E_FILENOTFOUND, "CopyFile returned %x, expected CTL_E_FILENOTFOUND\n", hr);
hr = IFileSystem3_CopyFolder(fs3, bsrc, bdst, VARIANT_TRUE);
ok(hr == CTL_E_FILEALREADYEXISTS, "CopyFolder returned %x, expected CTL_E_FILEALREADYEXISTS\n", hr);
hr = IFileSystem3_DeleteFile(fs3, bdst, VARIANT_TRUE);
ok(hr == S_OK, "DeleteFile returned %x, expected S_OK\n", hr);
hr = IFileSystem3_CopyFolder(fs3, bsrc, bdst, VARIANT_TRUE);
ok(hr == S_OK, "CopyFolder returned %x, expected S_OK\n", hr);
hr = IFileSystem3_CopyFolder(fs3, bsrc, bdst, VARIANT_TRUE);
ok(hr == S_OK, "CopyFolder returned %x, expected S_OK\n", hr);
create_path(tmp, s1, tmp);
ok(GetFileAttributesW(tmp) == INVALID_FILE_ATTRIBUTES,
"%s file exists\n", wine_dbgstr_w(tmp));
create_path(filesystem3_dir, d, tmp);
create_path(tmp, empty, tmp);
SysFreeString(bdst);
bdst = SysAllocString(tmp);
hr = IFileSystem3_CopyFolder(fs3, bsrc, bdst, VARIANT_TRUE);
ok(hr == S_OK, "CopyFolder returned %x, expected S_OK\n", hr);
create_path(tmp, s1, tmp);
ok(GetFileAttributesW(tmp) != INVALID_FILE_ATTRIBUTES,
"%s directory doesn't exist\n", wine_dbgstr_w(tmp));
ok(RemoveDirectoryW(tmp), "can't remove %s directory\n", wine_dbgstr_w(tmp));
create_path(filesystem3_dir, d, tmp);
SysFreeString(bdst);
bdst = SysAllocString(tmp);
create_path(filesystem3_dir, s, tmp);
SysFreeString(bsrc);
bsrc = SysAllocString(tmp);
hr = IFileSystem3_CopyFolder(fs3, bsrc, bdst, VARIANT_TRUE);
ok(hr == S_OK, "CopyFolder returned %x, expected S_OK\n", hr);
create_path(filesystem3_dir, d, tmp);
create_path(tmp, s1, tmp);
ok(GetFileAttributesW(tmp) != INVALID_FILE_ATTRIBUTES,
"%s directory doesn't exist\n", wine_dbgstr_w(tmp));
hr = IFileSystem3_DeleteFolder(fs3, bdst, VARIANT_FALSE);
ok(hr == S_OK, "DeleteFolder returned %x, expected S_OK\n", hr);
hr = IFileSystem3_CopyFolder(fs3, bsrc, bdst, VARIANT_TRUE);
ok(hr == CTL_E_PATHNOTFOUND, "CopyFolder returned %x, expected CTL_E_PATHNOTFOUND\n", hr);
create_path(filesystem3_dir, s1, tmp);
SysFreeString(bsrc);
bsrc = SysAllocString(tmp);
create_path(tmp, s1, tmp);
ok(create_file(tmp), "can't create %s file\n", wine_dbgstr_w(tmp));
hr = IFileSystem3_CopyFolder(fs3, bsrc, bdst, VARIANT_FALSE);
ok(hr == S_OK, "CopyFolder returned %x, expected S_OK\n", hr);
hr = IFileSystem3_CopyFolder(fs3, bsrc, bdst, VARIANT_FALSE);
ok(hr == CTL_E_FILEALREADYEXISTS, "CopyFolder returned %x, expected CTL_E_FILEALREADYEXISTS\n", hr);
hr = IFileSystem3_CopyFolder(fs3, bsrc, bdst, VARIANT_TRUE);
ok(hr == S_OK, "CopyFolder returned %x, expected S_OK\n", hr);
SysFreeString(bsrc);
SysFreeString(bdst);
bsrc = SysAllocString(filesystem3_dir);
hr = IFileSystem3_DeleteFolder(fs3, bsrc, VARIANT_FALSE);
ok(hr == S_OK, "DeleteFolder returned %x, expected S_OK\n", hr);
SysFreeString(bsrc);
}
START_TEST(filesystem)
{
HRESULT hr;
CoInitialize(NULL);
hr = CoCreateInstance(&CLSID_FileSystemObject, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER,
&IID_IFileSystem3, (void**)&fs3);
if(FAILED(hr)) {
win_skip("Could not create FileSystem object: %08x\n", hr);
return;
}
test_interfaces();
test_createfolder();
test_textstream();
test_GetFileVersion();
test_GetParentFolderName();
test_GetFileName();
test_GetBaseName();
test_GetAbsolutePathName();
test_GetFile();
test_CopyFolder();
IFileSystem3_Release(fs3);
CoUninitialize();
}

View file

@ -0,0 +1,692 @@
/*
* Copyright (C) 2012 Alistair Leslie-Hughes
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
import "unknwn.idl";
import "objidl.idl";
import "oaidl.idl";
cpp_quote("#ifdef WINE_NO_UNICODE_MACROS")
cpp_quote("#undef CopyFile")
cpp_quote("#undef DeleteFile")
cpp_quote("#undef MoveFile")
cpp_quote("#endif")
[
uuid(420B2830-E718-11CF-893D-00A0C9054228),
version(1.0)
]
library Scripting
{
importlib("stdole2.tlb");
interface IDictionary;
interface IDrive;
interface IDriveCollection;
interface IFile;
interface IFileCollection;
interface IFileSystem;
interface IFileSystem3;
interface IFolder;
interface IFolderCollection;
interface IScriptEncoder;
interface ITextStream;
typedef enum CompareMethod
{
BinaryCompare = 0,
TextCompare = 1,
DatabaseCompare = 2
} CompareMethod;
typedef enum IOMode
{
ForReading = 1,
ForWriting = 2,
ForAppending = 8
} IOMode;
typedef enum Tristate
{
TristateTrue = 0xffffffff,
TristateFalse = 0,
TristateUseDefault = 0xfffffffe,
TristateMixed = 0xfffffffe
} Tristate;
typedef enum FileAttribute
{
Normal = 0,
ReadOnly = 1,
Hidden = 2,
System = 4,
Volume = 8,
Directory = 16,
Archive = 32,
Alias = 1024,
Compressed = 2048
} FileAttribute;
typedef enum SpecialFolderConst
{
WindowsFolder = 0,
SystemFolder = 1,
TemporaryFolder = 2
} SpecialFolderConst;
typedef enum DriveTypeConst
{
UnknownType = 0,
Removable = 1,
Fixed = 2,
Remote = 3,
CDRom = 4,
RamDisk = 5
} DriveTypeConst;
typedef enum StandardStreamTypes
{
StdIn = 0,
StdOut = 1,
StdErr = 2
} StandardStreamTypes;
[
odl,
uuid(42C642C1-97E1-11CF-978F-00A02463E06F),
hidden,
dual,
oleautomation
]
interface IDictionary : IDispatch
{
[id(00000000), propputref]
HRESULT Item([in] VARIANT* Key, [in] VARIANT* pRetItem);
[id(00000000), propput]
HRESULT Item([in] VARIANT* Key, [in] VARIANT* pRetItem);
[id(00000000), propget]
HRESULT Item([in] VARIANT* Key, [out, retval] VARIANT* pRetItem);
[id(0x00000001)]
HRESULT Add([in] VARIANT* Key, [in] VARIANT* Item);
[id(0x00000002), propget]
HRESULT Count([out, retval] long* pCount);
[id(0x00000003)]
HRESULT Exists([in] VARIANT* Key, [out, retval] VARIANT_BOOL* pExists);
[id(0x00000004)]
HRESULT Items([out, retval] VARIANT* pItemsArray);
[id(0x00000005), propput]
HRESULT Key([in] VARIANT* Key, [in] VARIANT* rhs);
[id(0x00000006)]
HRESULT Keys([out, retval] VARIANT* pKeysArray);
[id(0x00000007)]
HRESULT Remove([in] VARIANT* Key);
[id(0x00000008)]
HRESULT RemoveAll();
[id(0x00000009), propput]
HRESULT CompareMode([in] CompareMethod pcomp);
[id(0x00000009), propget]
HRESULT CompareMode([out, retval] CompareMethod* pcomp);
[id(DISPID_NEWENUM), restricted]
HRESULT _NewEnum([out, retval] IUnknown** ppunk);
[id(0x0000000a), propget, hidden]
HRESULT HashVal([in] VARIANT* Key, [out, retval] VARIANT* HashVal);
}
[
odl,
uuid(0AB5A3D0-E5B6-11D0-ABF5-00A0C90FFFC0),
hidden,
dual,
nonextensible,
oleautomation
]
interface IFileSystem : IDispatch
{
[id(0x0000271a), propget]
HRESULT Drives([out, retval] IDriveCollection** ppdrives);
[id(0x00002710)]
HRESULT BuildPath([in] BSTR Path, [in] BSTR Name, [out, retval] BSTR* pbstrResult);
[id(0x00002714)]
HRESULT GetDriveName([in] BSTR Path, [out, retval] BSTR* pbstrResult);
[id(0x00002715)]
HRESULT GetParentFolderName([in] BSTR Path, [out, retval] BSTR* pbstrResult);
[id(0x00002716)]
HRESULT GetFileName([in] BSTR Path, [out, retval] BSTR* pbstrResult);
[id(0x00002717)]
HRESULT GetBaseName([in] BSTR Path, [out, retval] BSTR* pbstrResult);
[id(0x00002718)]
HRESULT GetExtensionName([in] BSTR Path, [out, retval] BSTR* pbstrResult);
[id(0x00002712)]
HRESULT GetAbsolutePathName([in] BSTR Path, [out, retval] BSTR* pbstrResult);
[id(0x00002713)]
HRESULT GetTempName([out, retval] BSTR* pbstrResult);
[id(0x0000271f)]
HRESULT DriveExists([in] BSTR DriveSpec, [out, retval] VARIANT_BOOL* pfExists);
[id(0x00002720)]
HRESULT FileExists([in] BSTR FileSpec, [out, retval] VARIANT_BOOL* pfExists);
[id(0x00002721)]
HRESULT FolderExists([in] BSTR FolderSpec, [out, retval] VARIANT_BOOL* pfExists);
[id(0x0000271b)]
HRESULT GetDrive([in] BSTR DriveSpec, [out, retval] IDrive** ppdrive);
[id(0x0000271c)]
HRESULT GetFile([in] BSTR FilePath, [out, retval] IFile** ppfile);
[id(0x0000271d)]
HRESULT GetFolder([in] BSTR FolderPath, [out, retval] IFolder** ppfolder);
[id(0x0000271e)]
HRESULT GetSpecialFolder([in] SpecialFolderConst SpecialFolder, [out, retval] IFolder** ppfolder);
[id(0x000004b0)]
HRESULT DeleteFile([in] BSTR FileSpec, [in, optional, defaultvalue(0)] VARIANT_BOOL Force);
[id(0x000004b1)]
HRESULT DeleteFolder([in] BSTR FolderSpec, [in, optional, defaultvalue(0)] VARIANT_BOOL Force);
[id(0x000004b4), helpstring("Move a file"), helpcontext(0x00214bab)]
HRESULT MoveFile([in] BSTR Source, [in] BSTR Destination);
[id(0x000004b5)]
HRESULT MoveFolder([in] BSTR Source, [in] BSTR Destination);
[id(0x000004b2)]
HRESULT CopyFile([in] BSTR Source, [in] BSTR Destination,
[in, optional, defaultvalue(-1)] VARIANT_BOOL OverWriteFiles);
[id(0x000004b3)]
HRESULT CopyFolder([in] BSTR Source, [in] BSTR Destination,
[in, optional, defaultvalue(-1)] VARIANT_BOOL OverWriteFiles);
[id(0x00000460)]
HRESULT CreateFolder([in] BSTR Path, [out, retval] IFolder** ppfolder);
[id(0x0000044d)]
HRESULT CreateTextFile([in] BSTR FileName, [in, optional, defaultvalue(-1)] VARIANT_BOOL Overwrite,
[in, optional, defaultvalue(0)] VARIANT_BOOL Unicode, [out, retval] ITextStream** ppts);
[id(0x0000044c)]
HRESULT OpenTextFile([in] BSTR FileName, [in, optional, defaultvalue(1)] IOMode IOMode,
[in, optional, defaultvalue(0)] VARIANT_BOOL Create,
[in, optional, defaultvalue(0)] Tristate Format,
[out, retval] ITextStream** ppts);
}
[
odl,
uuid(C7C3F5A1-88A3-11D0-ABCB-00A0C90FFFC0),
hidden,
dual,
nonextensible,
oleautomation
]
interface IDriveCollection : IDispatch {
[id(00000000)]
HRESULT Item([in] VARIANT Key, [out, retval] IDrive** ppdrive);
[id(DISPID_NEWENUM), propget, restricted, hidden]
HRESULT _NewEnum([out, retval] IUnknown** ppenum);
[id(0x00000001), propget]
HRESULT Count([out, retval] long* plCount);
}
[
odl,
uuid(C7C3F5A0-88A3-11D0-ABCB-00A0C90FFFC0),
hidden,
dual,
nonextensible,
oleautomation
]
interface IDrive : IDispatch
{
[id(00000000), propget]
HRESULT Path([out, retval] BSTR* pbstrPath);
[id(0x00002710), propget]
HRESULT DriveLetter([out, retval] BSTR* pbstrLetter)
;
[id(0x00002711), propget]
HRESULT ShareName([out, retval] BSTR* pbstrShareName);
[id(0x00002712), propget]
HRESULT DriveType([out, retval] DriveTypeConst* pdt);
[id(0x00002713), propget]
HRESULT RootFolder([out, retval] IFolder** ppfolder);
[id(0x00002715), propget]
HRESULT AvailableSpace([out, retval] VARIANT* pvarAvail);
[id(0x00002714), propget]
HRESULT FreeSpace([out, retval] VARIANT* pvarFree);
[id(0x00002716), propget]
HRESULT TotalSize([out, retval] VARIANT* pvarTotal);
[id(0x00002717), propget]
HRESULT VolumeName([out, retval] BSTR* pbstrName);
[id(0x00002717), propput]
HRESULT VolumeName([in] BSTR pbstrName);
[id(0x00002718), propget]
HRESULT FileSystem([out, retval] BSTR* pbstrFileSystem);
[id(0x00002719), propget]
HRESULT SerialNumber([out, retval] long* pulSerialNumber);
[id(0x0000271a), propget]
HRESULT IsReady([out, retval] VARIANT_BOOL* pfReady);
}
[
odl,
uuid(C7C3F5A2-88A3-11D0-ABCB-00A0C90FFFC0),
hidden,
dual,
nonextensible,
oleautomation
]
interface IFolder : IDispatch
{
[id(00000000), propget]
HRESULT Path([out, retval] BSTR* pbstrPath);
[id(0x000003e8), propget]
HRESULT Name([out, retval] BSTR* pbstrName);
[id(0x000003e8), propput]
HRESULT Name([in] BSTR pbstrName);
[id(0x000003ea), propget]
HRESULT ShortPath([out, retval] BSTR* pbstrPath);
[id(0x000003e9), propget]
HRESULT ShortName([out, retval] BSTR* pbstrName);
[id(0x000003ec), propget]
HRESULT Drive([out, retval] IDrive** ppdrive);
[id(0x000003ed), propget]
HRESULT ParentFolder([out, retval] IFolder** ppfolder);
[id(0x000003eb), propget]
HRESULT Attributes([out, retval] FileAttribute* pfa);
[id(0x000003eb), propput]
HRESULT Attributes([in] FileAttribute pfa);
[id(0x000003ee), propget]
HRESULT DateCreated([out, retval] DATE* pdate);
[id(0x000003ef), propget]
HRESULT DateLastModified([out, retval] DATE* pdate);
[id(0x000003f0), propget]
HRESULT DateLastAccessed([out, retval] DATE* pdate);
[id(0x000003f2), propget]
HRESULT Type([out, retval] BSTR* pbstrType);
[id(0x000004b1)]
HRESULT Delete([in, optional, defaultvalue(0)] VARIANT_BOOL Force);
[id(0x000004b3)]
HRESULT Copy([in] BSTR Destination, [in, optional, defaultvalue(-1)] VARIANT_BOOL OverWriteFiles);
[id(0x000004b5)]
HRESULT Move([in] BSTR Destination);
[id(0x00002710), propget]
HRESULT IsRootFolder([out, retval] VARIANT_BOOL* pfRootFolder);
[id(0x000003f1), propget]
HRESULT Size([out, retval] VARIANT* pvarSize);
[id(0x00002711), propget]
HRESULT SubFolders([out, retval] IFolderCollection** ppfolders);
[id(0x00002712), propget]
HRESULT Files([out, retval] IFileCollection** ppfiles);
[id(0x0000044d)]
HRESULT CreateTextFile([in] BSTR FileName, [in, optional, defaultvalue(-1)] VARIANT_BOOL Overwrite,
[in, optional, defaultvalue(0)] VARIANT_BOOL Unicode, [out, retval] ITextStream** ppts);
}
[
odl,
uuid(C7C3F5A3-88A3-11D0-ABCB-00A0C90FFFC0),
hidden,
dual,
nonextensible,
oleautomation
]
interface IFolderCollection : IDispatch
{
[id(0x00000002)]
HRESULT Add([in] BSTR Name, [out, retval] IFolder** ppfolder);
[id(00000000), propget]
HRESULT Item([in] VARIANT Key, [out, retval] IFolder** ppfolder);
[id(DISPID_NEWENUM), propget, restricted, hidden]
HRESULT _NewEnum([out, retval] IUnknown** ppenum);
[id(0x00000001), propget]
HRESULT Count([out, retval] long* plCount);
}
[
odl,
uuid(C7C3F5A5-88A3-11D0-ABCB-00A0C90FFFC0),
hidden,
dual,
nonextensible,
oleautomation
]
interface IFileCollection : IDispatch
{
[id(00000000), propget]
HRESULT Item([in] VARIANT Key, [out, retval] IFile** ppfile);
[id(DISPID_NEWENUM), propget, restricted, hidden]
HRESULT _NewEnum([out, retval] IUnknown** ppenum);
[id(0x00000001), propget]
HRESULT Count([out, retval] long* plCount);
}
[
odl,
uuid(C7C3F5A4-88A3-11D0-ABCB-00A0C90FFFC0),
hidden,
dual,
nonextensible,
oleautomation
]
interface IFile : IDispatch
{
[id(00000000), propget]
HRESULT Path([out, retval] BSTR* pbstrPath);
[id(0x000003e8), propget]
HRESULT Name([out, retval] BSTR* pbstrName);
[id(0x000003e8), propput]
HRESULT Name([in] BSTR pbstrName);
[id(0x000003ea), propget]
HRESULT ShortPath([out, retval] BSTR* pbstrPath);
[id(0x000003e9), propget]
HRESULT ShortName([out, retval] BSTR* pbstrName);
[id(0x000003ec), propget]
HRESULT Drive([out, retval] IDrive** ppdrive);
[id(0x000003ed), propget]
HRESULT ParentFolder([out, retval] IFolder** ppfolder);
[id(0x000003eb), propget]
HRESULT Attributes([out, retval] FileAttribute* pfa);
[id(0x000003eb), propput]
HRESULT Attributes([in] FileAttribute pfa);
[id(0x000003ee), propget]
HRESULT DateCreated([out, retval] DATE* pdate);
[id(0x000003ef), propget]
HRESULT DateLastModified([out, retval] DATE* pdate);
[id(0x000003f0), propget]
HRESULT DateLastAccessed([out, retval] DATE* pdate);
[id(0x000003f1), propget]
HRESULT Size([out, retval] VARIANT* pvarSize);
[id(0x000003f2), propget]
HRESULT Type([out, retval] BSTR* pbstrType);
[id(0x000004b0)]
HRESULT Delete([in, optional, defaultvalue(0)] VARIANT_BOOL Force);
[id(0x000004b2)]
HRESULT Copy([in] BSTR Destination, [in, optional, defaultvalue(-1)] VARIANT_BOOL OverWriteFiles);
[id(0x000004b4)]
HRESULT Move([in] BSTR Destination);
[id(0x0000044c)]
HRESULT OpenAsTextStream([in, optional, defaultvalue(1)] IOMode IOMode,
[in, optional, defaultvalue(0)] Tristate Format, [out, retval] ITextStream** ppts);
}
[
odl,
uuid(53BAD8C1-E718-11CF-893D-00A0C9054228),
hidden,
dual,
nonextensible,
oleautomation
]
interface ITextStream : IDispatch
{
[id(0x00002710), propget]
HRESULT Line([out, retval] long* Line);
[id(0xfffffdef), propget]
HRESULT Column([out, retval] long* Column);
[id(0x00002712), propget]
HRESULT AtEndOfStream([out, retval] VARIANT_BOOL* EOS);
[id(0x00002713), propget]
HRESULT AtEndOfLine([out, retval] VARIANT_BOOL* EOL);
[id(0x00002714)]
HRESULT Read([in] long Characters, [out, retval] BSTR* Text);
[id(0x00002715)]
HRESULT ReadLine([out, retval] BSTR* Text);
[id(0x00002716)]
HRESULT ReadAll([out, retval] BSTR* Text);
[id(0x00002717)]
HRESULT Write([in] BSTR Text);
[id(0x00002718)]
HRESULT WriteLine([in, optional, defaultvalue("")] BSTR Text);
[id(0x00002719)]
HRESULT WriteBlankLines([in] long Lines);
[id(0x0000271a)]
HRESULT Skip([in] long Characters);
[id(0x0000271b)]
HRESULT SkipLine();
[id(0x0000271c)]
HRESULT Close();
}
[
odl,
uuid(2A0B9D10-4B87-11D3-A97A-00104B365C9F),
dual,
nonextensible,
oleautomation
]
interface IFileSystem3 : IFileSystem
{
[id(0x00004e20)]
HRESULT GetStandardStream([in] StandardStreamTypes StandardStreamType,
[in, optional, defaultvalue(0)] VARIANT_BOOL Unicode, [out, retval] ITextStream** ppts);
[id(0x00004e2a)]
HRESULT GetFileVersion([in] BSTR FileName, [out, retval] BSTR* FileVersion);
}
[
odl,
uuid(AADC65F6-CFF1-11D1-B747-00C04FC2B085),
dual,
oleautomation
]
interface IScriptEncoder : IDispatch
{
[id(00000000)]
HRESULT EncodeScriptFile([in] BSTR szExt, [in] BSTR bstrStreamIn, [in] long cFlags,
[in] BSTR bstrDefaultLang, [out, retval] BSTR* pbstrStreamOut);
}
[
uuid(EE09B103-97E0-11CF-978F-00A02463E06F),
version(1.0),
helpstring("Scripting.Dictionary"),
threading(apartment),
progid("Scripting.Dictionary")
]
coclass Dictionary
{
[default] interface IDictionary;
}
[
uuid(0D43FE01-F093-11CF-8940-00A0C9054228),
version(1.0),
helpstring("FileSystem Object"),
threading(both),
progid("Scripting.FileSystemObject")
]
coclass FileSystemObject
{
[default] interface IFileSystem3;
}
[
uuid(C7C3F5B1-88A3-11D0-ABCB-00A0C90FFFC0),
noncreatable,
version(1.0)
]
coclass Drive
{
[default] interface IDrive;
}
[
uuid(C7C3F5B2-88A3-11D0-ABCB-00A0C90FFFC0),
noncreatable,
version(1.0)
]
coclass Drives
{
[default] interface IDriveCollection;
}
[
uuid(C7C3F5B3-88A3-11D0-ABCB-00A0C90FFFC0),
noncreatable,
version(1.0)
]
coclass Folder
{
[default] interface IFolder;
}
[
uuid(C7C3F5B4-88A3-11D0-ABCB-00A0C90FFFC0),
noncreatable,
version(1.0)
]
coclass Folders
{
[default] interface IFolderCollection;
}
[
uuid(C7C3F5B5-88A3-11D0-ABCB-00A0C90FFFC0),
noncreatable,
version(1.0)
]
coclass File
{
[default] interface IFile;
}
[
uuid(C7C3F5B6-88A3-11D0-ABCB-00A0C90FFFC0),
noncreatable,
version(1.0)
]
coclass Files
{
[default] interface IFileCollection;
}
[
uuid(0BB02EC0-EF49-11CF-8940-00A0C9054228),
noncreatable,
version(1.0)
]
coclass TextStream
{
[default] interface ITextStream;
}
[
uuid(32DA2B15-CFED-11D1-B747-00C04FC2B085),
version(1.0),
helpstring("Script Encoder Object"),
threading(apartment),
progid("Scripting.Encoder")
]
coclass Encoder
{
[default] interface IScriptEncoder;
}
}

View file

@ -0,0 +1,14 @@
/* Automatically generated file; DO NOT EDIT!! */
#define STANDALONE
#include <wine/test.h>
extern void func_dictionary(void);
extern void func_filesystem(void);
const struct test winetest_testlist[] =
{
{ "dictionary", func_dictionary },
{ "filesystem", func_filesystem },
{ 0, 0 }
};