ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
September 2013
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
16 participants
554 discussions
Start a n
N
ew thread
[akhaldi] 60076: [WINE/TEST] * Make win_skip work for ReactOS test platform too.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Fri Sep 13 10:54:12 2013 New Revision: 60076 URL:
http://svn.reactos.org/svn/reactos?rev=60076&view=rev
Log: [WINE/TEST] * Make win_skip work for ReactOS test platform too. Modified: trunk/reactos/include/reactos/wine/test.h Modified: trunk/reactos/include/reactos/wine/test.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/wine/test.…
============================================================================== --- trunk/reactos/include/reactos/wine/test.h [iso-8859-1] (original) +++ trunk/reactos/include/reactos/wine/test.h [iso-8859-1] Fri Sep 13 10:54:12 2013 @@ -410,7 +410,7 @@ { __winetest_va_list valist; __winetest_va_start(valist, msg); - if (strcmp(winetest_platform, "windows") == 0) + if ((strcmp(winetest_platform, "windows") == 0) || (strcmp(winetest_platform, "reactos") == 0)) winetest_vskip(msg, valist); else winetest_vok(0, msg, valist);
11 years, 3 months
1
0
0
0
[akhaldi] 60075: [SCRRUN_WINETEST] * Import from Wine 1.7.1.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Fri Sep 13 10:19:51 2013 New Revision: 60075 URL:
http://svn.reactos.org/svn/reactos?rev=60075&view=rev
Log: [SCRRUN_WINETEST] * Import from Wine 1.7.1. Added: trunk/rostests/winetests/scrrun/ trunk/rostests/winetests/scrrun/CMakeLists.txt (with props) trunk/rostests/winetests/scrrun/dictionary.c (with props) trunk/rostests/winetests/scrrun/filesystem.c (with props) trunk/rostests/winetests/scrrun/scrrun.idl (with props) trunk/rostests/winetests/scrrun/testlist.c (with props) Modified: trunk/rostests/winetests/CMakeLists.txt Modified: trunk/rostests/winetests/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/CMakeLists.txt?…
============================================================================== --- trunk/rostests/winetests/CMakeLists.txt [iso-8859-1] (original) +++ trunk/rostests/winetests/CMakeLists.txt [iso-8859-1] Fri Sep 13 10:19:51 2013 @@ -72,6 +72,7 @@ add_subdirectory(rsabase) add_subdirectory(rsaenh) add_subdirectory(schannel) +add_subdirectory(scrrun) add_subdirectory(secur32) add_subdirectory(serialui) add_subdirectory(services) Added: trunk/rostests/winetests/scrrun/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/scrrun/CMakeLis…
============================================================================== --- trunk/rostests/winetests/scrrun/CMakeLists.txt (added) +++ trunk/rostests/winetests/scrrun/CMakeLists.txt [iso-8859-1] Fri Sep 13 10:19:51 2013 @@ -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) Propchange: trunk/rostests/winetests/scrrun/CMakeLists.txt ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/rostests/winetests/scrrun/dictionary.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/scrrun/dictiona…
============================================================================== --- trunk/rostests/winetests/scrrun/dictionary.c (added) +++ trunk/rostests/winetests/scrrun/dictionary.c [iso-8859-1] Fri Sep 13 10:19:51 2013 @@ -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(); +} Propchange: trunk/rostests/winetests/scrrun/dictionary.c ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/rostests/winetests/scrrun/filesystem.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/scrrun/filesyst…
============================================================================== --- trunk/rostests/winetests/scrrun/filesystem.c (added) +++ trunk/rostests/winetests/scrrun/filesystem.c [iso-8859-1] Fri Sep 13 10:19:51 2013 @@ -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(); +} Propchange: trunk/rostests/winetests/scrrun/filesystem.c ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/rostests/winetests/scrrun/scrrun.idl URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/scrrun/scrrun.i…
============================================================================== --- trunk/rostests/winetests/scrrun/scrrun.idl (added) +++ trunk/rostests/winetests/scrrun/scrrun.idl [iso-8859-1] Fri Sep 13 10:19:51 2013 @@ -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; + } +} Propchange: trunk/rostests/winetests/scrrun/scrrun.idl ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/rostests/winetests/scrrun/testlist.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/scrrun/testlist…
============================================================================== --- trunk/rostests/winetests/scrrun/testlist.c (added) +++ trunk/rostests/winetests/scrrun/testlist.c [iso-8859-1] Fri Sep 13 10:19:51 2013 @@ -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 } +}; Propchange: trunk/rostests/winetests/scrrun/testlist.c ------------------------------------------------------------------------------ svn:eol-style = native
11 years, 3 months
1
0
0
0
[akhaldi] 60074: [WINE/TEST] * Introduce a way to properly mark the todos instead of counting them as failures. Brought to you by Thomas Faber.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Fri Sep 13 09:20:52 2013 New Revision: 60074 URL:
http://svn.reactos.org/svn/reactos?rev=60074&view=rev
Log: [WINE/TEST] * Introduce a way to properly mark the todos instead of counting them as failures. Brought to you by Thomas Faber. Modified: trunk/reactos/boot/bootdata/bootcdregtest/regtest.cmd trunk/reactos/include/reactos/wine/test.h Modified: trunk/reactos/boot/bootdata/bootcdregtest/regtest.cmd URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/bootcdregtes…
============================================================================== --- trunk/reactos/boot/bootdata/bootcdregtest/regtest.cmd [iso-8859-1] (original) +++ trunk/reactos/boot/bootdata/bootcdregtest/regtest.cmd [iso-8859-1] Fri Sep 13 09:20:52 2013 @@ -1,5 +1,6 @@ @echo off set WINETEST_DEBUG=0 +set WINETEST_PLATFORM=reactos if exist "C:\ReactOS\bin\AHKAppTests.cmd" ( dbgprint "Preparing AHK Application testing suite." Modified: trunk/reactos/include/reactos/wine/test.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/wine/test.…
============================================================================== --- trunk/reactos/include/reactos/wine/test.h [iso-8859-1] (original) +++ trunk/reactos/include/reactos/wine/test.h [iso-8859-1] Fri Sep 13 09:20:52 2013 @@ -137,7 +137,13 @@ #define todo(platform) for (winetest_start_todo(platform); \ winetest_loop_todo(); \ winetest_end_todo(platform)) + +#define todo_ros todo("reactos") +#ifdef USE_WINE_TODOS +#define todo_wine todo_ros +#else #define todo_wine todo("wine") +#endif #ifdef NONAMELESSUNION
11 years, 3 months
1
0
0
0
[akhaldi] 60073: [KERNEL32] * Silence some debug prints.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Fri Sep 13 09:02:56 2013 New Revision: 60073 URL:
http://svn.reactos.org/svn/reactos?rev=60073&view=rev
Log: [KERNEL32] * Silence some debug prints. Modified: trunk/reactos/dll/win32/kernel32/client/path.c trunk/reactos/dll/win32/kernel32/client/proc.c Modified: trunk/reactos/dll/win32/kernel32/client/path.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/path.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/path.c [iso-8859-1] Fri Sep 13 09:02:56 2013 @@ -401,7 +401,7 @@ BaseComputeProcessExePath(IN LPWSTR FullPath) { PBASE_SEARCH_PATH_TYPE PathOrder; - DPRINT1("Computing EXE path: %S\n", FullPath); + DPRINT("Computing EXE path: %S\n", FullPath); /* Check if we should use the current directory */ PathOrder = NeedCurrentDirectoryForExePathW(FullPath) ? Modified: trunk/reactos/dll/win32/kernel32/client/proc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/proc.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/proc.c [iso-8859-1] Fri Sep 13 09:02:56 2013 @@ -629,14 +629,14 @@ /* Create the Parameter Block */ ProcessParameters = NULL; - DPRINT1("ImageName: '%wZ'\n", &ImageName); - DPRINT1("DllPath : '%wZ'\n", &DllPath); - DPRINT1("CurDir : '%wZ'\n", &CurrentDirectory); - DPRINT1("CmdLine : '%wZ'\n", &CommandLine); - DPRINT1("Title : '%wZ'\n", &Title); - DPRINT1("Desktop : '%wZ'\n", &Desktop); - DPRINT1("Shell : '%wZ'\n", &Shell); - DPRINT1("Runtime : '%wZ'\n", &Runtime); + DPRINT("ImageName: '%wZ'\n", &ImageName); + DPRINT("DllPath : '%wZ'\n", &DllPath); + DPRINT("CurDir : '%wZ'\n", &CurrentDirectory); + DPRINT("CmdLine : '%wZ'\n", &CommandLine); + DPRINT("Title : '%wZ'\n", &Title); + DPRINT("Desktop : '%wZ'\n", &Desktop); + DPRINT("Shell : '%wZ'\n", &Shell); + DPRINT("Runtime : '%wZ'\n", &Runtime); Status = RtlCreateProcessParameters(&ProcessParameters, &ImageName, &DllPath, @@ -2468,7 +2468,7 @@ PolicyPathPair.Nt = &SxsNtPolicyPath.String; #endif - DPRINT1("CreateProcessInternalW: %S %S %lx\n", lpApplicationName, lpCommandLine, dwCreationFlags); + DPRINT("CreateProcessInternalW: %S %S %lx\n", lpApplicationName, lpCommandLine, dwCreationFlags); /* Finally, set our TEB and PEB */ Teb = NtCurrentTeb(); @@ -2710,7 +2710,7 @@ /* Now compute the final EXE path based on the name */ SearchPath = BaseComputeProcessExePath((LPWSTR)lpApplicationName); - DPRINT1("Search Path: %S\n", SearchPath); + DPRINT("Search Path: %S\n", SearchPath); if (!SearchPath) { SetLastError(ERROR_NOT_ENOUGH_MEMORY); @@ -2744,7 +2744,7 @@ } } - DPRINT1("Length: %lu Buffer: %S\n", Length, NameBuffer); + DPRINT("Length: %lu Buffer: %S\n", Length, NameBuffer); /* Check if there was a failure in SearchPathW */ if ((Length) && (Length < MAX_PATH)) @@ -2891,7 +2891,7 @@ } /* Now use the path name, and the root path, to try opening the app */ - DPRINT1("Path: %wZ. Dir: %p\n", &PathName, SxsWin32RelativePath.ContainingDirectory); + DPRINT("Path: %wZ. Dir: %p\n", &PathName, SxsWin32RelativePath.ContainingDirectory); InitializeObjectAttributes(&LocalObjectAttributes, &PathName, OBJ_CASE_INSENSITIVE, @@ -2956,7 +2956,7 @@ PAGE_EXECUTE, SEC_IMAGE, FileHandle); - DPRINT1("Section status: %lx\n", Status); + DPRINT("Section status: %lx\n", Status); if (NT_SUCCESS(Status)) { /* Are we running on Windows Embedded, Datacenter, Blade or Starter? */
11 years, 3 months
1
0
0
0
[ion] 60072: [NPFS-NEW]: Activate NPFS-NEW. Let's see what happens.
by ion@svn.reactos.org
Author: ion Date: Fri Sep 13 08:01:10 2013 New Revision: 60072 URL:
http://svn.reactos.org/svn/reactos?rev=60072&view=rev
Log: [NPFS-NEW]: Activate NPFS-NEW. Let's see what happens. Modified: trunk/reactos/dll/win32/kernel32/client/file/npipe.c trunk/reactos/drivers/filesystems/CMakeLists.txt trunk/reactos/drivers/filesystems/npfs_new/CMakeLists.txt Modified: trunk/reactos/dll/win32/kernel32/client/file/npipe.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/file/npipe.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/file/npipe.c [iso-8859-1] Fri Sep 13 08:01:10 2013 @@ -13,8 +13,6 @@ #define NDEBUG #include <debug.h> DEBUG_CHANNEL(kernel32file); - -//#define USING_PROPER_NPFS_WAIT_SEMANTICS /* GLOBALS ********************************************************************/ @@ -151,7 +149,6 @@ lpSecurityAttributes); } - /* * @implemented */ @@ -339,7 +336,6 @@ return PipeHandle; } - /* * @implemented */ @@ -364,17 +360,6 @@ return r; } - -/* - * When NPFS will work properly, use this code instead. It is compatible with - * Microsoft's NPFS.SYS. The main difference is that: - * - This code actually respects the timeout instead of ignoring it! - * - This code validates and creates the proper names for both UNC and local pipes - * - On NT, you open the *root* pipe directory (either \DosDevices\Pipe or - * \DosDevices\Unc\Server\Pipe) and then send the pipe to wait on in the - * FILE_PIPE_WAIT_FOR_BUFFER structure. - */ -#ifdef USING_PROPER_NPFS_WAIT_SEMANTICS /* * @implemented */ @@ -559,96 +544,6 @@ /* Success */ return TRUE; } -#else -/* - * @implemented - */ -BOOL -WINAPI -WaitNamedPipeW(LPCWSTR lpNamedPipeName, - DWORD nTimeOut) -{ - UNICODE_STRING NamedPipeName; - NTSTATUS Status; - OBJECT_ATTRIBUTES ObjectAttributes; - FILE_PIPE_WAIT_FOR_BUFFER WaitPipe; - HANDLE FileHandle; - IO_STATUS_BLOCK Iosb; - - if (RtlDosPathNameToNtPathName_U(lpNamedPipeName, - &NamedPipeName, - NULL, - NULL) == FALSE) - { - return FALSE; - } - - InitializeObjectAttributes(&ObjectAttributes, - &NamedPipeName, - OBJ_CASE_INSENSITIVE, - NULL, - NULL); - Status = NtOpenFile(&FileHandle, - FILE_READ_ATTRIBUTES | SYNCHRONIZE, - &ObjectAttributes, - &Iosb, - FILE_SHARE_READ | FILE_SHARE_WRITE, - FILE_SYNCHRONOUS_IO_NONALERT); - if (!NT_SUCCESS(Status)) - { - BaseSetLastNTError(Status); - RtlFreeUnicodeString(&NamedPipeName); - return FALSE; - } - - /* Check what timeout we got */ - if (nTimeOut == NMPWAIT_WAIT_FOREVER) - { - /* Don't use a timeout */ - WaitPipe.TimeoutSpecified = FALSE; - } - else - { - /* Check if default */ - if (nTimeOut == NMPWAIT_USE_DEFAULT_WAIT) - { - /* Set it to 0 */ - WaitPipe.Timeout.LowPart = 0; - WaitPipe.Timeout.HighPart = 0; - } - else - { - /* Convert to NT format */ - WaitPipe.Timeout.QuadPart = UInt32x32To64(-10000, nTimeOut); - } - - /* In both cases, we do have a timeout */ - WaitPipe.TimeoutSpecified = TRUE; - } - - Status = NtFsControlFile(FileHandle, - NULL, - NULL, - NULL, - &Iosb, - FSCTL_PIPE_WAIT, - &WaitPipe, - sizeof(WaitPipe), - NULL, - 0); - NtClose(FileHandle); - if (!NT_SUCCESS(Status)) - { - BaseSetLastNTError(Status); - RtlFreeUnicodeString(&NamedPipeName); - return FALSE; - } - - RtlFreeUnicodeString(&NamedPipeName); - return TRUE; -} -#endif - /* * @implemented @@ -1305,7 +1200,6 @@ } else { -#if 0 /* We don't implement FSCTL_PIPE_TRANSCEIVE yet */ IO_STATUS_BLOCK Iosb; Status = NtFsControlFile(hNamedPipe, @@ -1339,34 +1233,6 @@ BaseSetLastNTError(Status); return FALSE; } -#else /* Workaround while FSCTL_PIPE_TRANSCEIVE not available */ - DWORD nActualBytes; - - while (0 != nInBufferSize && - WriteFile(hNamedPipe, lpInBuffer, nInBufferSize, &nActualBytes, - NULL)) - { - lpInBuffer = (LPVOID)((char *) lpInBuffer + nActualBytes); - nInBufferSize -= nActualBytes; - } - - if (0 != nInBufferSize) - { - /* Must have dropped out of the while 'cause WriteFile failed */ - return FALSE; - } - - if (!ReadFile(hNamedPipe, lpOutBuffer, nOutBufferSize, &nActualBytes, - NULL)) - { - return FALSE; - } - - if (NULL != lpBytesRead) - { - *lpBytesRead = nActualBytes; - } -#endif } return TRUE; Modified: trunk/reactos/drivers/filesystems/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/CMakeL…
============================================================================== --- trunk/reactos/drivers/filesystems/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/CMakeLists.txt [iso-8859-1] Fri Sep 13 08:01:10 2013 @@ -6,6 +6,5 @@ add_subdirectory(fs_rec) add_subdirectory(msfs) add_subdirectory(mup) -add_subdirectory(npfs) add_subdirectory(npfs_new) add_subdirectory(ntfs) Modified: trunk/reactos/drivers/filesystems/npfs_new/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/npfs_n…
============================================================================== --- trunk/reactos/drivers/filesystems/npfs_new/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/npfs_new/CMakeLists.txt [iso-8859-1] Fri Sep 13 08:01:10 2013 @@ -21,9 +21,9 @@ write.c writesup.c) -add_library(npfs_new SHARED ${SOURCE}) -set_module_type(npfs_new kernelmodedriver) -target_link_libraries(npfs_new ${PSEH_LIB}) -add_importlibs(npfs_new ntoskrnl hal) -add_pch(npfs_new npfs.h) -add_cd_file(TARGET npfs_new DESTINATION reactos/system32/drivers FOR all) +add_library(npfs SHARED ${SOURCE}) +set_module_type(npfs kernelmodedriver) +target_link_libraries(npfs ${PSEH_LIB}) +add_importlibs(npfs ntoskrnl hal) +add_pch(npfs npfs.h) +add_cd_file(TARGET npfs DESTINATION reactos/system32/drivers FOR all)
11 years, 3 months
1
0
0
0
[ion] 60071: [NTOSKRNL]: Activate the pseudo-quota system. It doesnt' do much but at least it can silence the debug spam. I think mike wrote it..
by ion@svn.reactos.org
Author: ion Date: Fri Sep 13 08:00:16 2013 New Revision: 60071 URL:
http://svn.reactos.org/svn/reactos?rev=60071&view=rev
Log: [NTOSKRNL]: Activate the pseudo-quota system. It doesnt' do much but at least it can silence the debug spam. I think mike wrote it.. Modified: trunk/reactos/ntoskrnl/ps/quota.c Modified: trunk/reactos/ntoskrnl/ps/quota.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ps/quota.c?rev=60…
============================================================================== --- trunk/reactos/ntoskrnl/ps/quota.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ps/quota.c [iso-8859-1] Fri Sep 13 08:00:16 2013 @@ -16,15 +16,7 @@ EPROCESS_QUOTA_BLOCK PspDefaultQuotaBlock; - -/* Define this macro to enable quota code testing. Once quota code is */ -/* stable and verified, remove this macro and checks for it. */ -/*#define PS_QUOTA_ENABLE_QUOTA_CODE*/ - - /* PRIVATE FUNCTIONS *******************************************************/ - -#ifdef PS_QUOTA_ENABLE_QUOTA_CODE /* * Private helper to charge the specified process quota. @@ -49,7 +41,9 @@ if (Process->QuotaUsage[PoolIndex] + Amount > Process->QuotaBlock->QuotaEntry[PoolIndex].Limit) { - return STATUS_QUOTA_EXCEEDED; /* caller raises the exception */ + DPRINT1("Quota exceeded, but ROS will let it slide...\n"); + return STATUS_SUCCESS; + //return STATUS_QUOTA_EXCEEDED; /* caller raises the exception */ } InterlockedExchangeAdd((LONG*)&Process->QuotaUsage[PoolIndex], Amount); @@ -62,7 +56,6 @@ return STATUS_SUCCESS; } - /* * Private helper to remove quota charge from the specified process quota. @@ -91,9 +84,6 @@ } } -#endif /* PS_QUOTA_ENABLE_QUOTA_CODE */ - - /* FUNCTIONS ***************************************************************/ VOID @@ -139,6 +129,9 @@ } } +/* + * @implemented + */ NTSTATUS NTAPI PsChargeProcessPageFileQuota(IN PEPROCESS Process, @@ -147,13 +140,7 @@ /* Don't do anything for the system process */ if (Process == PsInitialSystemProcess) return STATUS_SUCCESS; -#ifdef PS_QUOTA_ENABLE_QUOTA_CODE return PspChargeProcessQuotaSpecifiedPool(Process, 2, Amount); -#else - /* Otherwise, not implemented */ - UNIMPLEMENTED; - return STATUS_SUCCESS; -#endif } /* @@ -166,12 +153,7 @@ IN SIZE_T Amount) { NTSTATUS Status; - -#ifdef PS_QUOTA_ENABLE_QUOTA_CODE - /* MS-documented IRQL requirement. Not yet enabled as it */ - /* needs verification that it does not break ReactOS, */ ASSERT(KeGetCurrentIrql() < DISPATCH_LEVEL); -#endif /* Don't do anything for the system process */ if (Process == PsInitialSystemProcess) return; @@ -217,18 +199,13 @@ /* Don't do anything for the system process */ if (Process == PsInitialSystemProcess) return STATUS_SUCCESS; -#ifdef PS_QUOTA_ENABLE_QUOTA_CODE return PspChargeProcessQuotaSpecifiedPool(Process, (PoolType & PAGED_POOL_MASK), Amount); -#else - UNIMPLEMENTED; - return STATUS_SUCCESS; -#endif -} - -/* - * @unimplemented +} + +/* + * @implemented */ VOID NTAPI @@ -236,26 +213,16 @@ IN POOL_TYPE PoolType, IN SIZE_T Amount) { -#ifdef PS_QUOTA_ENABLE_QUOTA_CODE - /* MS-documented IRQL requirement. Not yet enabled as it */ - /* needs verification that it does not break ReactOS, */ - ASSERT(KeGetCurrentIrql() < DISPATCH_LEVEL); -#endif - - /* Don't do anything for the system process */ - if (Process == PsInitialSystemProcess) return; - -#ifdef PS_QUOTA_ENABLE_QUOTA_CODE + /* Don't do anything for the system process */ + if (Process == PsInitialSystemProcess) return; + PspReturnProcessQuotaSpecifiedPool(Process, (PoolType & PAGED_POOL_MASK), Amount); -#else - UNIMPLEMENTED; -#endif -} - -/* - * @unimplemented +} + +/* + * @implemented */ VOID NTAPI @@ -265,15 +232,11 @@ /* Don't do anything for the system process */ if (Process == PsInitialSystemProcess) return; -#ifdef PS_QUOTA_ENABLE_QUOTA_CODE PsReturnPoolQuota(Process, NonPagedPool, Amount); -#else - UNIMPLEMENTED; -#endif -} - -/* - * @unimplemented +} + +/* + * @implemented */ VOID NTAPI @@ -283,13 +246,12 @@ /* Don't do anything for the system process */ if (Process == PsInitialSystemProcess) return; -#ifdef PS_QUOTA_ENABLE_QUOTA_CODE PsReturnPoolQuota(Process, PagedPool, Amount); -#else - UNIMPLEMENTED; -#endif -} - +} + +/* + * @implemented + */ NTSTATUS NTAPI PsReturnProcessPageFileQuota(IN PEPROCESS Process, @@ -298,12 +260,7 @@ /* Don't do anything for the system process */ if (Process == PsInitialSystemProcess) return STATUS_SUCCESS; -#ifdef PS_QUOTA_ENABLE_QUOTA_CODE PspReturnProcessQuotaSpecifiedPool(Process, 2, Amount); -#else - /* Otherwise, not implemented */ - UNIMPLEMENTED; -#endif return STATUS_SUCCESS; }
11 years, 3 months
1
0
0
0
[ion] 60070: [NPFS-NEW]: Fix pool corruption and crashing bugs in NpPeek, which was using sizeof instead of FIELD_OFFSET. [NPFS-NEW]: Actually implement NpCancelWaiter instead of making it ASSERT. ...
by ion@svn.reactos.org
Author: ion Date: Fri Sep 13 07:49:42 2013 New Revision: 60070 URL:
http://svn.reactos.org/svn/reactos?rev=60070&view=rev
Log: [NPFS-NEW]: Fix pool corruption and crashing bugs in NpPeek, which was using sizeof instead of FIELD_OFFSET. [NPFS-NEW]: Actually implement NpCancelWaiter instead of making it ASSERT. [NPFS-NEW]: Critical fixes to NpAddWaiter and NpWaitForNamedPipe to fix logic flaws. NPFS-NEW now behaves without any visible regressions, and exhibits only 2 failures in the kernel32 pipe winetest -- vs 120+ failures with the current NPFS driver. It has 0 ntdll pipe failures, and 0 kmtest pipe failures. Modified: trunk/reactos/drivers/filesystems/npfs_new/create.c trunk/reactos/drivers/filesystems/npfs_new/fsctrl.c trunk/reactos/drivers/filesystems/npfs_new/main.c trunk/reactos/drivers/filesystems/npfs_new/npfs.h trunk/reactos/drivers/filesystems/npfs_new/strucsup.c trunk/reactos/drivers/filesystems/npfs_new/waitsup.c Modified: trunk/reactos/drivers/filesystems/npfs_new/create.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/npfs_n…
============================================================================== --- trunk/reactos/drivers/filesystems/npfs_new/create.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/npfs_new/create.c [iso-8859-1] Fri Sep 13 07:49:42 2013 @@ -551,7 +551,7 @@ Parameters->NamedPipeType & 0xFFFF, &Fcb); if (!NT_SUCCESS(Status)) goto Quickie; - + Status = NpCreateCcb(Fcb, FileObject, FILE_PIPE_LISTENING_STATE, Modified: trunk/reactos/drivers/filesystems/npfs_new/fsctrl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/npfs_n…
============================================================================== --- trunk/reactos/drivers/filesystems/npfs_new/fsctrl.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/npfs_new/fsctrl.c [iso-8859-1] Fri Sep 13 07:49:42 2013 @@ -206,7 +206,7 @@ { PIO_STACK_LOCATION IoStack; NODE_TYPE_CODE Type; - ULONG InputLength; + ULONG OutputLength; ULONG NamedPipeEnd; PNP_CCB Ccb; PFILE_PIPE_PEEK_BUFFER PeekBuffer; @@ -218,7 +218,7 @@ PAGED_CODE(); IoStack = IoGetCurrentIrpStackLocation(Irp); - InputLength = IoStack->Parameters.FileSystemControl.OutputBufferLength; + OutputLength = IoStack->Parameters.FileSystemControl.OutputBufferLength; Type = NpDecodeFileObject(IoStack->FileObject, NULL, &Ccb, &NamedPipeEnd); if (!Type) @@ -226,7 +226,8 @@ return STATUS_PIPE_DISCONNECTED; } - if ((Type != NPFS_NTC_CCB) && (InputLength < sizeof(*PeekBuffer))) + if ((Type != NPFS_NTC_CCB) && + (OutputLength < FIELD_OFFSET(FILE_PIPE_PEEK_BUFFER, Data))) { return STATUS_INVALID_PARAMETER; } @@ -264,7 +265,7 @@ PeekBuffer->NumberOfMessages = 0; PeekBuffer->MessageLength = 0; PeekBuffer->NamedPipeState = Ccb->NamedPipeState; - BytesPeeked = sizeof(*PeekBuffer); + BytesPeeked = FIELD_OFFSET(FILE_PIPE_PEEK_BUFFER, Data); if (DataQueue->QueueState == WriteEntries) { @@ -279,7 +280,8 @@ PeekBuffer->NumberOfMessages = DataQueue->EntriesInQueue; PeekBuffer->MessageLength = DataEntry->DataSize - DataQueue->ByteOffset; } - if (InputLength == sizeof(*PeekBuffer)) + + if (OutputLength == FIELD_OFFSET(FILE_PIPE_PEEK_BUFFER, Data)) { Status = PeekBuffer->ReadDataAvailable ? STATUS_BUFFER_OVERFLOW : STATUS_SUCCESS; } @@ -289,12 +291,12 @@ TRUE, FALSE, PeekBuffer->Data, - InputLength - sizeof(*PeekBuffer), + OutputLength - FIELD_OFFSET(FILE_PIPE_PEEK_BUFFER, Data), Ccb->Fcb->NamedPipeType == FILE_PIPE_MESSAGE_TYPE, Ccb, List); Status = IoStatus.Status; - BytesPeeked = IoStatus.Information + sizeof(*PeekBuffer); + BytesPeeked += IoStatus.Information; } } else @@ -523,14 +525,18 @@ NODE_TYPE_CODE NodeTypeCode; PLIST_ENTRY NextEntry; PNP_FCB Fcb; + PWCHAR OriginalBuffer; PAGED_CODE(); IoStack = IoGetCurrentIrpStackLocation(Irp); - InLength = IoStack->Parameters.DeviceIoControl.InputBufferLength; + InLength = IoStack->Parameters.FileSystemControl.InputBufferLength; SourceString.Buffer = NULL; - if (NpDecodeFileObject(IoStack->FileObject, NULL, &Ccb, &NamedPipeEnd) != NPFS_NTC_ROOT_DCB) + if (NpDecodeFileObject(IoStack->FileObject, + NULL, + &Ccb, + &NamedPipeEnd) != NPFS_NTC_ROOT_DCB) { Status = STATUS_ILLEGAL_FUNCTION; goto Quickie; @@ -544,14 +550,17 @@ } NameLength = Buffer->NameLength; - if ((NameLength > 0xFFFD) || ((NameLength + sizeof(*Buffer)) > InLength)) + if ((NameLength > (0xFFFF - sizeof(UNICODE_NULL))) || + ((NameLength + FIELD_OFFSET(FILE_PIPE_WAIT_FOR_BUFFER, Name)) > InLength)) { Status = STATUS_INVALID_PARAMETER; goto Quickie; } SourceString.Length = (USHORT)NameLength + sizeof(OBJ_NAME_PATH_SEPARATOR); - SourceString.Buffer = ExAllocatePoolWithTag(PagedPool, SourceString.Length, NPFS_WRITE_BLOCK_TAG); + SourceString.Buffer = ExAllocatePoolWithTag(PagedPool, + SourceString.Length, + NPFS_WRITE_BLOCK_TAG); if (!SourceString.Buffer) { Status = STATUS_INSUFFICIENT_RESOURCES; @@ -562,6 +571,7 @@ RtlCopyMemory(&SourceString.Buffer[1], Buffer->Name, Buffer->NameLength); Status = STATUS_SUCCESS; + OriginalBuffer = SourceString.Buffer; //Status = NpTranslateAlias(&SourceString); if (!NT_SUCCESS(Status)) goto Quickie; @@ -583,7 +593,7 @@ if (Ccb->NamedPipeState == FILE_PIPE_LISTENING_STATE) break; } - if (NextEntry == &Fcb->CcbList) + if (NextEntry != &Fcb->CcbList) { Status = STATUS_SUCCESS; } @@ -592,7 +602,8 @@ Status = NpAddWaiter(&NpVcb->WaitQueue, Fcb->Timeout, Irp, - &SourceString); + OriginalBuffer == SourceString.Buffer ? + NULL : &SourceString); } Quickie: Modified: trunk/reactos/drivers/filesystems/npfs_new/main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/npfs_n…
============================================================================== --- trunk/reactos/drivers/filesystems/npfs_new/main.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/npfs_new/main.c [iso-8859-1] Fri Sep 13 07:49:42 2013 @@ -62,7 +62,7 @@ DriverObject->DriverUnload = NULL; - RtlInitUnicodeString(&DeviceName, L"\\Device\\NamedPipe2"); + RtlInitUnicodeString(&DeviceName, L"\\Device\\NamedPipe"); Status = IoCreateDevice(DriverObject, sizeof(NP_VCB), &DeviceName, Modified: trunk/reactos/drivers/filesystems/npfs_new/npfs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/npfs_n…
============================================================================== --- trunk/reactos/drivers/filesystems/npfs_new/npfs.h [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/npfs_new/npfs.h [iso-8859-1] Fri Sep 13 07:49:42 2013 @@ -178,7 +178,7 @@ KDPC Dpc; KTIMER Timer; PNP_WAIT_QUEUE WaitQueue; - UNICODE_STRING String; + UNICODE_STRING AliasName; PFILE_OBJECT FileObject; } NP_WAIT_QUEUE_ENTRY, *PNP_WAIT_QUEUE_ENTRY; @@ -590,7 +590,7 @@ NpAddWaiter(IN PNP_WAIT_QUEUE WaitQueue, IN LARGE_INTEGER WaitTime, IN PIRP Irp, - IN PUNICODE_STRING Name); + IN PUNICODE_STRING AliasName); NTSTATUS NTAPI Modified: trunk/reactos/drivers/filesystems/npfs_new/strucsup.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/npfs_n…
============================================================================== --- trunk/reactos/drivers/filesystems/npfs_new/strucsup.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/npfs_new/strucsup.c [iso-8859-1] Fri Sep 13 07:49:42 2013 @@ -66,7 +66,6 @@ IN PLIST_ENTRY ListEntry) { PNP_DCB Dcb; - PAGED_CODE(); Dcb = Fcb->ParentDcb; @@ -76,7 +75,7 @@ &Fcb->FullName, STATUS_OBJECT_NAME_NOT_FOUND, ListEntry); - + RemoveEntryList(&Fcb->DcbEntry); if (Fcb->SecurityDescriptor) Modified: trunk/reactos/drivers/filesystems/npfs_new/waitsup.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/npfs_n…
============================================================================== --- trunk/reactos/drivers/filesystems/npfs_new/waitsup.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/npfs_new/waitsup.c [iso-8859-1] Fri Sep 13 07:49:42 2013 @@ -45,7 +45,7 @@ if (WaitEntry) { - ObfDereferenceObject(WaitEntry->FileObject); + ObDereferenceObject(WaitEntry->FileObject); ExFreePool(WaitEntry); } @@ -66,23 +66,28 @@ PNP_WAIT_QUEUE_ENTRY WaitEntry = Context; OldIrql = KfAcquireSpinLock(&WaitEntry->WaitQueue->WaitLock); + Irp = WaitEntry->Irp; if (Irp) { RemoveEntryList(&Irp->Tail.Overlay.ListEntry); + if (!IoSetCancelRoutine(Irp, NULL)) { Irp->Tail.Overlay.DriverContext[1] = NULL; Irp = NULL; } } + KfReleaseSpinLock(&WaitEntry->WaitQueue->WaitLock, OldIrql); + if (Irp) { Irp->IoStatus.Status = STATUS_IO_TIMEOUT; IoCompleteRequest(Irp, IO_NAMED_PIPE_INCREMENT); } - ObfDereferenceObject(WaitEntry->FileObject); + + ObDereferenceObject(WaitEntry->FileObject); ExFreePool(WaitEntry); } @@ -99,13 +104,22 @@ NpCancelWaiter(IN PNP_WAIT_QUEUE WaitQueue, IN PUNICODE_STRING PipeName, IN NTSTATUS Status, - IN PLIST_ENTRY ListEntry) + IN PLIST_ENTRY List) { UNICODE_STRING DestinationString; KIRQL OldIrql; PWCHAR Buffer; - - Buffer = ExAllocatePoolWithTag(NonPagedPool, PipeName->Length, NPFS_WAIT_BLOCK_TAG); + PLIST_ENTRY NextEntry; + PNP_WAIT_QUEUE_ENTRY WaitEntry, Linkage; + PIRP WaitIrp; + PFILE_PIPE_WAIT_FOR_BUFFER WaitBuffer; + ULONG i, NameLength; + + Linkage = NULL; + + Buffer = ExAllocatePoolWithTag(NonPagedPool, + PipeName->Length, + NPFS_WAIT_BLOCK_TAG); if (!Buffer) return STATUS_INSUFFICIENT_RESOURCES; RtlInitEmptyUnicodeString(&DestinationString, Buffer, PipeName->Length); @@ -113,10 +127,78 @@ OldIrql = KfAcquireSpinLock(&WaitQueue->WaitLock); - ASSERT(IsListEmpty(&WaitQueue->WaitList) == TRUE); + for (NextEntry = WaitQueue->WaitList.Flink; + NextEntry != &WaitQueue->WaitList; + NextEntry = NextEntry->Flink) + { + WaitIrp = CONTAINING_RECORD(NextEntry, IRP, Tail.Overlay.ListEntry); + WaitEntry = WaitIrp->Tail.Overlay.DriverContext[1]; + + if (WaitEntry->AliasName.Length) + { + ASSERT(FALSE); + if (DestinationString.Length == WaitEntry->AliasName.Length) + { + if (RtlCompareMemory(WaitEntry->AliasName.Buffer, + DestinationString.Buffer, + DestinationString.Length) == + DestinationString.Length) + { +CancelWait: + RemoveEntryList(&WaitIrp->Tail.Overlay.ListEntry); + if (KeCancelTimer(&WaitEntry->Timer)) + { + WaitEntry->WaitQueue = (PNP_WAIT_QUEUE)Linkage; + Linkage = WaitEntry; + } + else + { + WaitEntry->Irp = NULL; + WaitIrp->Tail.Overlay.DriverContext[1] = NULL; + } + + if (IoSetCancelRoutine(WaitIrp, NULL)) + { + WaitIrp->IoStatus.Information = 0; + WaitIrp->IoStatus.Status = Status; + InsertTailList(List, &WaitIrp->Tail.Overlay.ListEntry); + } + else + { + WaitIrp->Tail.Overlay.DriverContext[1] = NULL; + } + } + } + } + else + { + WaitBuffer = WaitIrp->AssociatedIrp.SystemBuffer; + + if (WaitBuffer->NameLength + sizeof(WCHAR) == DestinationString.Length) + { + NameLength = WaitBuffer->NameLength / sizeof(WCHAR); + for (i = 0; i < NameLength; i++) + { + if (WaitBuffer->Name[i] != DestinationString.Buffer[i + 1]) break; + } + + if (i >= NameLength) goto CancelWait; + } + } + } KfReleaseSpinLock(&WaitQueue->WaitLock, OldIrql); + ExFreePool(DestinationString.Buffer); + + while (Linkage) + { + WaitEntry = Linkage; + Linkage = (PNP_WAIT_QUEUE_ENTRY)Linkage->WaitQueue; + ObDereferenceObject(WaitEntry->FileObject); + ExFreePool(WaitEntry); + } + return STATUS_SUCCESS; } @@ -124,8 +206,8 @@ NTAPI NpAddWaiter(IN PNP_WAIT_QUEUE WaitQueue, IN LARGE_INTEGER WaitTime, - IN PIRP Irp, - IN PUNICODE_STRING Name) + IN PIRP Irp, + IN PUNICODE_STRING AliasName) { PIO_STACK_LOCATION IoStack; KIRQL OldIrql; @@ -137,71 +219,74 @@ IoStack = IoGetCurrentIrpStackLocation(Irp); - WaitEntry = ExAllocatePoolWithQuotaTag(NonPagedPool, sizeof(*WaitEntry), NPFS_WRITE_BLOCK_TAG); - if (WaitEntry) - { - KeInitializeDpc(&WaitEntry->Dpc, NpTimerDispatch, WaitEntry); - KeInitializeTimer(&WaitEntry->Timer); - - if (Name) - { - WaitEntry->String = *Name; - } - else - { - WaitEntry->String.Length = 0; - WaitEntry->String.Buffer = 0; - } - - WaitEntry->WaitQueue = WaitQueue; - WaitEntry->Irp = Irp; - - WaitBuffer = (PFILE_PIPE_WAIT_FOR_BUFFER)Irp->AssociatedIrp.SystemBuffer; - if (WaitBuffer->TimeoutSpecified) - { - DueTime = WaitBuffer->Timeout; - } - else - { - DueTime = WaitTime; - } - - for (i = 0; i < WaitBuffer->NameLength / sizeof(WCHAR); i++) - { - WaitBuffer->Name[i] = RtlUpcaseUnicodeChar(WaitBuffer->Name[i]); - } - - Irp->Tail.Overlay.DriverContext[0] = WaitQueue; - Irp->Tail.Overlay.DriverContext[1] = WaitEntry; - OldIrql = KfAcquireSpinLock(&WaitQueue->WaitLock); - - IoSetCancelRoutine(Irp, NpCancelWaitQueueIrp); - - if (Irp->Cancel && IoSetCancelRoutine(Irp, NULL)) - { - Status = STATUS_CANCELLED; - } - else - { - InsertTailList(&WaitQueue->WaitList, &Irp->Tail.Overlay.ListEntry); - - IoMarkIrpPending(Irp); - Status = STATUS_PENDING; - - WaitEntry->FileObject = IoStack->FileObject; - ObfReferenceObject(WaitEntry->FileObject); - - KeSetTimer(&WaitEntry->Timer, DueTime, &WaitEntry->Dpc); - WaitEntry = NULL; - - } - KfReleaseSpinLock(&WaitQueue->WaitLock, OldIrql); - if (WaitEntry) ExFreePool(WaitEntry); + WaitEntry = ExAllocatePoolWithQuotaTag(NonPagedPool, + sizeof(*WaitEntry), + NPFS_WRITE_BLOCK_TAG); + if (!WaitEntry) + { + return STATUS_INSUFFICIENT_RESOURCES; + } + + KeInitializeDpc(&WaitEntry->Dpc, NpTimerDispatch, WaitEntry); + KeInitializeTimer(&WaitEntry->Timer); + + if (AliasName) + { + WaitEntry->AliasName = *AliasName; } else { - Status = STATUS_INSUFFICIENT_RESOURCES; - } + WaitEntry->AliasName.Length = 0; + WaitEntry->AliasName.Buffer = NULL; + } + + WaitEntry->WaitQueue = WaitQueue; + WaitEntry->Irp = Irp; + + WaitBuffer = (PFILE_PIPE_WAIT_FOR_BUFFER)Irp->AssociatedIrp.SystemBuffer; + if (WaitBuffer->TimeoutSpecified) + { + DueTime = WaitBuffer->Timeout; + } + else + { + DueTime = WaitTime; + } + + for (i = 0; i < WaitBuffer->NameLength / sizeof(WCHAR); i++) + { + WaitBuffer->Name[i] = RtlUpcaseUnicodeChar(WaitBuffer->Name[i]); + } + + Irp->Tail.Overlay.DriverContext[0] = WaitQueue; + Irp->Tail.Overlay.DriverContext[1] = WaitEntry; + + OldIrql = KfAcquireSpinLock(&WaitQueue->WaitLock); + + IoSetCancelRoutine(Irp, NpCancelWaitQueueIrp); + + if (Irp->Cancel && IoSetCancelRoutine(Irp, NULL)) + { + Status = STATUS_CANCELLED; + } + else + { + InsertTailList(&WaitQueue->WaitList, &Irp->Tail.Overlay.ListEntry); + + IoMarkIrpPending(Irp); + Status = STATUS_PENDING; + + WaitEntry->FileObject = IoStack->FileObject; + ObReferenceObject(WaitEntry->FileObject); + + KeSetTimer(&WaitEntry->Timer, DueTime, &WaitEntry->Dpc); + WaitEntry = NULL; + + } + + KfReleaseSpinLock(&WaitQueue->WaitLock, OldIrql); + if (WaitEntry) ExFreePool(WaitEntry); + return Status; }
11 years, 3 months
1
0
0
0
[ion] 60069: [NPFS-NEW]: Implement NpImpersonate, needed by FSCTL_PIPE_IMPERSONATE, called by ImpersonateNamedPipeClient (in advapi). Down to only 12 kernel32:pipe failures, a 1100% improvement ove...
by ion@svn.reactos.org
Author: ion Date: Thu Sep 12 23:55:56 2013 New Revision: 60069 URL:
http://svn.reactos.org/svn/reactos?rev=60069&view=rev
Log: [NPFS-NEW]: Implement NpImpersonate, needed by FSCTL_PIPE_IMPERSONATE, called by ImpersonateNamedPipeClient (in advapi). Down to only 12 kernel32:pipe failures, a 1100% improvement over npfs. Modified: trunk/reactos/drivers/filesystems/npfs_new/fsctrl.c trunk/reactos/drivers/filesystems/npfs_new/secursup.c Modified: trunk/reactos/drivers/filesystems/npfs_new/fsctrl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/npfs_n…
============================================================================== --- trunk/reactos/drivers/filesystems/npfs_new/fsctrl.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/npfs_new/fsctrl.c [iso-8859-1] Thu Sep 12 23:55:56 2013 @@ -91,8 +91,29 @@ NpImpersonate(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp) { - UNIMPLEMENTED; - return STATUS_NOT_IMPLEMENTED; + ULONG NamedPipeEnd; + PNP_CCB Ccb; + NTSTATUS Status; + NODE_TYPE_CODE NodeTypeCode; + PIO_STACK_LOCATION IoStack; + PAGED_CODE(); + + IoStack = IoGetCurrentIrpStackLocation(Irp); + + NodeTypeCode = NpDecodeFileObject(IoStack->FileObject, NULL, &Ccb, &NamedPipeEnd); + if (NodeTypeCode == NPFS_NTC_CCB) + { + if (NamedPipeEnd == FILE_PIPE_SERVER_END) + { + Status = NpImpersonateClientContext(Ccb); + } + else + { + Status = STATUS_ILLEGAL_FUNCTION; + } + } + + return Status; } NTSTATUS Modified: trunk/reactos/drivers/filesystems/npfs_new/secursup.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/npfs_n…
============================================================================== --- trunk/reactos/drivers/filesystems/npfs_new/secursup.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/npfs_new/secursup.c [iso-8859-1] Thu Sep 12 23:55:56 2013 @@ -14,6 +14,26 @@ #define NPFS_BUGCHECK_FILE_ID (NPFS_BUGCHECK_SECURSUP) /* FUNCTIONS ******************************************************************/ + +NTSTATUS +NTAPI +NpImpersonateClientContext(IN PNP_CCB Ccb) +{ + NTSTATUS Status; + PSECURITY_CLIENT_CONTEXT ClientContext; + PAGED_CODE(); + + ClientContext = Ccb->ClientContext; + if (ClientContext) + { + Status = SeImpersonateClientEx(ClientContext, NULL); + } + else + { + Status = STATUS_CANNOT_IMPERSONATE; + } + return Status; +} VOID NTAPI
11 years, 3 months
1
0
0
0
[ion] 60068: [NPFS-NEW]: Fix a bug in NpRemoveDataQueueEntry. [NPFS-NEW]: Fix busted up NpGetNextRealDataQueueEntry and fix its usage. These changes don't appear to "fix" any tests, but they were r...
by ion@svn.reactos.org
Author: ion Date: Thu Sep 12 23:54:59 2013 New Revision: 60068 URL:
http://svn.reactos.org/svn/reactos?rev=60068&view=rev
Log: [NPFS-NEW]: Fix a bug in NpRemoveDataQueueEntry. [NPFS-NEW]: Fix busted up NpGetNextRealDataQueueEntry and fix its usage. These changes don't appear to "fix" any tests, but they were real bugs. Thanks to ThFabba. Modified: trunk/reactos/drivers/filesystems/npfs_new/datasup.c trunk/reactos/drivers/filesystems/npfs_new/npfs.h trunk/reactos/drivers/filesystems/npfs_new/readsup.c trunk/reactos/drivers/filesystems/npfs_new/writesup.c Modified: trunk/reactos/drivers/filesystems/npfs_new/datasup.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/npfs_n…
============================================================================== --- trunk/reactos/drivers/filesystems/npfs_new/datasup.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/npfs_new/datasup.c [iso-8859-1] Thu Sep 12 23:54:59 2013 @@ -126,7 +126,9 @@ --DataQueue->EntriesInQueue; HasWrites = 1; - if (!DataQueue->QueueState != WriteEntries || DataQueue->QuotaUsed < DataQueue->Quota || !QueueEntry->QuotaInEntry) + if (DataQueue->QueueState != WriteEntries || + DataQueue->QuotaUsed < DataQueue->Quota || + !QueueEntry->QuotaInEntry) { HasWrites = 0; } @@ -164,7 +166,7 @@ return Irp; } -PNP_DATA_QUEUE_ENTRY +PLIST_ENTRY NTAPI NpGetNextRealDataQueueEntry(IN PNP_DATA_QUEUE DataQueue, IN PLIST_ENTRY List) @@ -175,10 +177,9 @@ PLIST_ENTRY NextEntry; PAGED_CODE(); - NextEntry = DataQueue->Queue.Flink; - DataEntry = CONTAINING_RECORD(NextEntry, NP_DATA_QUEUE_ENTRY, QueueEntry); - - while (NextEntry != &DataQueue->Queue) + for (NextEntry = DataQueue->Queue.Flink; + NextEntry != &DataQueue->Queue; + NextEntry = DataQueue->Queue.Flink) { DataEntry = CONTAINING_RECORD(NextEntry, NP_DATA_QUEUE_ENTRY, QueueEntry); @@ -193,7 +194,7 @@ } } - return DataEntry; + return NextEntry; } VOID Modified: trunk/reactos/drivers/filesystems/npfs_new/npfs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/npfs_n…
============================================================================== --- trunk/reactos/drivers/filesystems/npfs_new/npfs.h [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/npfs_new/npfs.h [iso-8859-1] Thu Sep 12 23:54:59 2013 @@ -394,7 +394,7 @@ NTAPI NpUninitializeDataQueue(IN PNP_DATA_QUEUE DataQueue); -PNP_DATA_QUEUE_ENTRY +PLIST_ENTRY NTAPI NpGetNextRealDataQueueEntry(IN PNP_DATA_QUEUE DataQueue, IN PLIST_ENTRY List); @@ -524,6 +524,10 @@ VOID NTAPI NpFreeClientSecurityContext(IN PSECURITY_CLIENT_CONTEXT ClientContext); + +NTSTATUS +NTAPI +NpImpersonateClientContext(IN PNP_CCB Ccb); VOID NTAPI Modified: trunk/reactos/drivers/filesystems/npfs_new/readsup.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/npfs_n…
============================================================================== --- trunk/reactos/drivers/filesystems/npfs_new/readsup.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/npfs_new/readsup.c [iso-8859-1] Thu Sep 12 23:54:59 2013 @@ -48,7 +48,9 @@ } else { - DataEntry = NpGetNextRealDataQueueEntry(DataQueue, List); + DataEntry = CONTAINING_RECORD(NpGetNextRealDataQueueEntry(DataQueue, List), + NP_DATA_QUEUE_ENTRY, + QueueEntry); } while ((&DataEntry->QueueEntry != &DataQueue->Queue) && (RemainingSize)) @@ -118,7 +120,9 @@ { if (ReadOverflowOperation) { - TempDataEntry = NpGetNextRealDataQueueEntry(DataQueue, List); + TempDataEntry = CONTAINING_RECORD(NpGetNextRealDataQueueEntry(DataQueue, List), + NP_DATA_QUEUE_ENTRY, + QueueEntry); ASSERT(TempDataEntry == DataEntry); } @@ -149,7 +153,9 @@ } else { - DataEntry = NpGetNextRealDataQueueEntry(DataQueue, List); + DataEntry = CONTAINING_RECORD(NpGetNextRealDataQueueEntry(DataQueue, List), + NP_DATA_QUEUE_ENTRY, + QueueEntry); } } Modified: trunk/reactos/drivers/filesystems/npfs_new/writesup.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/npfs_n…
============================================================================== --- trunk/reactos/drivers/filesystems/npfs_new/writesup.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/npfs_new/writesup.c [iso-8859-1] Thu Sep 12 23:54:59 2013 @@ -46,10 +46,14 @@ MoreProcessing = FALSE; } - for (DataEntry = NpGetNextRealDataQueueEntry(WriteQueue, List); + for (DataEntry = CONTAINING_RECORD(NpGetNextRealDataQueueEntry(WriteQueue, List), + NP_DATA_QUEUE_ENTRY, + QueueEntry); ((WriteQueue->QueueState == ReadEntries) && ((*BytesNotWritten > 0) || (MoreProcessing))); - DataEntry = NpGetNextRealDataQueueEntry(WriteQueue, List)) + DataEntry = CONTAINING_RECORD(NpGetNextRealDataQueueEntry(WriteQueue, List), + NP_DATA_QUEUE_ENTRY, + QueueEntry)) { DataSize = DataEntry->DataSize;
11 years, 3 months
1
0
0
0
[ion] 60067: [NPFS-NEW]: Fix moar bougs. pipe: 33920 tests execute (0 marked as todo, 84 failures), 0 skipped. Note that this is already better than trunk's npfs!
by ion@svn.reactos.org
Author: ion Date: Thu Sep 12 22:42:13 2013 New Revision: 60067 URL:
http://svn.reactos.org/svn/reactos?rev=60067&view=rev
Log: [NPFS-NEW]: Fix moar bougs. pipe: 33920 tests execute (0 marked as todo, 84 failures), 0 skipped. Note that this is already better than trunk's npfs! Modified: trunk/reactos/drivers/filesystems/npfs_new/datasup.c trunk/reactos/drivers/filesystems/npfs_new/flushbuf.c trunk/reactos/drivers/filesystems/npfs_new/npfs.h trunk/reactos/drivers/filesystems/npfs_new/readsup.c trunk/reactos/drivers/filesystems/npfs_new/write.c Modified: trunk/reactos/drivers/filesystems/npfs_new/datasup.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/npfs_n…
============================================================================== --- trunk/reactos/drivers/filesystems/npfs_new/datasup.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/npfs_new/datasup.c [iso-8859-1] Thu Sep 12 22:42:13 2013 @@ -175,9 +175,9 @@ PLIST_ENTRY NextEntry; PAGED_CODE(); - DataEntry = NULL; - NextEntry = DataQueue->Queue.Flink; + DataEntry = CONTAINING_RECORD(NextEntry, NP_DATA_QUEUE_ENTRY, QueueEntry); + while (NextEntry != &DataQueue->Queue) { DataEntry = CONTAINING_RECORD(NextEntry, NP_DATA_QUEUE_ENTRY, QueueEntry); Modified: trunk/reactos/drivers/filesystems/npfs_new/flushbuf.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/npfs_n…
============================================================================== --- trunk/reactos/drivers/filesystems/npfs_new/flushbuf.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/npfs_new/flushbuf.c [iso-8859-1] Thu Sep 12 22:42:13 2013 @@ -37,11 +37,11 @@ if (NamedPipeEnd == FILE_PIPE_SERVER_END) { - FlushQueue = &Ccb->DataQueue[FILE_PIPE_INBOUND]; + FlushQueue = &Ccb->DataQueue[FILE_PIPE_OUTBOUND]; } else { - FlushQueue = &Ccb->DataQueue[FILE_PIPE_OUTBOUND]; + FlushQueue = &Ccb->DataQueue[FILE_PIPE_INBOUND]; } if (FlushQueue->QueueState == WriteEntries) @@ -81,6 +81,12 @@ NpReleaseVcb(); FsRtlExitFileSystem(); + if (Status != STATUS_PENDING) + { + Irp->IoStatus.Status = Status; + IoCompleteRequest(Irp, IO_NAMED_PIPE_INCREMENT); + } + return Status; } Modified: trunk/reactos/drivers/filesystems/npfs_new/npfs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/npfs_n…
============================================================================== --- trunk/reactos/drivers/filesystems/npfs_new/npfs.h [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/npfs_new/npfs.h [iso-8859-1] Thu Sep 12 22:42:13 2013 @@ -351,6 +351,8 @@ ExReleaseResourceLite(&NpVcb->Lock); } + + // // Function to process deferred IRPs outside the VCB lock but still within the // critical region Modified: trunk/reactos/drivers/filesystems/npfs_new/readsup.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/npfs_n…
============================================================================== --- trunk/reactos/drivers/filesystems/npfs_new/readsup.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/npfs_new/readsup.c [iso-8859-1] Thu Sep 12 22:42:13 2013 @@ -75,7 +75,7 @@ } DataLength = Offset; - if (Offset >= RemainingSize) DataLength = RemainingSize; + if (DataLength >= RemainingSize) DataLength = RemainingSize; _SEH2_TRY { @@ -130,14 +130,17 @@ InsertTailList(List, &Irp->Tail.Overlay.ListEntry); } } + if (Mode == FILE_PIPE_MESSAGE_MODE) { Status.Status = STATUS_SUCCESS; break; } + ASSERT(!ReadOverflowOperation); } } + if (Peek) { DataEntry = CONTAINING_RECORD(DataEntry->QueueEntry.Flink, Modified: trunk/reactos/drivers/filesystems/npfs_new/write.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/npfs_n…
============================================================================== --- trunk/reactos/drivers/filesystems/npfs_new/write.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/npfs_new/write.c [iso-8859-1] Thu Sep 12 22:42:13 2013 @@ -36,7 +36,7 @@ PNP_DATA_QUEUE WriteQueue; NTSTATUS Status; PNP_EVENT_BUFFER EventBuffer; - ULONG BytesWritten, NamedPipeEnd; + ULONG BytesWritten, NamedPipeEnd, ReadMode; PAGED_CODE(); IoStatus->Information = 0; @@ -91,10 +91,12 @@ if (NamedPipeEnd == FILE_PIPE_SERVER_END) { WriteQueue = &Ccb->DataQueue[FILE_PIPE_OUTBOUND]; + ReadMode = Ccb->ReadMode[FILE_PIPE_CLIENT_END]; } else { WriteQueue = &Ccb->DataQueue[FILE_PIPE_INBOUND]; + ReadMode = Ccb->ReadMode[FILE_PIPE_SERVER_END]; } EventBuffer = NonPagedCcb->EventBuffer[NamedPipeEnd]; @@ -122,7 +124,7 @@ } Status = NpWriteDataQueue(WriteQueue, - Ccb->ReadMode[NamedPipeEnd], + ReadMode, Buffer, DataSize, Ccb->Fcb->NamedPipeType, @@ -136,8 +138,8 @@ if (Status == STATUS_MORE_PROCESSING_REQUIRED) { ASSERT(WriteQueue->QueueState != ReadEntries); - if ((Ccb->CompletionMode[NamedPipeEnd] == FILE_PIPE_COMPLETE_OPERATION || !Irp) - && WriteQueue->Quota - WriteQueue->QuotaUsed < BytesWritten) + if ((Ccb->CompletionMode[NamedPipeEnd] == FILE_PIPE_COMPLETE_OPERATION || !Irp) && + ((WriteQueue->Quota - WriteQueue->QuotaUsed) < BytesWritten)) { IoStatus->Information = DataSize - BytesWritten; IoStatus->Status = STATUS_SUCCESS;
11 years, 3 months
1
0
0
0
← Newer
1
...
39
40
41
42
43
44
45
...
56
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
Results per page:
10
25
50
100
200