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
2025
May
April
March
February
January
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
November 2015
----- 2025 -----
May 2025
April 2025
March 2025
February 2025
January 2025
----- 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
14 participants
457 discussions
Start a n
N
ew thread
[akhaldi] 69904: [PSDK] Update midles.h. CORE-10536
by akhaldi@svn.reactos.org
Author: akhaldi Date: Mon Nov 16 21:54:44 2015 New Revision: 69904 URL:
http://svn.reactos.org/svn/reactos?rev=69904&view=rev
Log: [PSDK] Update midles.h. CORE-10536 Modified: trunk/reactos/include/psdk/midles.h Modified: trunk/reactos/include/psdk/midles.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/midles.h?rev=…
============================================================================== --- trunk/reactos/include/psdk/midles.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/midles.h [iso-8859-1] Mon Nov 16 21:54:44 2015 @@ -30,7 +30,8 @@ typedef enum { MES_ENCODE, - MES_DECODE + MES_DECODE, + MES_ENCODE_NDR64 } MIDL_ES_CODE; typedef enum
9 years, 5 months
1
0
0
0
[akhaldi] 69903: [ADVAPI32_VISTA] Introduce this module to hold Vista+ exports that we need to provide. CORE-10536
by akhaldi@svn.reactos.org
Author: akhaldi Date: Mon Nov 16 21:53:56 2015 New Revision: 69903 URL:
http://svn.reactos.org/svn/reactos?rev=69903&view=rev
Log: [ADVAPI32_VISTA] Introduce this module to hold Vista+ exports that we need to provide. CORE-10536 Added: trunk/reactos/dll/win32/advapi32_vista/ trunk/reactos/dll/win32/advapi32_vista/CMakeLists.txt (with props) trunk/reactos/dll/win32/advapi32_vista/DllMain.c (with props) trunk/reactos/dll/win32/advapi32_vista/RegDeleteTree.c (with props) trunk/reactos/dll/win32/advapi32_vista/advapi32_vista.h (with props) trunk/reactos/dll/win32/advapi32_vista/advapi32_vista.spec (with props) Modified: trunk/reactos/dll/win32/CMakeLists.txt Modified: trunk/reactos/dll/win32/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/CMakeLists.txt?r…
============================================================================== --- trunk/reactos/dll/win32/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/win32/CMakeLists.txt [iso-8859-1] Mon Nov 16 21:53:56 2015 @@ -4,6 +4,7 @@ add_subdirectory(activeds) add_subdirectory(actxprxy) add_subdirectory(advapi32) +add_subdirectory(advapi32_vista) add_subdirectory(advpack) add_subdirectory(atl) add_subdirectory(atl100) Added: trunk/reactos/dll/win32/advapi32_vista/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32_vista/C…
============================================================================== --- trunk/reactos/dll/win32/advapi32_vista/CMakeLists.txt (added) +++ trunk/reactos/dll/win32/advapi32_vista/CMakeLists.txt [iso-8859-1] Mon Nov 16 21:53:56 2015 @@ -0,0 +1,17 @@ + +remove_definitions(-D_WIN32_WINNT=0x502 -DWINVER=0x502) +add_definitions(-D_WIN32_WINNT=0x600 -DWINVER=0x600) + +add_definitions(-D_ADVAPI32_) +spec2def(advapi32_vista.dll advapi32_vista.spec ADD_IMPORTLIB) + +list(APPEND SOURCE + DllMain.c + RegDeleteTree.c + ${CMAKE_CURRENT_BINARY_DIR}/advapi32_vista.def) + +add_library(advapi32_vista SHARED ${SOURCE}) +set_module_type(advapi32_vista win32dll ENTRYPOINT DllMain 12) +add_importlibs(advapi32_vista advapi32 kernel32 ntdll) +add_dependencies(advapi32_vista psdk) +add_cd_file(TARGET advapi32_vista DESTINATION reactos/system32 FOR all) Propchange: trunk/reactos/dll/win32/advapi32_vista/CMakeLists.txt ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/advapi32_vista/DllMain.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32_vista/D…
============================================================================== --- trunk/reactos/dll/win32/advapi32_vista/DllMain.c (added) +++ trunk/reactos/dll/win32/advapi32_vista/DllMain.c [iso-8859-1] Mon Nov 16 21:53:56 2015 @@ -0,0 +1,14 @@ + +#include "advapi32_vista.h" + +BOOL +WINAPI +DllMain(HANDLE hDll, + DWORD dwReason, + LPVOID lpReserved) +{ + /* For now, there isn't much to do */ + if (dwReason == DLL_PROCESS_ATTACH) + DisableThreadLibraryCalls(hDll); + return TRUE; +} Propchange: trunk/reactos/dll/win32/advapi32_vista/DllMain.c ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/advapi32_vista/RegDeleteTree.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32_vista/R…
============================================================================== --- trunk/reactos/dll/win32/advapi32_vista/RegDeleteTree.c (added) +++ trunk/reactos/dll/win32/advapi32_vista/RegDeleteTree.c [iso-8859-1] Mon Nov 16 21:53:56 2015 @@ -0,0 +1,102 @@ + +#include "advapi32_vista.h" + +/* heap allocation helpers */ +static void *heap_alloc( size_t len ) __WINE_ALLOC_SIZE(1); +static inline void *heap_alloc( size_t len ) +{ + return HeapAlloc( GetProcessHeap(), 0, len ); +} + +static inline BOOL heap_free( void *mem ) +{ + return HeapFree( GetProcessHeap(), 0, mem ); +} + +/* Taken from Wine advapi32/registry.c */ + +/****************************************************************************** + * RegDeleteTreeW [ADVAPI32.@] + * + */ +LSTATUS WINAPI RegDeleteTreeW(HKEY hKey, LPCWSTR lpszSubKey) +{ + LONG ret; + DWORD dwMaxSubkeyLen, dwMaxValueLen; + DWORD dwMaxLen, dwSize; + WCHAR szNameBuf[MAX_PATH], *lpszName = szNameBuf; + HKEY hSubKey = hKey; + + if(lpszSubKey) + { + ret = RegOpenKeyExW(hKey, lpszSubKey, 0, KEY_READ, &hSubKey); + if (ret) return ret; + } + + /* Get highest length for keys, values */ + ret = RegQueryInfoKeyW(hSubKey, NULL, NULL, NULL, NULL, + &dwMaxSubkeyLen, NULL, NULL, &dwMaxValueLen, NULL, NULL, NULL); + if (ret) goto cleanup; + + dwMaxSubkeyLen++; + dwMaxValueLen++; + dwMaxLen = max(dwMaxSubkeyLen, dwMaxValueLen); + if (dwMaxLen > sizeof(szNameBuf)/sizeof(WCHAR)) + { + /* Name too big: alloc a buffer for it */ + if (!(lpszName = heap_alloc( dwMaxLen*sizeof(WCHAR)))) + { + ret = ERROR_NOT_ENOUGH_MEMORY; + goto cleanup; + } + } + + + /* Recursively delete all the subkeys */ + while (TRUE) + { + dwSize = dwMaxLen; + if (RegEnumKeyExW(hSubKey, 0, lpszName, &dwSize, NULL, + NULL, NULL, NULL)) break; + + ret = RegDeleteTreeW(hSubKey, lpszName); + if (ret) goto cleanup; + } + + if (lpszSubKey) + ret = RegDeleteKeyW(hKey, lpszSubKey); + else + while (TRUE) + { + dwSize = dwMaxLen; + if (RegEnumValueW(hKey, 0, lpszName, &dwSize, + NULL, NULL, NULL, NULL)) break; + + ret = RegDeleteValueW(hKey, lpszName); + if (ret) goto cleanup; + } + +cleanup: + /* Free buffer if allocated */ + if (lpszName != szNameBuf) + heap_free( lpszName); + if(lpszSubKey) + RegCloseKey(hSubKey); + return ret; +} + +/****************************************************************************** + * RegDeleteTreeA [ADVAPI32.@] + * + */ +LSTATUS WINAPI RegDeleteTreeA(HKEY hKey, LPCSTR lpszSubKey) +{ + LONG ret; + UNICODE_STRING lpszSubKeyW; + + if (lpszSubKey) RtlCreateUnicodeStringFromAsciiz( &lpszSubKeyW, lpszSubKey); + else lpszSubKeyW.Buffer = NULL; + ret = RegDeleteTreeW( hKey, lpszSubKeyW.Buffer); + RtlFreeUnicodeString( &lpszSubKeyW ); + return ret; +} Propchange: trunk/reactos/dll/win32/advapi32_vista/RegDeleteTree.c ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/advapi32_vista/advapi32_vista.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32_vista/a…
============================================================================== --- trunk/reactos/dll/win32/advapi32_vista/advapi32_vista.h (added) +++ trunk/reactos/dll/win32/advapi32_vista/advapi32_vista.h [iso-8859-1] Mon Nov 16 21:53:56 2015 @@ -0,0 +1,12 @@ + +#pragma once + +/* PSDK/NDK Headers */ +#define WIN32_NO_STATUS +#include <windef.h> +#include <winbase.h> +#include <winreg.h> + +#include <ndk/rtlfuncs.h> + +/* EOF */ Propchange: trunk/reactos/dll/win32/advapi32_vista/advapi32_vista.h ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/advapi32_vista/advapi32_vista.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32_vista/a…
============================================================================== --- trunk/reactos/dll/win32/advapi32_vista/advapi32_vista.spec (added) +++ trunk/reactos/dll/win32/advapi32_vista/advapi32_vista.spec [iso-8859-1] Mon Nov 16 21:53:56 2015 @@ -0,0 +1,3 @@ + +@ stdcall RegDeleteTreeA(long str) +@ stdcall RegDeleteTreeW(long wstr) Propchange: trunk/reactos/dll/win32/advapi32_vista/advapi32_vista.spec ------------------------------------------------------------------------------ svn:eol-style = native
9 years, 5 months
1
0
0
0
[akhaldi] 69902: [WIDL] Sync with Wine Staging 1.7.55. CORE-10536
by akhaldi@svn.reactos.org
Author: akhaldi Date: Mon Nov 16 21:45:45 2015 New Revision: 69902 URL:
http://svn.reactos.org/svn/reactos?rev=69902&view=rev
Log: [WIDL] Sync with Wine Staging 1.7.55. CORE-10536 Modified: trunk/reactos/media/doc/README.WINE trunk/reactos/tools/widl/expr.c trunk/reactos/tools/widl/header.c trunk/reactos/tools/widl/header.h trunk/reactos/tools/widl/parser.l trunk/reactos/tools/widl/parser.tab.c trunk/reactos/tools/widl/parser.tab.h trunk/reactos/tools/widl/parser.y trunk/reactos/tools/widl/parser.yy.c trunk/reactos/tools/widl/proxy.c trunk/reactos/tools/widl/register.c trunk/reactos/tools/widl/typegen.c trunk/reactos/tools/widl/typelib.c trunk/reactos/tools/widl/typetree.c trunk/reactos/tools/widl/typetree.h trunk/reactos/tools/widl/widl.c trunk/reactos/tools/widl/widl.h trunk/reactos/tools/widl/widl_ros.diff trunk/reactos/tools/widl/widltypes.h trunk/reactos/tools/widl/write_msft.c [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
Modified: trunk/reactos/tools/widl/expr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/widl/expr.c?rev=6990…
Modified: trunk/reactos/tools/widl/header.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/widl/header.c?rev=69…
Modified: trunk/reactos/tools/widl/header.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/widl/header.h?rev=69…
Modified: trunk/reactos/tools/widl/parser.l URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/widl/parser.l?rev=69…
Modified: trunk/reactos/tools/widl/parser.tab.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/widl/parser.tab.c?re…
Modified: trunk/reactos/tools/widl/parser.tab.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/widl/parser.tab.h?re…
Modified: trunk/reactos/tools/widl/parser.y URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/widl/parser.y?rev=69…
Modified: trunk/reactos/tools/widl/parser.yy.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/widl/parser.yy.c?rev…
Modified: trunk/reactos/tools/widl/proxy.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/widl/proxy.c?rev=699…
Modified: trunk/reactos/tools/widl/register.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/widl/register.c?rev=…
Modified: trunk/reactos/tools/widl/typegen.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/widl/typegen.c?rev=6…
Modified: trunk/reactos/tools/widl/typelib.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/widl/typelib.c?rev=6…
Modified: trunk/reactos/tools/widl/typetree.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/widl/typetree.c?rev=…
Modified: trunk/reactos/tools/widl/typetree.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/widl/typetree.h?rev=…
Modified: trunk/reactos/tools/widl/widl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/widl/widl.c?rev=6990…
Modified: trunk/reactos/tools/widl/widl.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/widl/widl.h?rev=6990…
Modified: trunk/reactos/tools/widl/widl_ros.diff URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/widl/widl_ros.diff?r…
Modified: trunk/reactos/tools/widl/widltypes.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/widl/widltypes.h?rev…
Modified: trunk/reactos/tools/widl/write_msft.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/widl/write_msft.c?re…
9 years, 5 months
1
0
0
0
[tfaber] 69901: [ACPI] - Completely duplicate CompatibleIdList before freeing the original in acpi_bus_add. Fixes use after free
by tfaber@svn.reactos.org
Author: tfaber Date: Mon Nov 16 20:01:04 2015 New Revision: 69901 URL:
http://svn.reactos.org/svn/reactos?rev=69901&view=rev
Log: [ACPI] - Completely duplicate CompatibleIdList before freeing the original in acpi_bus_add. Fixes use after free Modified: trunk/reactos/drivers/bus/acpi/busmgr/bus.c Modified: trunk/reactos/drivers/bus/acpi/busmgr/bus.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/busmgr/bu…
============================================================================== --- trunk/reactos/drivers/bus/acpi/busmgr/bus.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/acpi/busmgr/bus.c [iso-8859-1] Mon Nov 16 20:01:04 2015 @@ -1258,8 +1258,19 @@ if (info->Valid & ACPI_VALID_CID) { cid_list = &info->CompatibleIdList; device->pnp.cid_list = ExAllocatePoolWithTag(NonPagedPool,cid_list->ListSize, 'DpcA'); - if (device->pnp.cid_list) - memcpy(device->pnp.cid_list, cid_list, cid_list->ListSize); + if (device->pnp.cid_list) { + char *p = (char *)&device->pnp.cid_list->Ids[cid_list->Count]; + device->pnp.cid_list->Count = cid_list->Count; + device->pnp.cid_list->ListSize = cid_list->ListSize; + for (i = 0; i < cid_list->Count; i++) { + device->pnp.cid_list->Ids[i].Length = cid_list->Ids[i].Length; + device->pnp.cid_list->Ids[i].String = p; + ASSERT(p + cid_list->Ids[i].Length <= (char *)device->pnp.cid_list + cid_list->ListSize); + memcpy(device->pnp.cid_list->Ids[i].String, + cid_list->Ids[i].String, cid_list->Ids[i].Length); + p += cid_list->Ids[i].Length; + } + } else DPRINT("Memory allocation error\n"); }
9 years, 5 months
1
0
0
0
[tfaber] 69900: [PARPORT] - Initialize DeviceRelations->Count in FdoQueryBusRelations - Don't fake success for unsupported PNP minor functions, it makes the kernel very unhappy Powered by Special Pool
by tfaber@svn.reactos.org
Author: tfaber Date: Mon Nov 16 19:56:00 2015 New Revision: 69900 URL:
http://svn.reactos.org/svn/reactos?rev=69900&view=rev
Log: [PARPORT] - Initialize DeviceRelations->Count in FdoQueryBusRelations - Don't fake success for unsupported PNP minor functions, it makes the kernel very unhappy Powered by Special Pool Modified: trunk/reactos/drivers/parallel/parport/fdo.c trunk/reactos/drivers/parallel/parport/pdo.c Modified: trunk/reactos/drivers/parallel/parport/fdo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/parallel/parport/f…
============================================================================== --- trunk/reactos/drivers/parallel/parport/fdo.c [iso-8859-1] (original) +++ trunk/reactos/drivers/parallel/parport/fdo.c [iso-8859-1] Mon Nov 16 19:56:00 2015 @@ -371,6 +371,7 @@ i = 0; ObReferenceObject(DeviceExtension->AttachedRawPdo); DeviceRelations->Objects[i] = DeviceExtension->AttachedRawPdo; + DeviceRelations->Count = 1; Irp->IoStatus.Information = (ULONG_PTR)DeviceRelations; Modified: trunk/reactos/drivers/parallel/parport/pdo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/parallel/parport/p…
============================================================================== --- trunk/reactos/drivers/parallel/parport/pdo.c [iso-8859-1] (original) +++ trunk/reactos/drivers/parallel/parport/pdo.c [iso-8859-1] Mon Nov 16 19:56:00 2015 @@ -161,12 +161,12 @@ PdoPnp(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp) { + NTSTATUS Status; DPRINT("PdoPnp()\n"); - Irp->IoStatus.Information = 0; - Irp->IoStatus.Status = STATUS_SUCCESS; + Status = Irp->IoStatus.Status; IoCompleteRequest(Irp, IO_NO_INCREMENT); - return STATUS_SUCCESS; + return Status; }
9 years, 5 months
1
0
0
0
[tfaber] 69899: [ACPI] - Addendum to r69867: free device info pointer at the end of acpi_bus_add to avoid use after free. Powered by Special Pool
by tfaber@svn.reactos.org
Author: tfaber Date: Mon Nov 16 14:20:25 2015 New Revision: 69899 URL:
http://svn.reactos.org/svn/reactos?rev=69899&view=rev
Log: [ACPI] - Addendum to r69867: free device info pointer at the end of acpi_bus_add to avoid use after free. Powered by Special Pool Modified: trunk/reactos/drivers/bus/acpi/busmgr/bus.c Modified: trunk/reactos/drivers/bus/acpi/busmgr/bus.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/busmgr/bu…
============================================================================== --- trunk/reactos/drivers/bus/acpi/busmgr/bus.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/acpi/busmgr/bus.c [iso-8859-1] Mon Nov 16 14:20:25 2015 @@ -1138,7 +1138,7 @@ struct acpi_device *device = NULL; char bus_id[5] = {'?',0}; ACPI_BUFFER buffer; - ACPI_DEVICE_INFO *info; + ACPI_DEVICE_INFO *info = NULL; char *hid = NULL; char *uid = NULL; ACPI_PNP_DEVICE_ID_LIST *cid_list = NULL; @@ -1248,6 +1248,7 @@ ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error reading device info\n")); result = AE_NOT_FOUND; + info = NULL; goto end; } if (info->Valid & ACPI_VALID_HID) @@ -1266,7 +1267,6 @@ device->pnp.bus_address = info->Address; device->flags.bus_address = 1; } - ACPI_FREE(info); break; case ACPI_BUS_TYPE_POWER: hid = ACPI_POWER_HID; @@ -1427,6 +1427,8 @@ acpi_bus_find_driver(device); end: + if (info != NULL) + ACPI_FREE(info); if (result) { if (device->pnp.cid_list) { ExFreePoolWithTag(device->pnp.cid_list, 'DpcA');
9 years, 5 months
1
0
0
0
[tfaber] 69898: [FASTFAT] - Correctly track the buffer length in VfatGetAllInformation. Fixes pool corruption when running ntdll_winetest:file
by tfaber@svn.reactos.org
Author: tfaber Date: Mon Nov 16 13:58:39 2015 New Revision: 69898 URL:
http://svn.reactos.org/svn/reactos?rev=69898&view=rev
Log: [FASTFAT] - Correctly track the buffer length in VfatGetAllInformation. Fixes pool corruption when running ntdll_winetest:file Modified: trunk/reactos/drivers/filesystems/fastfat/finfo.c Modified: trunk/reactos/drivers/filesystems/fastfat/finfo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
============================================================================== --- trunk/reactos/drivers/filesystems/fastfat/finfo.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/fastfat/finfo.c [iso-8859-1] Mon Nov 16 13:58:39 2015 @@ -1070,12 +1070,11 @@ PULONG BufferLength) { NTSTATUS Status; - ULONG InitialBufferLength = *BufferLength; ASSERT(Info); ASSERT(Fcb); - if (*BufferLength < sizeof(FILE_ALL_INFORMATION)) + if (*BufferLength < FIELD_OFFSET(FILE_ALL_INFORMATION, NameInformation.FileName)) return STATUS_BUFFER_OVERFLOW; /* Basic Information */ @@ -1088,19 +1087,19 @@ Status = VfatGetInternalInformation(Fcb, &Info->InternalInformation, BufferLength); if (!NT_SUCCESS(Status)) return Status; /* EA Information */ - Info->EaInformation.EaSize = 0; + Status = VfatGetEaInformation(FileObject, Fcb, DeviceObject, &Info->EaInformation, BufferLength); + if (!NT_SUCCESS(Status)) return Status; /* Access Information: The IO-Manager adds this information */ + *BufferLength -= sizeof(FILE_ACCESS_INFORMATION); /* Position Information */ Status = VfatGetPositionInformation(FileObject, Fcb, DeviceObject, &Info->PositionInformation, BufferLength); if (!NT_SUCCESS(Status)) return Status; /* Mode Information: The IO-Manager adds this information */ + *BufferLength -= sizeof(FILE_MODE_INFORMATION); /* Alignment Information: The IO-Manager adds this information */ + *BufferLength -= sizeof(FILE_ALIGNMENT_INFORMATION); /* Name Information */ Status = VfatGetNameInformation(FileObject, Fcb, DeviceObject, &Info->NameInformation, BufferLength); - - *BufferLength = InitialBufferLength - sizeof(FILE_ALL_INFORMATION); - if (InitialBufferLength > sizeof(FILE_ALL_INFORMATION)) - *BufferLength -= min(InitialBufferLength - sizeof(FILE_ALL_INFORMATION), Fcb->PathNameU.Length); return Status; }
9 years, 5 months
1
0
0
0
[tfaber] 69897: [KMTESTS:IO] - Add a test for FileAllInformation
by tfaber@svn.reactos.org
Author: tfaber Date: Mon Nov 16 13:53:03 2015 New Revision: 69897 URL:
http://svn.reactos.org/svn/reactos?rev=69897&view=rev
Log: [KMTESTS:IO] - Add a test for FileAllInformation Modified: trunk/rostests/kmtests/ntos_io/IoFilesystem.c Modified: trunk/rostests/kmtests/ntos_io/IoFilesystem.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/kmtests/ntos_io/IoFilesys…
============================================================================== --- trunk/rostests/kmtests/ntos_io/IoFilesystem.c [iso-8859-1] (original) +++ trunk/rostests/kmtests/ntos_io/IoFilesystem.c [iso-8859-1] Mon Nov 16 13:53:03 2015 @@ -8,6 +8,201 @@ #include <kmt_test.h> /* FIXME: Test this stuff on non-FAT volumes */ + +static +NTSTATUS +QueryFileInfo( + _In_ HANDLE FileHandle, + _Out_ PVOID *Info, + _Inout_ PSIZE_T Length, + _In_ FILE_INFORMATION_CLASS FileInformationClass) +{ + NTSTATUS Status; + IO_STATUS_BLOCK IoStatus; + PVOID Buffer; + + *Info = NULL; + if (*Length) + { + Buffer = KmtAllocateGuarded(*Length); + if (skip(Buffer != NULL, "Failed to allocate %Iu bytes\n", *Length)) + return STATUS_INSUFFICIENT_RESOURCES; + } + else + { + Buffer = NULL; + } + RtlFillMemory(Buffer, *Length, 0xDD); + RtlFillMemory(&IoStatus, sizeof(IoStatus), 0x55); + _SEH2_TRY + { + Status = ZwQueryInformationFile(FileHandle, + &IoStatus, + Buffer, + *Length, + FileInformationClass); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + Status = _SEH2_GetExceptionCode(); + ok(0, "Exception %lx querying class %d with length %Iu\n", + Status, FileInformationClass, *Length); + } + _SEH2_END; + if (Status == STATUS_PENDING) + { + Status = ZwWaitForSingleObject(FileHandle, FALSE, NULL); + ok_eq_hex(Status, STATUS_SUCCESS); + Status = IoStatus.Status; + } + *Length = IoStatus.Information; + *Info = Buffer; + return Status; +} + +static +VOID +TestAllInformation(VOID) +{ + NTSTATUS Status; + UNICODE_STRING FileName = RTL_CONSTANT_STRING(L"\\SystemRoot\\system32\\ntoskrnl.exe"); + UNICODE_STRING Ntoskrnl = RTL_CONSTANT_STRING(L"ntoskrnl.exe"); + OBJECT_ATTRIBUTES ObjectAttributes; + HANDLE FileHandle; + IO_STATUS_BLOCK IoStatus; + PFILE_ALL_INFORMATION FileAllInfo; + SIZE_T Length; + ULONG NameLength; + PWCHAR Name = NULL; + UNICODE_STRING NamePart; + + InitializeObjectAttributes(&ObjectAttributes, + &FileName, + OBJ_KERNEL_HANDLE | OBJ_CASE_INSENSITIVE, + NULL, + NULL); + Status = ZwOpenFile(&FileHandle, + SYNCHRONIZE | FILE_READ_ATTRIBUTES, + &ObjectAttributes, + &IoStatus, + FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, + FILE_NON_DIRECTORY_FILE); + if (Status == STATUS_PENDING) + { + Status = ZwWaitForSingleObject(FileHandle, FALSE, NULL); + ok_eq_hex(Status, STATUS_SUCCESS); + Status = IoStatus.Status; + } + ok_eq_hex(Status, STATUS_SUCCESS); + if (skip(NT_SUCCESS(Status), "No file handle, %lx\n", Status)) + return; + + /* NtQueryInformationFile doesn't do length checks for kernel callers in a free build */ + if (KmtIsCheckedBuild) + { + /* Zero length */ + Length = 0; + Status = QueryFileInfo(FileHandle, (PVOID*)&FileAllInfo, &Length, FileAllInformation); + ok_eq_hex(Status, STATUS_INFO_LENGTH_MISMATCH); + ok_eq_size(Length, (ULONG_PTR)0x5555555555555555); + if (FileAllInfo) + KmtFreeGuarded(FileAllInfo); + + /* One less than the minimum */ + Length = FIELD_OFFSET(FILE_ALL_INFORMATION, NameInformation.FileName) - 1; + Status = QueryFileInfo(FileHandle, (PVOID*)&FileAllInfo, &Length, FileAllInformation); + ok_eq_hex(Status, STATUS_INFO_LENGTH_MISMATCH); + ok_eq_size(Length, (ULONG_PTR)0x5555555555555555); + if (FileAllInfo) + KmtFreeGuarded(FileAllInfo); + } + + /* The minimum allowed */ + Length = FIELD_OFFSET(FILE_ALL_INFORMATION, NameInformation.FileName); + Status = QueryFileInfo(FileHandle, (PVOID*)&FileAllInfo, &Length, FileAllInformation); + ok_eq_hex(Status, STATUS_BUFFER_OVERFLOW); + ok_eq_size(Length, FIELD_OFFSET(FILE_ALL_INFORMATION, NameInformation.FileName)); + if (FileAllInfo) + KmtFreeGuarded(FileAllInfo); + + /* Plenty of space -- determine NameLength and copy the name */ + Length = FIELD_OFFSET(FILE_ALL_INFORMATION, NameInformation.FileName) + MAX_PATH * sizeof(WCHAR); + Status = QueryFileInfo(FileHandle, (PVOID*)&FileAllInfo, &Length, FileAllInformation); + ok_eq_hex(Status, STATUS_SUCCESS); + if (!skip(NT_SUCCESS(Status) && FileAllInfo != NULL, "No info\n")) + { + NameLength = FileAllInfo->NameInformation.FileNameLength; + ok_eq_size(Length, FIELD_OFFSET(FILE_ALL_INFORMATION, NameInformation.FileName) + NameLength); + Name = ExAllocatePoolWithTag(PagedPool, NameLength + sizeof(UNICODE_NULL), 'sFmK'); + if (!skip(Name != NULL, "Could not allocate %lu bytes\n", NameLength + (ULONG)sizeof(UNICODE_NULL))) + { + RtlCopyMemory(Name, + FileAllInfo->NameInformation.FileName, + NameLength); + Name[NameLength / sizeof(WCHAR)] = UNICODE_NULL; + ok(Name[0] == L'\\', "Name is %ls, expected first char to be \\\n", Name); + ok(NameLength >= Ntoskrnl.Length + sizeof(WCHAR), "NameLength %lu too short\n", NameLength); + if (NameLength >= Ntoskrnl.Length) + { + NamePart.Buffer = Name + (NameLength - Ntoskrnl.Length) / sizeof(WCHAR); + NamePart.Length = Ntoskrnl.Length; + NamePart.MaximumLength = NamePart.Length; + ok(RtlEqualUnicodeString(&NamePart, &Ntoskrnl, TRUE), + "Name ends in '%wZ', expected %wZ\n", &NamePart, &Ntoskrnl); + } + } + ok(FileAllInfo->NameInformation.FileName[NameLength / sizeof(WCHAR)] == 0xdddd, + "Char past FileName is %x\n", + FileAllInfo->NameInformation.FileName[NameLength / sizeof(WCHAR)]); + } + if (FileAllInfo) + KmtFreeGuarded(FileAllInfo); + + /* One char less than needed */ + Length = FIELD_OFFSET(FILE_ALL_INFORMATION, NameInformation.FileName) + NameLength - sizeof(WCHAR); + Status = QueryFileInfo(FileHandle, (PVOID*)&FileAllInfo, &Length, FileAllInformation); + ok_eq_hex(Status, STATUS_BUFFER_OVERFLOW); + ok_eq_size(Length, FIELD_OFFSET(FILE_ALL_INFORMATION, NameInformation.FileName) + NameLength - sizeof(WCHAR)); + if (FileAllInfo) + KmtFreeGuarded(FileAllInfo); + + /* One byte less than needed */ + Length = FIELD_OFFSET(FILE_ALL_INFORMATION, NameInformation.FileName) + NameLength - 1; + Status = QueryFileInfo(FileHandle, (PVOID*)&FileAllInfo, &Length, FileAllInformation); + ok_eq_hex(Status, STATUS_BUFFER_OVERFLOW); + ok_eq_size(Length, FIELD_OFFSET(FILE_ALL_INFORMATION, NameInformation.FileName) + NameLength - 1); + if (FileAllInfo) + KmtFreeGuarded(FileAllInfo); + + /* Exactly the required size */ + Length = FIELD_OFFSET(FILE_ALL_INFORMATION, NameInformation.FileName) + NameLength; + Status = QueryFileInfo(FileHandle, (PVOID*)&FileAllInfo, &Length, FileAllInformation); + ok_eq_hex(Status, STATUS_SUCCESS); + ok_eq_size(Length, FIELD_OFFSET(FILE_ALL_INFORMATION, NameInformation.FileName) + NameLength); + if (FileAllInfo) + KmtFreeGuarded(FileAllInfo); + + /* One byte more than needed */ + Length = FIELD_OFFSET(FILE_ALL_INFORMATION, NameInformation.FileName) + NameLength + 1; + Status = QueryFileInfo(FileHandle, (PVOID*)&FileAllInfo, &Length, FileAllInformation); + ok_eq_hex(Status, STATUS_SUCCESS); + ok_eq_size(Length, FIELD_OFFSET(FILE_ALL_INFORMATION, NameInformation.FileName) + NameLength); + if (FileAllInfo) + KmtFreeGuarded(FileAllInfo); + + /* One char more than needed */ + Length = FIELD_OFFSET(FILE_ALL_INFORMATION, NameInformation.FileName) + NameLength + sizeof(WCHAR); + Status = QueryFileInfo(FileHandle, (PVOID*)&FileAllInfo, &Length, FileAllInformation); + ok_eq_hex(Status, STATUS_SUCCESS); + ok_eq_size(Length, FIELD_OFFSET(FILE_ALL_INFORMATION, NameInformation.FileName) + NameLength); + if (FileAllInfo) + KmtFreeGuarded(FileAllInfo); + + ExFreePoolWithTag(Name, 'sFmK'); + + Status = ObCloseHandle(FileHandle, KernelMode); + ok_eq_hex(Status, STATUS_SUCCESS); +} static VOID @@ -443,6 +638,7 @@ START_TEST(IoFilesystem) { + TestAllInformation(); TestRelativeNames(); TestSharedCacheMap(); }
9 years, 5 months
1
0
0
0
[tfaber] 69896: [CDFS] - Don't access file name buffer if its Length is zero in CdfsMakeAbsoluteFilename CORE-10459
by tfaber@svn.reactos.org
Author: tfaber Date: Mon Nov 16 11:01:36 2015 New Revision: 69896 URL:
http://svn.reactos.org/svn/reactos?rev=69896&view=rev
Log: [CDFS] - Don't access file name buffer if its Length is zero in CdfsMakeAbsoluteFilename CORE-10459 Modified: trunk/reactos/drivers/filesystems/cdfs/create.c Modified: trunk/reactos/drivers/filesystems/cdfs/create.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/cdfs/c…
============================================================================== --- trunk/reactos/drivers/filesystems/cdfs/create.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/cdfs/create.c [iso-8859-1] Mon Nov 16 11:01:36 2015 @@ -50,7 +50,8 @@ /* verify related object is a directory and target name don't start with \. */ if ((Fcb->Entry.FileFlags & FILE_FLAG_DIRECTORY) == 0 || - RelativeFileName->Buffer[0] == L'\\') + (RelativeFileName->Length >= sizeof(WCHAR) && + RelativeFileName->Buffer[0] == L'\\')) { return STATUS_INVALID_PARAMETER; }
9 years, 5 months
1
0
0
0
[tfaber] 69895: [NTDLL_APITEST] - Add a test for RtlImageRvaToVa CORE-10523
by tfaber@svn.reactos.org
Author: tfaber Date: Mon Nov 16 09:48:39 2015 New Revision: 69895 URL:
http://svn.reactos.org/svn/reactos?rev=69895&view=rev
Log: [NTDLL_APITEST] - Add a test for RtlImageRvaToVa CORE-10523 Added: trunk/rostests/apitests/ntdll/RtlImageRvaToVa.c (with props) Modified: trunk/rostests/apitests/ntdll/CMakeLists.txt trunk/rostests/apitests/ntdll/testlist.c Modified: trunk/rostests/apitests/ntdll/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/ntdll/CMakeLists…
============================================================================== --- trunk/rostests/apitests/ntdll/CMakeLists.txt [iso-8859-1] (original) +++ trunk/rostests/apitests/ntdll/CMakeLists.txt [iso-8859-1] Mon Nov 16 09:48:39 2015 @@ -31,6 +31,7 @@ RtlGetFullPathName_UstrEx.c RtlGetLengthWithoutTrailingPathSeperators.c RtlGetLongestNtPathLength.c + RtlImageRvaToVa.c RtlInitializeBitMap.c RtlMemoryStream.c RtlReAllocateHeap.c Added: trunk/rostests/apitests/ntdll/RtlImageRvaToVa.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/ntdll/RtlImageRv…
============================================================================== --- trunk/rostests/apitests/ntdll/RtlImageRvaToVa.c (added) +++ trunk/rostests/apitests/ntdll/RtlImageRvaToVa.c [iso-8859-1] Mon Nov 16 09:48:39 2015 @@ -0,0 +1,235 @@ +/* + * PROJECT: ReactOS api tests + * LICENSE: LGPLv2.1+ - See COPYING.LIB in the top level directory + * PURPOSE: Test for RtlImageRvaToVa + * PROGRAMMERS: Thomas Faber <thomas.faber(a)reactos.org> + */ + +#include <apitest.h> +#include <ndk/mmfuncs.h> +#include <ndk/rtlfuncs.h> + +static +PVOID +AllocateGuarded( + _In_ SIZE_T SizeRequested) +{ + NTSTATUS Status; + SIZE_T Size = PAGE_ROUND_UP(SizeRequested + PAGE_SIZE); + PVOID VirtualMemory = NULL; + PCHAR StartOfBuffer; + + Status = NtAllocateVirtualMemory(NtCurrentProcess(), &VirtualMemory, 0, &Size, MEM_RESERVE, PAGE_NOACCESS); + + if (!NT_SUCCESS(Status)) + return NULL; + + Size -= PAGE_SIZE; + if (Size) + { + Status = NtAllocateVirtualMemory(NtCurrentProcess(), &VirtualMemory, 0, &Size, MEM_COMMIT, PAGE_READWRITE); + if (!NT_SUCCESS(Status)) + { + Size = 0; + Status = NtFreeVirtualMemory(NtCurrentProcess(), &VirtualMemory, &Size, MEM_RELEASE); + ok(Status == STATUS_SUCCESS, "Status = %lx\n", Status); + return NULL; + } + } + + StartOfBuffer = VirtualMemory; + StartOfBuffer += Size - SizeRequested; + + return StartOfBuffer; +} + +static +VOID +FreeGuarded( + _In_ PVOID Pointer) +{ + NTSTATUS Status; + PVOID VirtualMemory = (PVOID)PAGE_ROUND_DOWN((SIZE_T)Pointer); + SIZE_T Size = 0; + + Status = NtFreeVirtualMemory(NtCurrentProcess(), &VirtualMemory, &Size, MEM_RELEASE); + ok(Status == STATUS_SUCCESS, "Status = %lx\n", Status); +} + +START_TEST(RtlImageRvaToVa) +{ + PIMAGE_NT_HEADERS NtHeader; + PIMAGE_SECTION_HEADER Section; + ULONG NumberOfSections; + ULONG ImageSize; + PUCHAR BaseAddress; + PVOID Va; + PIMAGE_SECTION_HEADER OutSection; + IMAGE_SECTION_HEADER DummySection; + struct + { + ULONG Rva; + ULONG VaOffset; + ULONG SectionIndex; + } Tests[] = + { + { 0, 0, 0 }, + { 0xfff, 0, 0 }, + { 0x1000, 0x3000, 0 }, + { 0x1001, 0x3001, 0 }, + { 0x1fff, 0x3fff, 0 }, + { 0x2000, 0, 0 }, + { 0x2fff, 0, 0 }, + { 0x3000, 0x4000, 3 }, + { 0x3fff, 0x4fff, 3 }, + { 0x4000, 0x5000, 3 }, + { 0x4fff, 0x5fff, 3 }, + { 0x5000, 0, 0 }, + { 0x5fff, 0, 0 }, + { 0x6000, 0, 0 }, + { 0x6fff, 0, 0 }, + { 0x7000, 0x7000, 5 }, + { 0x7fff, 0x7fff, 5 }, + { 0x8000, 0x9000, 7 }, + { 0x8fff, 0x9fff, 7 }, + { 0x9000, 0x8000, 6 }, + { 0x9fff, 0x8fff, 6 }, + }; + ULONG i; + + NumberOfSections = 8; + ImageSize = FIELD_OFFSET(IMAGE_NT_HEADERS, OptionalHeader.DataDirectory) + + NumberOfSections * sizeof(IMAGE_SECTION_HEADER); + NtHeader = AllocateGuarded(ImageSize); + if (!NtHeader) + { + skip("Could not allocate %lu bytes\n", ImageSize); + return; + } + + RtlFillMemory(NtHeader, ImageSize, 0xDD); + NtHeader->FileHeader.NumberOfSections = NumberOfSections; + NtHeader->FileHeader.SizeOfOptionalHeader = FIELD_OFFSET(IMAGE_OPTIONAL_HEADER, DataDirectory); + Section = (PIMAGE_SECTION_HEADER)((PUCHAR)&NtHeader->OptionalHeader + + NtHeader->FileHeader.SizeOfOptionalHeader); + Section[0].VirtualAddress = 0x1000; + Section[0].Misc.VirtualSize = 0x1000; + Section[0].SizeOfRawData = 0x1000; + Section[0].PointerToRawData = 0x3000; + Section[1].VirtualAddress = 0x2000; + Section[1].Misc.VirtualSize = 0; + Section[1].SizeOfRawData = 0; + Section[1].PointerToRawData = 0x4000; + Section[2].VirtualAddress = 0x2000; + Section[2].Misc.VirtualSize = 0x1000; + Section[2].SizeOfRawData = 0; + Section[2].PointerToRawData = 0x4000; + Section[3].VirtualAddress = 0x3000; + Section[3].Misc.VirtualSize = 0x1000; + Section[3].SizeOfRawData = 0x2000; + Section[3].PointerToRawData = 0x4000; + Section[4].VirtualAddress = 0x4000; + Section[4].Misc.VirtualSize = 0x2000; + Section[4].SizeOfRawData = 0x1000; + Section[4].PointerToRawData = 0x6000; + Section[5].VirtualAddress = 0x7000; + Section[5].Misc.VirtualSize = 0x1000; + Section[5].SizeOfRawData = 0x1000; + Section[5].PointerToRawData = 0x7000; + Section[6].VirtualAddress = 0x9000; + Section[6].Misc.VirtualSize = 0x1000; + Section[6].SizeOfRawData = 0x1000; + Section[6].PointerToRawData = 0x8000; + Section[7].VirtualAddress = 0x8000; + Section[7].Misc.VirtualSize = 0x1000; + Section[7].SizeOfRawData = 0x1000; + Section[7].PointerToRawData = 0x9000; + DummySection.VirtualAddress = 0xf000; + DummySection.Misc.VirtualSize = 0xf000; + DummySection.SizeOfRawData = 0xf000; + DummySection.PointerToRawData = 0xf000; + + BaseAddress = (PUCHAR)0x2000000; + + StartSeh() + RtlImageRvaToVa(NULL, NULL, 0, NULL); + EndSeh(STATUS_ACCESS_VIOLATION); + + Va = RtlImageRvaToVa(NtHeader, NULL, 0, NULL); + ok(Va == NULL, "Va = %p\n", Va); + + Va = RtlImageRvaToVa(NtHeader, BaseAddress, 0, NULL); + ok(Va == NULL, "Va = %p\n", Va); + + OutSection = NULL; + Va = RtlImageRvaToVa(NtHeader, BaseAddress, 0, &OutSection); + ok(Va == NULL, "Va = %p\n", Va); + ok(OutSection == NULL, "OutSection = %p\n", OutSection); + + OutSection = (PVOID)1; + StartSeh() + RtlImageRvaToVa(NtHeader, BaseAddress, 0, &OutSection); + EndSeh(STATUS_ACCESS_VIOLATION); + + for (i = 0; i < RTL_NUMBER_OF(Tests); i++) + { + /* Section = not specified */ + StartSeh() + Va = RtlImageRvaToVa(NtHeader, BaseAddress, Tests[i].Rva, NULL); + EndSeh(STATUS_SUCCESS); + if (Tests[i].VaOffset == 0) + ok(Va == NULL, "[0x%lx] Va = %p\n", Tests[i].Rva, Va); + else + ok(Va == BaseAddress + Tests[i].VaOffset, "[0x%lx] Va = %p\n", Tests[i].Rva, Va); + + /* Section = NULL */ + OutSection = NULL; + StartSeh() + Va = RtlImageRvaToVa(NtHeader, BaseAddress, Tests[i].Rva, &OutSection); + EndSeh(STATUS_SUCCESS); + if (Tests[i].VaOffset == 0) + { + ok(Va == NULL, "[0x%lx] Va = %p\n", Tests[i].Rva, Va); + ok(OutSection == NULL, "[0x%lx] OutSection = %p (%Id)\n", Tests[i].Rva, OutSection, OutSection - Section); + } + else + { + ok(Va == BaseAddress + Tests[i].VaOffset, "[0x%lx] Va = %p\n", Tests[i].Rva, Va); + ok(OutSection == &Section[Tests[i].SectionIndex], "[0x%lx] OutSection = %p (%Id)\n", Tests[i].Rva, OutSection, OutSection - Section); + } + + /* Section = first section */ + OutSection = Section; + StartSeh() + Va = RtlImageRvaToVa(NtHeader, BaseAddress, Tests[i].Rva, &OutSection); + EndSeh(STATUS_SUCCESS); + if (Tests[i].VaOffset == 0) + { + ok(Va == NULL, "[0x%lx] Va = %p\n", Tests[i].Rva, Va); + ok(OutSection == Section, "[0x%lx] OutSection = %p (%Id)\n", Tests[i].Rva, OutSection, OutSection - Section); + } + else + { + ok(Va == BaseAddress + Tests[i].VaOffset, "[0x%lx] Va = %p\n", Tests[i].Rva, Va); + ok(OutSection == &Section[Tests[i].SectionIndex], "[0x%lx] OutSection = %p (%Id)\n", Tests[i].Rva, OutSection, OutSection - Section); + } + + /* Section = dummy section */ + OutSection = &DummySection; + StartSeh() + Va = RtlImageRvaToVa(NtHeader, BaseAddress, Tests[i].Rva, &OutSection); + EndSeh(STATUS_SUCCESS); + if (Tests[i].VaOffset == 0) + { + ok(Va == NULL, "[0x%lx] Va = %p\n", Tests[i].Rva, Va); + ok(OutSection == &DummySection, "[0x%lx] OutSection = %p (%Id)\n", Tests[i].Rva, OutSection, OutSection - Section); + } + else + { + ok(Va == BaseAddress + Tests[i].VaOffset, "[0x%lx] Va = %p\n", Tests[i].Rva, Va); + ok(OutSection == &Section[Tests[i].SectionIndex], "[0x%lx] OutSection = %p (%Id)\n", Tests[i].Rva, OutSection, OutSection - Section); + } + } + + FreeGuarded(NtHeader); +} Propchange: trunk/rostests/apitests/ntdll/RtlImageRvaToVa.c ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/rostests/apitests/ntdll/testlist.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/ntdll/testlist.c…
============================================================================== --- trunk/rostests/apitests/ntdll/testlist.c [iso-8859-1] (original) +++ trunk/rostests/apitests/ntdll/testlist.c [iso-8859-1] Mon Nov 16 09:48:39 2015 @@ -35,6 +35,7 @@ extern void func_RtlGetFullPathName_UstrEx(void); extern void func_RtlGetLengthWithoutTrailingPathSeperators(void); extern void func_RtlGetLongestNtPathLength(void); +extern void func_RtlImageRvaToVa(void); extern void func_RtlInitializeBitMap(void); extern void func_RtlMemoryStream(void); extern void func_RtlReAllocateHeap(void); @@ -75,6 +76,7 @@ { "RtlGetFullPathName_UstrEx", func_RtlGetFullPathName_UstrEx }, { "RtlGetLengthWithoutTrailingPathSeperators", func_RtlGetLengthWithoutTrailingPathSeperators }, { "RtlGetLongestNtPathLength", func_RtlGetLongestNtPathLength }, + { "RtlImageRvaToVa", func_RtlImageRvaToVa }, { "RtlInitializeBitMap", func_RtlInitializeBitMap }, { "RtlMemoryStream", func_RtlMemoryStream }, { "RtlReAllocateHeap", func_RtlReAllocateHeap },
9 years, 5 months
1
0
0
0
← Newer
1
...
30
31
32
33
34
35
36
...
46
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
Results per page:
10
25
50
100
200