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
November 2015
----- 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
[pschweitzer] 70024: [PSDK] Define the IOCTL_QUERY_IP_HW_ADDRESS which allows asking for ARP probe
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Sun Nov 22 14:47:40 2015 New Revision: 70024 URL:
http://svn.reactos.org/svn/reactos?rev=70024&view=rev
Log: [PSDK] Define the IOCTL_QUERY_IP_HW_ADDRESS which allows asking for ARP probe Modified: trunk/reactos/include/psdk/tcpioctl.h Modified: trunk/reactos/include/psdk/tcpioctl.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/tcpioctl.h?re…
============================================================================== --- trunk/reactos/include/psdk/tcpioctl.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/tcpioctl.h [iso-8859-1] Sun Nov 22 14:47:40 2015 @@ -36,6 +36,9 @@ #define IOCTL_TCP_SET_INFORMATION_EX \ _TCP_CTL_CODE(1, METHOD_BUFFERED, FILE_WRITE_ACCESS) + +#define IOCTL_QUERY_IP_HW_ADDRESS \ + _TCP_CTL_CODE(15, METHOD_BUFFERED, FILE_ANY_ACCESS) #define IOCTL_SET_IP_ADDRESS \ _TCP_CTL_CODE(14, METHOD_BUFFERED, FILE_WRITE_ACCESS)
9 years, 1 month
1
0
0
0
[tfaber] 70023: [CRT_APITEST] - Add tests for static object destructors. Patch by Mark Jansen. CORE-10562
by tfaber@svn.reactos.org
Author: tfaber Date: Sun Nov 22 14:01:04 2015 New Revision: 70023 URL:
http://svn.reactos.org/svn/reactos?rev=70023&view=rev
Log: [CRT_APITEST] - Add tests for static object destructors. Patch by Mark Jansen. CORE-10562 Modified: trunk/rostests/apitests/crt/static_construct.cpp Modified: trunk/rostests/apitests/crt/static_construct.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/crt/static_const…
============================================================================== --- trunk/rostests/apitests/crt/static_construct.cpp [iso-8859-1] (original) +++ trunk/rostests/apitests/crt/static_construct.cpp [iso-8859-1] Sun Nov 22 14:01:04 2015 @@ -3,6 +3,7 @@ * LICENSE: LGPLv2.1+ - See COPYING.LIB in the top level directory * PURPOSE: Test for static C++ object construction * PROGRAMMER: Thomas Faber <thomas.faber(a)reactos.org> + * Mark Jansen */ #include <apitest.h> @@ -101,8 +102,127 @@ ok(values.dtor_counter == 7879, "dtor_counter = %d\n", values.dtor_counter); } +struct shared_memory +{ + int init_count; + int uninit_count; +}; + +static HANDLE g_FileMapping = NULL; +static BOOL g_CreatedFileMapping = FALSE; +static shared_memory* g_Memory = NULL; + +#define MAPPING_NAME L"crt_apitest_static_construct" + +static void map_memory() +{ + if (g_FileMapping) + return; + + g_FileMapping = OpenFileMappingW(FILE_MAP_ALL_ACCESS, FALSE, MAPPING_NAME); + if (g_FileMapping) + { + g_CreatedFileMapping = FALSE; + } + else + { + g_FileMapping = CreateFileMappingW(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, sizeof(shared_memory), MAPPING_NAME); + g_CreatedFileMapping = TRUE; + } + if (g_FileMapping == NULL) + { + skip("Could not map shared memory\n"); + return; + } + g_Memory = static_cast<shared_memory*>(MapViewOfFile(g_FileMapping, FILE_MAP_ALL_ACCESS, 0, 0, sizeof(shared_memory))); + if (g_Memory == NULL) + { + skip("Could not map view of shared memory\n"); + CloseHandle(g_FileMapping); + g_FileMapping = NULL; + } + if (g_CreatedFileMapping) + ZeroMemory(g_Memory, sizeof(shared_memory)); +} + +static void unmap_memory() +{ + // we do not clean the mapping in the child, since we want to count all dtor's! + if (g_FileMapping && g_CreatedFileMapping) + { + UnmapViewOfFile(g_Memory); + CloseHandle(g_FileMapping); + g_Memory = NULL; + g_FileMapping = NULL; + } +} + +static struct shared_mem_static +{ + shared_mem_static() + { + map_memory(); + if (g_Memory) + g_Memory->init_count++; + } + + ~shared_mem_static() + { + if (g_Memory) + g_Memory->uninit_count++; + unmap_memory(); + } + +} shared_mem_static; + +static +VOID +TestStaticDestruct(VOID) +{ + ok(g_Memory != NULL, "Expected the mapping to be in place\n"); + ok(g_CreatedFileMapping == TRUE, "Expected to create a new shared section!\n"); + if (g_Memory == NULL) + { + skip("Can't proceed without file mapping\n"); + return; + } + ok(g_Memory->init_count == 1, "Expected init_count to be 1, was: %d\n", g_Memory->init_count); + ok(g_Memory->uninit_count == 0, "Expected uninit_count to be 0, was: %d\n", g_Memory->uninit_count); + + WCHAR path[MAX_PATH]; + // we just need an extra argument to tell the test it's only running to increment the dtor count :) + GetModuleFileNameW(NULL, path, _countof(path)); + WCHAR buf[MAX_PATH+40]; + StringCchPrintfW(buf, _countof(buf), L"\"%ls\" static_construct dummy", path); + + STARTUPINFOW si = { sizeof(si) }; + PROCESS_INFORMATION pi; + BOOL created = CreateProcessW(NULL, buf, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); + ok(created, "Expected CreateProcess to succeed\n"); + if (created) + { + winetest_wait_child_process(pi.hProcess); + CloseHandle(pi.hThread); + CloseHandle(pi.hProcess); + ok(g_Memory->init_count == 2, "Expected init_count to be 2, was: %d\n", g_Memory->init_count); + ok(g_Memory->uninit_count == 1, "Expected uninit_count to be 1, was: %d\n", g_Memory->uninit_count); + } +} + START_TEST(static_construct) { + char **argv; + int argc = winetest_get_mainargs(&argv); + + if (argc >= 3) + { + // we are just here to increment the reference count in the shared section! + ok(g_Memory != NULL, "Expected the shared memory to be mapped!\n"); + ok(g_CreatedFileMapping == FALSE, "Expected the shared memory to be created by my parent!\n"); + return; + } + TestInitStatic(); TestDllStartup(); -} + TestStaticDestruct(); +}
9 years, 1 month
1
0
0
0
[tfaber] 70022: [CRT_APITEST] - Fix dll loading in static_construct test CORE-10562
by tfaber@svn.reactos.org
Author: tfaber Date: Sun Nov 22 13:51:19 2015 New Revision: 70022 URL:
http://svn.reactos.org/svn/reactos?rev=70022&view=rev
Log: [CRT_APITEST] - Fix dll loading in static_construct test CORE-10562 Modified: trunk/rostests/apitests/crt/static_construct.cpp Modified: trunk/rostests/apitests/crt/static_construct.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/crt/static_const…
============================================================================== --- trunk/rostests/apitests/crt/static_construct.cpp [iso-8859-1] (original) +++ trunk/rostests/apitests/crt/static_construct.cpp [iso-8859-1] Sun Nov 22 13:51:19 2015 @@ -6,6 +6,7 @@ */ #include <apitest.h> +#include <strsafe.h> #include "dll_startup.h" extern "C" @@ -35,7 +36,9 @@ } } init_static; -START_TEST(static_construct) +static +VOID +TestInitStatic(VOID) { ok(static_init_counter_at_startup == 123, "static_init_counter at startup: %d\n", static_init_counter_at_startup); ok(static_construct_counter_at_startup == 789, "static_construct_counter at startup: %d\n", static_construct_counter_at_startup); @@ -46,15 +49,25 @@ ok(static_construct_counter == 790, "static_construct_counter: %d\n", static_construct_counter); ok(init_static.m_counter == 2, "init_static.m_counter: %d\n", init_static.m_counter); ok(init_static.m_uninit == 1, "init_static.m_uninit: %d\n", init_static.m_uninit); +} - counter_values values; +static +VOID +TestDllStartup(VOID) +{ #if defined(TEST_MSVCRT) - HMODULE hDll = LoadLibraryW(L"msvcrt_crt_dll_startup.dll"); + const PCWSTR DllName = L"msvcrt_crt_dll_startup.dll"; #elif defined(TEST_STATIC_CRT) - HMODULE hDll = LoadLibraryW(L"static_crt_dll_startup.dll"); + const PCWSTR DllName = L"static_crt_dll_startup.dll"; #else #error This test only makes sense for static CRT and msvcrt.dll #endif + WCHAR DllPath[MAX_PATH]; + GetModuleFileNameW(NULL, DllPath, _countof(DllPath)); + wcsrchr(DllPath, L'\\')[1] = UNICODE_NULL; + StringCchCatW(DllPath, _countof(DllPath), DllName); + + HMODULE hDll = LoadLibraryW(DllPath); if (hDll == NULL) { skip("Helper dll not found\n"); @@ -67,6 +80,7 @@ FreeLibrary(hDll); return; } + counter_values values; pSetCounterValuesPointer(&values); ok(values.m_uninit_at_startup == 0, "m_uninit_at_startup = %d\n", values.m_uninit_at_startup); ok(values.m_uninit == 1, "m_uninit = %d\n", values.m_uninit); @@ -86,3 +100,9 @@ ok(values.dtor_counter_at_detach == 7878, "dtor_counter_at_detach = %d\n", values.dtor_counter_at_detach); ok(values.dtor_counter == 7879, "dtor_counter = %d\n", values.dtor_counter); } + +START_TEST(static_construct) +{ + TestInitStatic(); + TestDllStartup(); +}
9 years, 1 month
1
0
0
0
[akhaldi] 70021: [MSACM32.DRV] Sync with Wine Staging 1.7.55. CORE-10536
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sun Nov 22 10:30:59 2015 New Revision: 70021 URL:
http://svn.reactos.org/svn/reactos?rev=70021&view=rev
Log: [MSACM32.DRV] Sync with Wine Staging 1.7.55. CORE-10536 Modified: trunk/reactos/dll/win32/msacm32/msacm32.drv/wavemap.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/msacm32/msacm32.drv/wavemap.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msacm32/msacm32.…
============================================================================== --- trunk/reactos/dll/win32/msacm32/msacm32.drv/wavemap.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msacm32/msacm32.drv/wavemap.c [iso-8859-1] Sun Nov 22 10:30:59 2015 @@ -854,8 +854,8 @@ HeapFree(GetProcessHeap(), 0, wim); } else { *lpdwUser = (DWORD_PTR)wim; - } - TRACE("Ok (stream=%p)\n", wim->hAcmStream); + TRACE("Ok (stream=%p)\n", wim->hAcmStream); + } return MMSYSERR_NOERROR; error: HeapFree(GetProcessHeap(), 0, wim); Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Sun Nov 22 10:30:59 2015 @@ -104,7 +104,7 @@ reactos/dll/win32/mpr # Synced to WineStaging-1.7.55 reactos/dll/win32/mprapi # Synced to WineStaging-1.7.47 reactos/dll/win32/msacm32 # Synced to WineStaging-1.7.55 -reactos/dll/win32/msacm32/msacm32.drv # Synced to WineStaging-1.7.47 +reactos/dll/win32/msacm32/msacm32.drv # Synced to WineStaging-1.7.55 reactos/dll/win32/msadp32.acm # Synced to WineStaging-1.7.47 reactos/dll/win32/mscat32 # Synced to WineStaging-1.7.47 reactos/dll/win32/mscms # Synced to WineStaging-1.7.47
9 years, 1 month
1
0
0
0
[akhaldi] 70020: [MSACM32_WINETEST] Sync with Wine Staging 1.7.55. CORE-10536
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sun Nov 22 10:29:55 2015 New Revision: 70020 URL:
http://svn.reactos.org/svn/reactos?rev=70020&view=rev
Log: [MSACM32_WINETEST] Sync with Wine Staging 1.7.55. CORE-10536 Modified: trunk/rostests/winetests/msacm32/msacm.c Modified: trunk/rostests/winetests/msacm32/msacm.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msacm32/msacm.c…
============================================================================== --- trunk/rostests/winetests/msacm32/msacm.c [iso-8859-1] (original) +++ trunk/rostests/winetests/msacm32/msacm.c [iso-8859-1] Sun Nov 22 10:29:55 2015 @@ -127,15 +127,16 @@ TODO: should it be *exactly* sizeof(dd), as tested here? */ if (rc == MMSYSERR_NOERROR) { - struct { + static const struct { const char *shortname; - const WORD mid; - const WORD pid; + WORD mid; + WORD pid; + WORD pid_alt; } *iter, expected_ids[] = { { "Microsoft IMA ADPCM", MM_MICROSOFT, MM_MSFT_ACM_IMAADPCM }, { "MS-ADPCM", MM_MICROSOFT, MM_MSFT_ACM_MSADPCM }, { "Microsoft CCITT G.711", MM_MICROSOFT, MM_MSFT_ACM_G711}, - { "MPEG Layer-3 Codec", MM_FRAUNHOFER_IIS, MM_FHGIIS_MPEGLAYER3_DECODE }, + { "MPEG Layer-3 Codec", MM_FRAUNHOFER_IIS, MM_FHGIIS_MPEGLAYER3_DECODE, MM_FHGIIS_MPEGLAYER3_PROFESSIONAL }, { "MS-PCM", MM_MICROSOFT, MM_MSFT_ACM_PCM }, { 0 } }; @@ -144,8 +145,15 @@ "acmDriverDetailsA(): cbStruct = %08x\n", dd.cbStruct); for (iter = expected_ids; iter->shortname; ++iter) { - if (dd.szShortName && !strcmp(iter->shortname, dd.szShortName)) { - ok(iter->mid == dd.wMid && iter->pid == dd.wPid, + if (!strcmp(iter->shortname, dd.szShortName)) { + /* try alternative product id on mismatch */ + if (iter->pid_alt && iter->pid != dd.wPid) + ok(iter->mid == dd.wMid && iter->pid_alt == dd.wPid, + "Got wrong manufacturer (0x%x vs 0x%x) or product (0x%x vs 0x%x)\n", + dd.wMid, iter->mid, + dd.wPid, iter->pid_alt); + else + ok(iter->mid == dd.wMid && iter->pid == dd.wPid, "Got wrong manufacturer (0x%x vs 0x%x) or product (0x%x vs 0x%x)\n", dd.wMid, iter->mid, dd.wPid, iter->pid); @@ -594,8 +602,115 @@ ok(mr == MMSYSERR_NOERROR, "close failed: 0x%x\n", mr); } +static void test_acmFormatSuggest(void) +{ + WAVEFORMATEX src, dst; + DWORD suggest; + MMRESULT rc; + + /* Test a valid PCM format */ + src.wFormatTag = WAVE_FORMAT_PCM; + src.nChannels = 1; + src.nSamplesPerSec = 8000; + src.nAvgBytesPerSec = 16000; + src.nBlockAlign = 2; + src.wBitsPerSample = 16; + src.cbSize = 0; + suggest = 0; + memset(&dst, 0, sizeof(dst)); + rc = acmFormatSuggest(NULL, &src, &dst, sizeof(dst), suggest); + ok(rc == MMSYSERR_NOERROR, "failed with error 0x%x\n", rc); +todo_wine + ok(src.wFormatTag == dst.wFormatTag, "expected %d, got %d\n", src.wFormatTag, dst.wFormatTag); + ok(src.nChannels == dst.nChannels, "expected %d, got %d\n", src.nChannels, dst.nChannels); + ok(src.nSamplesPerSec == dst.nSamplesPerSec, "expected %d, got %d\n", src.nSamplesPerSec, dst.nSamplesPerSec); +todo_wine + ok(src.nAvgBytesPerSec == dst.nAvgBytesPerSec, "expected %d, got %d\n", src.nAvgBytesPerSec, dst.nAvgBytesPerSec); +todo_wine + ok(src.nBlockAlign == dst.nBlockAlign, "expected %d, got %d\n", src.nBlockAlign, dst.nBlockAlign); +todo_wine + ok(src.wBitsPerSample == dst.wBitsPerSample, "expected %d, got %d\n", src.wBitsPerSample, dst.wBitsPerSample); + + /* All parameters from destination are valid */ + suggest = ACM_FORMATSUGGESTF_NCHANNELS + | ACM_FORMATSUGGESTF_NSAMPLESPERSEC + | ACM_FORMATSUGGESTF_WBITSPERSAMPLE + | ACM_FORMATSUGGESTF_WFORMATTAG; + dst = src; + rc = acmFormatSuggest(NULL, &src, &dst, sizeof(dst), suggest); + ok(rc == MMSYSERR_NOERROR, "failed with error 0x%x\n", rc); + ok(src.wFormatTag == dst.wFormatTag, "expected %d, got %d\n", src.wFormatTag, dst.wFormatTag); + ok(src.nChannels == dst.nChannels, "expected %d, got %d\n", src.nChannels, dst.nChannels); + ok(src.nSamplesPerSec == dst.nSamplesPerSec, "expected %d, got %d\n", src.nSamplesPerSec, dst.nSamplesPerSec); + ok(src.nAvgBytesPerSec == dst.nAvgBytesPerSec, "expected %d, got %d\n", src.nAvgBytesPerSec, dst.nAvgBytesPerSec); + ok(src.nBlockAlign == dst.nBlockAlign, "expected %d, got %d\n", src.nBlockAlign, dst.nBlockAlign); + ok(src.wBitsPerSample == dst.wBitsPerSample, "expected %d, got %d\n", src.wBitsPerSample, dst.wBitsPerSample); + + /* Test for WAVE_FORMAT_MSRT24 used in Monster Truck Madness 2 */ + src.wFormatTag = WAVE_FORMAT_MSRT24; + src.nChannels = 1; + src.nSamplesPerSec = 8000; + src.nAvgBytesPerSec = 16000; + src.nBlockAlign = 2; + src.wBitsPerSample = 16; + src.cbSize = 0; + dst = src; + suggest = ACM_FORMATSUGGESTF_NCHANNELS + | ACM_FORMATSUGGESTF_NSAMPLESPERSEC + | ACM_FORMATSUGGESTF_WBITSPERSAMPLE + | ACM_FORMATSUGGESTF_WFORMATTAG; + rc = acmFormatSuggest(NULL, &src, &dst, sizeof(dst), suggest); + ok(rc == ACMERR_NOTPOSSIBLE, "failed with error 0x%x\n", rc); + memset(&dst, 0, sizeof(dst)); + suggest = 0; + rc = acmFormatSuggest(NULL, &src, &dst, sizeof(dst), suggest); +todo_wine + ok(rc == MMSYSERR_INVALPARAM, "failed with error 0x%x\n", rc); + + /* Invalid struct size */ + src.wFormatTag = WAVE_FORMAT_PCM; + rc = acmFormatSuggest(NULL, &src, &dst, 0, suggest); +todo_wine + ok(rc == MMSYSERR_INVALPARAM, "failed with error 0x%x\n", rc); + rc = acmFormatSuggest(NULL, &src, &dst, sizeof(dst) / 2, suggest); +todo_wine + ok(rc == MMSYSERR_INVALPARAM, "failed with error 0x%x\n", rc); + /* cbSize is the last parameter and not required for PCM */ + rc = acmFormatSuggest(NULL, &src, &dst, sizeof(dst) - 1, suggest); + ok(rc == MMSYSERR_NOERROR, "failed with error 0x%x\n", rc); + rc = acmFormatSuggest(NULL, &src, &dst, sizeof(dst) - sizeof(dst.cbSize), suggest); + ok(rc == MMSYSERR_NOERROR, "failed with error 0x%x\n", rc); + rc = acmFormatSuggest(NULL, &src, &dst, sizeof(dst) - sizeof(dst.cbSize) - 1, suggest); +todo_wine + ok(rc == MMSYSERR_INVALPARAM, "failed with error 0x%x\n", rc); + /* cbSize is required for others */ + src.wFormatTag = WAVE_FORMAT_ADPCM; + rc = acmFormatSuggest(NULL, &src, &dst, sizeof(dst) - sizeof(dst.cbSize), suggest); +todo_wine + ok(rc == MMSYSERR_INVALPARAM, "failed with error 0x%x\n", rc); + rc = acmFormatSuggest(NULL, &src, &dst, sizeof(dst) - 1, suggest); +todo_wine + ok(rc == MMSYSERR_INVALPARAM, "failed with error 0x%x\n", rc); + + /* Invalid suggest flags */ + src.wFormatTag = WAVE_FORMAT_PCM; + suggest = 0xFFFFFFFF; + rc = acmFormatSuggest(NULL, &src, &dst, sizeof(dst), suggest); + ok(rc == MMSYSERR_INVALFLAG, "failed with error 0x%x\n", rc); + + /* Invalid source and destination */ + suggest = 0; + rc = acmFormatSuggest(NULL, NULL, &dst, sizeof(dst), suggest); + ok(rc == MMSYSERR_INVALPARAM, "failed with error 0x%x\n", rc); + rc = acmFormatSuggest(NULL, &src, NULL, sizeof(dst), suggest); + ok(rc == MMSYSERR_INVALPARAM, "failed with error 0x%x\n", rc); + rc = acmFormatSuggest(NULL, NULL, NULL, sizeof(dst), suggest); + ok(rc == MMSYSERR_INVALPARAM, "failed with error 0x%x\n", rc); +} + START_TEST(msacm) { driver_tests(); test_prepareheader(); -} + test_acmFormatSuggest(); +}
9 years, 1 month
1
0
0
0
[akhaldi] 70019: [PSDK] Add missing WAVE_FORMAT_MSRT24 and MM_FHGIIS_MPEGLAYER3_PROFESSIONAL.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sun Nov 22 10:29:18 2015 New Revision: 70019 URL:
http://svn.reactos.org/svn/reactos?rev=70019&view=rev
Log: [PSDK] Add missing WAVE_FORMAT_MSRT24 and MM_FHGIIS_MPEGLAYER3_PROFESSIONAL. Modified: trunk/reactos/include/psdk/mmreg.h Modified: trunk/reactos/include/psdk/mmreg.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/mmreg.h?rev=7…
============================================================================== --- trunk/reactos/include/psdk/mmreg.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/mmreg.h [iso-8859-1] Sun Nov 22 10:29:18 2015 @@ -123,6 +123,7 @@ #define WAVE_FORMAT_G721_ADPCM 0x0040 /* Antex Electronics Corporation */ #define WAVE_FORMAT_MPEG 0x0050 /* Microsoft Corporation */ #define WAVE_FORMAT_MPEGLAYER3 0x0055 +#define WAVE_FORMAT_MSRT24 0x0082 /* Microsoft Corporation */ #define WAVE_FORMAT_DOLBY_AC3_SPDIF 0x0092 /* Sonic Foundry */ #define WAVE_FORMAT_CREATIVE_ADPCM 0x0200 /* Creative Labs, Inc */ #define WAVE_FORMAT_CREATIVE_FASTSPEECH8 0x0202 /* Creative Labs, Inc */ @@ -148,6 +149,7 @@ #define MM_FRAUNHOFER_IIS 0xAC #define MM_FHGIIS_MPEGLAYER3_DECODE 0x09 +#define MM_FHGIIS_MPEGLAYER3_PROFESSIONAL 0x0d #if !defined(WAVE_FORMAT_EXTENSIBLE) #define WAVE_FORMAT_EXTENSIBLE 0xFFFE /* Microsoft */
9 years, 1 month
1
0
0
0
[akhaldi] 70018: [MSACM32] Sync with Wine Staging 1.7.55. CORE-10536
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sun Nov 22 10:27:33 2015 New Revision: 70018 URL:
http://svn.reactos.org/svn/reactos?rev=70018&view=rev
Log: [MSACM32] Sync with Wine Staging 1.7.55. CORE-10536 Modified: trunk/reactos/dll/win32/msacm32/format.c trunk/reactos/dll/win32/msacm32/pcmconverter.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/msacm32/format.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msacm32/format.c…
============================================================================== --- trunk/reactos/dll/win32/msacm32/format.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msacm32/format.c [iso-8859-1] Sun Nov 22 10:27:33 2015 @@ -659,6 +659,9 @@ TRACE("(%p, %p, %p, %d, %d)\n", had, pwfxSrc, pwfxDst, cbwfxDst, fdwSuggest); + + if (!pwfxSrc || !pwfxDst) + return MMSYSERR_INVALPARAM; if (fdwSuggest & ~(ACM_FORMATSUGGESTF_NCHANNELS|ACM_FORMATSUGGESTF_NSAMPLESPERSEC| ACM_FORMATSUGGESTF_WBITSPERSAMPLE|ACM_FORMATSUGGESTF_WFORMATTAG)) Modified: trunk/reactos/dll/win32/msacm32/pcmconverter.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msacm32/pcmconve…
============================================================================== --- trunk/reactos/dll/win32/msacm32/pcmconverter.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msacm32/pcmconverter.c [iso-8859-1] Sun Nov 22 10:27:33 2015 @@ -820,28 +820,33 @@ /* some tests ... */ if (adfs->cbwfxSrc < sizeof(PCMWAVEFORMAT) || - adfs->cbwfxDst < sizeof(PCMWAVEFORMAT) || - PCM_GetFormatIndex(adfs->pwfxSrc) == 0xFFFFFFFF) { + adfs->cbwfxDst < sizeof(PCMWAVEFORMAT) || + PCM_GetFormatIndex(adfs->pwfxSrc) == 0xFFFFFFFF) { WARN("not possible\n"); return ACMERR_NOTPOSSIBLE; } /* is no suggestion for destination, then copy source value */ if (!(adfs->fdwSuggest & ACM_FORMATSUGGESTF_NCHANNELS)) { - adfs->pwfxDst->nChannels = adfs->pwfxSrc->nChannels; + adfs->pwfxDst->nChannels = adfs->pwfxSrc->nChannels; } if (!(adfs->fdwSuggest & ACM_FORMATSUGGESTF_NSAMPLESPERSEC)) { - adfs->pwfxDst->nSamplesPerSec = adfs->pwfxSrc->nSamplesPerSec; + adfs->pwfxDst->nSamplesPerSec = adfs->pwfxSrc->nSamplesPerSec; } if (!(adfs->fdwSuggest & ACM_FORMATSUGGESTF_WBITSPERSAMPLE)) { - adfs->pwfxDst->wBitsPerSample = adfs->pwfxSrc->wBitsPerSample; + adfs->pwfxDst->wBitsPerSample = adfs->pwfxSrc->wBitsPerSample; } if (!(adfs->fdwSuggest & ACM_FORMATSUGGESTF_WFORMATTAG)) { - if (adfs->pwfxSrc->wFormatTag != WAVE_FORMAT_PCM) { - WARN("not possible\n"); + if (adfs->pwfxSrc->wFormatTag != WAVE_FORMAT_PCM) { + WARN("source format 0x%x not supported\n", adfs->pwfxSrc->wFormatTag); return ACMERR_NOTPOSSIBLE; } - adfs->pwfxDst->wFormatTag = adfs->pwfxSrc->wFormatTag; + adfs->pwfxDst->wFormatTag = adfs->pwfxSrc->wFormatTag; + } else { + if (adfs->pwfxDst->wFormatTag != WAVE_FORMAT_PCM) { + WARN("destination format 0x%x not supported\n", adfs->pwfxDst->wFormatTag); + return ACMERR_NOTPOSSIBLE; + } } /* check if result is ok */ if (PCM_GetFormatIndex(adfs->pwfxDst) == 0xFFFFFFFF) { Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Sun Nov 22 10:27:33 2015 @@ -103,7 +103,7 @@ reactos/dll/win32/mmdevapi # Synced to WineStaging-1.7.47 reactos/dll/win32/mpr # Synced to WineStaging-1.7.55 reactos/dll/win32/mprapi # Synced to WineStaging-1.7.47 -reactos/dll/win32/msacm32 # Synced to WineStaging-1.7.47 +reactos/dll/win32/msacm32 # Synced to WineStaging-1.7.55 reactos/dll/win32/msacm32/msacm32.drv # Synced to WineStaging-1.7.47 reactos/dll/win32/msadp32.acm # Synced to WineStaging-1.7.47 reactos/dll/win32/mscat32 # Synced to WineStaging-1.7.47
9 years, 1 month
1
0
0
0
[akhaldi] 70017: [LOCALUI] Sync with Wine Staging 1.7.55. CORE-10536
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sun Nov 22 10:26:00 2015 New Revision: 70017 URL:
http://svn.reactos.org/svn/reactos?rev=70017&view=rev
Log: [LOCALUI] Sync with Wine Staging 1.7.55. CORE-10536 Modified: trunk/reactos/dll/win32/localui/localui.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/localui/localui.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/localui/localui.…
============================================================================== --- trunk/reactos/dll/win32/localui/localui.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/localui/localui.c [iso-8859-1] Sun Nov 22 10:26:00 2015 @@ -619,7 +619,7 @@ * Failure: FALSE * * NOTES - * Native localui does not allow to delete a COM / LPT - Port (ERROR_NOT_SUPPORTED) + * Native localui does not allow deleting a COM/LPT port (ERROR_NOT_SUPPORTED) * */ static BOOL WINAPI localui_DeletePortUI(PCWSTR pName, HWND hWnd, PCWSTR pPortName) Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Sun Nov 22 10:26:00 2015 @@ -90,7 +90,7 @@ reactos/dll/win32/jsproxy # Synced to WineStaging-1.7.47 reactos/dll/win32/loadperf # Synced to WineStaging-1.7.47 reactos/dll/win32/localspl # Synced to WineStaging-1.7.55 -reactos/dll/win32/localui # Synced to WineStaging-1.7.47 +reactos/dll/win32/localui # Synced to WineStaging-1.7.55 reactos/dll/win32/lz32 # Synced to WineStaging-1.7.47 reactos/dll/win32/mapi32 # Synced to WineStaging-1.7.47 reactos/dll/win32/mciavi32 # Synced to WineStaging-1.7.55
9 years, 1 month
1
0
0
0
[akhaldi] 70016: [IMAGEHLP_WINETEST] Sync with Wine Staging 1.7.55. CORE-10536
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sun Nov 22 10:24:13 2015 New Revision: 70016 URL:
http://svn.reactos.org/svn/reactos?rev=70016&view=rev
Log: [IMAGEHLP_WINETEST] Sync with Wine Staging 1.7.55. CORE-10536 Modified: trunk/rostests/winetests/imagehlp/integrity.c Modified: trunk/rostests/winetests/imagehlp/integrity.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/imagehlp/integr…
============================================================================== --- trunk/rostests/winetests/imagehlp/integrity.c [iso-8859-1] (original) +++ trunk/rostests/winetests/imagehlp/integrity.c [iso-8859-1] Sun Nov 22 10:24:13 2015 @@ -26,8 +26,9 @@ #include "winerror.h" #include "winnt.h" #include "imagehlp.h" - -static HMODULE hImageHlp; +#include "psapi.h" + +static HMODULE hImageHlp, hPsapi; static char test_dll_path[MAX_PATH]; static BOOL (WINAPI *pImageAddCertificate)(HANDLE, LPWIN_CERTIFICATE, PDWORD); @@ -35,6 +36,9 @@ static BOOL (WINAPI *pImageGetCertificateData)(HANDLE, DWORD, LPWIN_CERTIFICATE, PDWORD); static BOOL (WINAPI *pImageGetCertificateHeader)(HANDLE, DWORD, LPWIN_CERTIFICATE); static BOOL (WINAPI *pImageRemoveCertificate)(HANDLE, DWORD); +static PIMAGE_NT_HEADERS (WINAPI *pCheckSumMappedFile)(PVOID, DWORD, PDWORD, PDWORD); + +static BOOL (WINAPI *pGetModuleInformation)(HANDLE, HMODULE, LPMODULEINFO, DWORD cb); static const char test_cert_data[] = {0x30,0x82,0x02,0xE1,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x02 @@ -90,6 +94,27 @@ static const char test_cert_data_2[] = {0xDE,0xAD,0xBE,0xEF,0x01,0x02,0x03}; +static char test_pe_executable[] = +{ + 0x4d,0x5a,0x90,0x00,0x03,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0xff,0xff,0x00, + 0x00,0xb8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x80,0x00,0x00,0x00,0x0e,0x1f,0xba,0x0e,0x00,0xb4,0x09,0xcd,0x21,0xb8,0x01, + 0x4c,0xcd,0x21,0x54,0x68,0x69,0x73,0x20,0x70,0x72,0x6f,0x67,0x72,0x61,0x6d, + 0x20,0x63,0x61,0x6e,0x6e,0x6f,0x74,0x20,0x62,0x65,0x20,0x72,0x75,0x6e,0x20, + 0x69,0x6e,0x20,0x44,0x4f,0x53,0x20,0x6d,0x6f,0x64,0x65,0x2e,0x0d,0x0d,0x0a, + 0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x45,0x00,0x00,0x4c,0x01,0x0f, + 0x00,0xfd,0x38,0xc9,0x55,0x00,0x24,0x01,0x00,0xea,0x04,0x00,0x00,0xe0,0x00, + 0x07,0x01,0x0b,0x01,0x02,0x18,0x00,0x1a,0x00,0x00,0x00,0x2c,0x00,0x00,0x00, + 0x06,0x00,0x00,0xe0,0x14,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x30,0x00,0x00, + 0x00,0x00,0x40,0x00,0x00,0x10,0x00,0x00,0x00,0x02,0x00,0x00,0x04,0x00,0x00, + 0x00,0x01,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0, + 0x01,0x00,0x00,0x04,0x00,0x00,/* checksum */ 0x11,0xEF,0xCD,0xAB,0x03,0x00, + 0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x10,0x00,0x00, + 0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00 +}; + static BOOL copy_dll_file(void) { char sys_dir[MAX_PATH+15]; @@ -237,6 +262,223 @@ ok (count == orig_count - 1, "Certificate count mismatch; orig=%d new=%d\n", orig_count, count); CloseHandle(hFile); +} + +static DWORD _get_checksum_offset(PVOID base, PIMAGE_NT_HEADERS *nt_header, DWORD *checksum) +{ + IMAGE_DOS_HEADER *dos = (IMAGE_DOS_HEADER *)base; + PIMAGE_NT_HEADERS32 Header32; + PIMAGE_NT_HEADERS64 Header64; + + if (dos->e_magic != IMAGE_DOS_SIGNATURE) + return 0; + + Header32 = (IMAGE_NT_HEADERS32 *)((char *)dos + dos->e_lfanew); + if (Header32->Signature != IMAGE_NT_SIGNATURE) + return 0; + + *nt_header = (PIMAGE_NT_HEADERS)Header32; + + if (Header32->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR32_MAGIC) + { + *checksum = Header32->OptionalHeader.CheckSum; + return (char *)&Header32->OptionalHeader.CheckSum - (char *)base; + } + else if (Header32->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR64_MAGIC) + { + Header64 = (IMAGE_NT_HEADERS64 *)Header32; + *checksum = Header64->OptionalHeader.CheckSum; + return (char *)&Header64->OptionalHeader.CheckSum - (char *)base; + } + + return 0; +} + +static void test_pe_checksum(void) +{ + DWORD checksum_orig, checksum_new, checksum_off, checksum_correct; + PIMAGE_NT_HEADERS nt_header; + PIMAGE_NT_HEADERS ret; + HMODULE quartz_data; + char* quartz_base; + MODULEINFO modinfo; + char buffer[20]; + BOOL ret_bool; + + if (!pCheckSumMappedFile) + { + win_skip("CheckSumMappedFile not supported, skipping tests\n"); + return; + } + + SetLastError(0xdeadbeef); + checksum_orig = checksum_new = 0xdeadbeef; + ret = pCheckSumMappedFile(NULL, 0, &checksum_orig, &checksum_new); + ok(!ret, "Expected CheckSumMappedFile to fail, got %p\n", ret); + ok(GetLastError() == 0xdeadbeef, "Expected err=0xdeadbeef, got %x\n", GetLastError()); + ok(checksum_orig == 0, "Expected 0, got %x\n", checksum_orig); + ok(checksum_new == 0, "Expected 0, got %x\n", checksum_new); + + SetLastError(0xdeadbeef); + checksum_orig = checksum_new = 0xdeadbeef; + ret = pCheckSumMappedFile((void *)0xdeadbeef, 0, &checksum_orig, &checksum_new); + ok(!ret, "Expected CheckSumMappedFile to fail, got %p\n", ret); + ok(GetLastError() == 0xdeadbeef, "Expected err=0xdeadbeef, got %x\n", GetLastError()); + ok(checksum_orig == 0, "Expected 0, got %x\n", checksum_orig); + ok(checksum_new == 0, "Expected 0, got %x\n", checksum_new); + + if (0) + { + /* crashes on Windows */ + checksum_orig = checksum_new = 0xdeadbeef; + pCheckSumMappedFile(0, 0x1000, &checksum_orig, &checksum_new); + pCheckSumMappedFile((void *)0xdeadbeef, 0x1000, NULL, NULL); + } + + /* basic checksum tests */ + memset(buffer, 0x11, sizeof(buffer)); + checksum_orig = checksum_new = 0xdeadbeef; + ret = pCheckSumMappedFile(buffer, sizeof(buffer), &checksum_orig, &checksum_new); + ok(ret == NULL, "Expected NULL, got %p\n", ret); + ok(checksum_orig == 0, "Expected 0, got %x\n", checksum_orig); + ok(checksum_new == 0xaabe, "Expected 0xaabe, got %x\n", checksum_new); + + memset(buffer, 0x22, sizeof(buffer)); + checksum_orig = checksum_new = 0xdeadbeef; + ret = pCheckSumMappedFile(buffer, sizeof(buffer), &checksum_orig, &checksum_new); + ok(ret == NULL, "Expected NULL, got %p\n", ret); + ok(checksum_orig == 0, "Expected 0, got %x\n", checksum_orig); + ok(checksum_new == 0x5569, "Expected 0x5569, got %x\n", checksum_new); + + memset(buffer, 0x22, sizeof(buffer)); + checksum_orig = checksum_new = 0xdeadbeef; + ret = pCheckSumMappedFile(buffer, 10, &checksum_orig, &checksum_new); + ok(ret == NULL, "Expected NULL, got %p\n", ret); + ok(checksum_orig == 0, "Expected 0, got %x\n", checksum_orig); + ok(checksum_new == 0xaab4, "Expected 0xaab4, got %x\n", checksum_new); + + memset(buffer, 0x22, sizeof(buffer)); + checksum_orig = checksum_new = 0xdeadbeef; + ret = pCheckSumMappedFile(buffer, 11, &checksum_orig, &checksum_new); + ok(ret == NULL, "Expected NULL, got %p\n", ret); + ok(checksum_orig == 0, "Expected 0, got %x\n", checksum_orig); + ok(checksum_new == 0xaad7, "Expected 0xaad7, got %x\n", checksum_new); + + /* test checksum of PE module */ + memset(buffer, 0x22, sizeof(buffer)); + checksum_orig = checksum_new = 0xdeadbeef; + ret = pCheckSumMappedFile(test_pe_executable, sizeof(test_pe_executable), + &checksum_orig, &checksum_new); + ok((char *)ret == test_pe_executable + 0x80, "Expected %p, got %p\n", test_pe_executable + 0x80, ret); + ok(checksum_orig == 0xabcdef11, "Expected 0xabcdef11, got %x\n", checksum_orig); + ok(checksum_new == 0xaa4, "Expected 0xaa4, got %x\n", checksum_new); + + if (!pGetModuleInformation) + { + win_skip("GetModuleInformation not supported, skipping tests\n"); + return; + } + + ret_bool = pGetModuleInformation(GetCurrentProcess(), GetModuleHandleA(NULL), + &modinfo, sizeof(modinfo)); + ok(ret_bool, "GetModuleInformation failed, error: %x\n", GetLastError()); + + if (0) + { + /* crashes on Windows */ + pCheckSumMappedFile(modinfo.lpBaseOfDll, modinfo.SizeOfImage, NULL, NULL); + } + + SetLastError(0xdeadbeef); + checksum_orig = checksum_new = 0xdeadbeef; + ret = pCheckSumMappedFile(modinfo.lpBaseOfDll, modinfo.SizeOfImage, &checksum_orig, &checksum_new); + ok(ret != NULL, "Expected CheckSumMappedFile to succeed\n"); + ok(GetLastError() == 0xdeadbeef, "Expected err=0xdeadbeef, got %x\n", GetLastError()); + ok(checksum_orig != 0xdeadbeef, "Expected orig checksum != 0xdeadbeef\n"); + ok(checksum_new != 0xdeadbeef, "Expected new checksum != 0xdeadbeef\n"); + + SetLastError(0xdeadbeef); + checksum_orig = checksum_new = 0xdeadbeef; + ret = pCheckSumMappedFile((char *)modinfo.lpBaseOfDll + 100, modinfo.SizeOfImage - 100, + &checksum_orig, &checksum_new); + ok(!ret, "Expected CheckSumMappedFile to fail, got %p\n", ret); + ok(GetLastError() == 0xdeadbeef, "Expected err=0xdeadbeef, got %x\n", GetLastError()); + ok(checksum_orig == 0, "Expected 0xdeadbeef, got %x\n", checksum_orig); + ok(checksum_new != 0 && checksum_new != 0xdeadbeef, "Got unexpected value %x\n", checksum_new); + + checksum_off = _get_checksum_offset(modinfo.lpBaseOfDll, &nt_header, &checksum_correct); + ok(checksum_off != 0, "Failed to get checksum offset\n"); + + checksum_orig = checksum_new = 0xdeadbeef; + ret = pCheckSumMappedFile(modinfo.lpBaseOfDll, checksum_off, &checksum_orig, &checksum_new); + ok(ret == nt_header, "Expected %p, got %p\n", nt_header, ret); + ok(checksum_orig == checksum_correct, "Expected %x, got %x\n", checksum_correct, checksum_orig); + ok(checksum_new != 0 && checksum_new != 0xdeadbeef, "Got unexpected value %x\n", checksum_new); + + checksum_orig = checksum_new = 0xdeadbeef; + ret = pCheckSumMappedFile(modinfo.lpBaseOfDll, (char *)nt_header - (char *)modinfo.lpBaseOfDll, + &checksum_orig, &checksum_new); + ok(ret == nt_header, "Expected %p, got %p\n", nt_header, ret); + ok(checksum_orig == checksum_correct, "Expected %x, got %x\n", checksum_correct, checksum_orig); + ok(checksum_new != 0 && checksum_new != 0xdeadbeef, "Got unexpected value %x\n", checksum_new); + + checksum_orig = checksum_new = 0xdeadbeef; + ret = pCheckSumMappedFile(modinfo.lpBaseOfDll, sizeof(IMAGE_DOS_HEADER), + &checksum_orig, &checksum_new); + ok(ret == nt_header, "Expected %p, got %p\n", nt_header, ret); + ok(checksum_orig == checksum_correct, "Expected %x, got %x\n", checksum_correct, checksum_orig); + ok(checksum_new != 0 && checksum_new != 0xdeadbeef, "Got unexpected value %x\n", checksum_new); + + checksum_orig = checksum_new = 0xdeadbeef; + ret = pCheckSumMappedFile(modinfo.lpBaseOfDll, 0, &checksum_orig, &checksum_new); + ok(ret == nt_header, "Expected %p, got %p\n", nt_header, ret); + ok(checksum_orig == checksum_correct, "Expected %x, got %x\n", checksum_correct, checksum_orig); + todo_wine ok(checksum_new != 0 && checksum_new != 0xdeadbeef, "Got unexpected value %x\n", checksum_new); + + checksum_orig = checksum_new = 0xdeadbeef; + ret = pCheckSumMappedFile((char *)modinfo.lpBaseOfDll + 1, 0, + &checksum_orig, &checksum_new); + ok(ret == NULL, "Expected NULL, got %p\n", ret); + ok(checksum_orig == 0, "Expected 0, got %x\n", checksum_orig); + ok(checksum_new == 0, "Expected 0, got %x\n", checksum_new); + + quartz_data = LoadLibraryExA("quartz.dll", NULL, LOAD_LIBRARY_AS_DATAFILE); + if (!quartz_data) + { + skip("Failed to load quartz as datafile, skipping tests\n"); + return; + } + + quartz_base = (char *)((DWORD_PTR)quartz_data & ~1); + checksum_off = _get_checksum_offset(quartz_base, &nt_header, &checksum_correct); + ok(checksum_off != 0, "Failed to get checksum offset\n"); + + checksum_orig = checksum_new = 0xdeadbeef; + ret = pCheckSumMappedFile(quartz_base, checksum_off, &checksum_orig, &checksum_new); + ok(ret == nt_header, "Expected %p, got %p\n", nt_header, ret); + ok(checksum_orig == checksum_correct, "Expected %x, got %x\n", checksum_correct, checksum_orig); + ok(checksum_new != 0 && checksum_new != 0xdeadbeef, "Got unexpected value %x\n", checksum_new); + + checksum_orig = checksum_new = 0xdeadbeef; + ret = pCheckSumMappedFile(quartz_base, (char *)nt_header - quartz_base, + &checksum_orig, &checksum_new); + ok(ret == nt_header, "Expected %p, got %p\n", nt_header, ret); + ok(checksum_orig == checksum_correct, "Expected %x, got %x\n", checksum_correct, checksum_orig); + ok(checksum_new != 0 && checksum_new != 0xdeadbeef, "Got unexpected value %x\n", checksum_new); + + checksum_orig = checksum_new = 0xdeadbeef; + ret = pCheckSumMappedFile(quartz_base, sizeof(IMAGE_DOS_HEADER), &checksum_orig, &checksum_new); + ok(ret == nt_header, "Expected %p, got %p\n", nt_header, ret); + ok(checksum_orig == checksum_correct, "Expected %x, got %x\n", checksum_correct, checksum_orig); + ok(checksum_new != 0 && checksum_new != 0xdeadbeef, "Got unexpected value %x\n", checksum_new); + + checksum_orig = checksum_new = 0xdeadbeef; + ret = pCheckSumMappedFile(quartz_base, 0, &checksum_orig, &checksum_new); + ok(ret == nt_header, "Expected %p, got %p\n", nt_header, ret); + ok(checksum_orig == checksum_correct, "Expected %x, got %x\n", checksum_correct, checksum_orig); + todo_wine ok(checksum_new != 0 && checksum_new != 0xdeadbeef, "Got unexpected value %x\n", checksum_new); + + FreeLibrary(quartz_data); } START_TEST(integrity) @@ -273,6 +515,11 @@ pImageGetCertificateData = (void *) GetProcAddress(hImageHlp, "ImageGetCertificateData"); pImageGetCertificateHeader = (void *) GetProcAddress(hImageHlp, "ImageGetCertificateHeader"); pImageRemoveCertificate = (void *) GetProcAddress(hImageHlp, "ImageRemoveCertificate"); + pCheckSumMappedFile = (void *) GetProcAddress(hImageHlp, "CheckSumMappedFile"); + + hPsapi = LoadLibraryA("psapi.dll"); + if (hPsapi) + pGetModuleInformation = (void *) GetProcAddress(hPsapi, "GetModuleInformation"); first = test_add_certificate(test_cert_data, sizeof(test_cert_data)); test_get_certificate(test_cert_data, first); @@ -299,6 +546,9 @@ file_size = get_file_size(); ok(file_size == file_size_orig, "File size different after add and remove (old: %d; new: %d)\n", file_size_orig, file_size); + test_pe_checksum(); + + if (hPsapi) FreeLibrary(hPsapi); FreeLibrary(hImageHlp); DeleteFileA(test_dll_path); }
9 years, 1 month
1
0
0
0
[akhaldi] 70015: [IMAGEHLP] Sync with Wine Staging 1.7.55. CORE-10536
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sun Nov 22 10:24:00 2015 New Revision: 70015 URL:
http://svn.reactos.org/svn/reactos?rev=70015&view=rev
Log: [IMAGEHLP] Sync with Wine Staging 1.7.55. CORE-10536 Modified: trunk/reactos/dll/win32/imagehlp/CMakeLists.txt trunk/reactos/dll/win32/imagehlp/access.c trunk/reactos/dll/win32/imagehlp/modify.c trunk/reactos/dll/win32/imagehlp/precomp.h trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/imagehlp/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/imagehlp/CMakeLi…
============================================================================== --- trunk/reactos/dll/win32/imagehlp/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/win32/imagehlp/CMakeLists.txt [iso-8859-1] Sun Nov 22 10:24:00 2015 @@ -17,7 +17,7 @@ ${CMAKE_CURRENT_BINARY_DIR}/imagehlp.def) set_module_type(imagehlp win32dll) -target_link_libraries(imagehlp wine) +target_link_libraries(imagehlp wine ${PSEH_LIB}) add_importlibs(imagehlp dbghelp msvcrt kernel32 ntdll) add_pch(imagehlp precomp.h SOURCE) add_cd_file(TARGET imagehlp DESTINATION reactos/system32 FOR all) Modified: trunk/reactos/dll/win32/imagehlp/access.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/imagehlp/access.…
============================================================================== --- trunk/reactos/dll/win32/imagehlp/access.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/imagehlp/access.c [iso-8859-1] Sun Nov 22 10:24:00 2015 @@ -25,25 +25,7 @@ /*********************************************************************** * Data */ - -static PLOADED_IMAGE IMAGEHLP_pFirstLoadedImage=NULL; - -static LOADED_IMAGE IMAGEHLP_EmptyLoadedImage = { - NULL, /* ModuleName */ - 0, /* hFile */ - NULL, /* MappedAddress */ - NULL, /* FileHeader */ - NULL, /* LastRvaSection */ - 0, /* NumberOfSections */ - NULL, /* Sections */ - 1, /* Characteristics */ - FALSE, /* fSystemImage */ - FALSE, /* fDOSImage */ - FALSE, /* fReadOnly */ - 0, /* Version */ - { &IMAGEHLP_EmptyLoadedImage.Links, &IMAGEHLP_EmptyLoadedImage.Links }, /* Links */ - 148, /* SizeOfImage; */ -}; +LIST_ENTRY image_list = { &image_list, &image_list }; DECLSPEC_HIDDEN extern HANDLE IMAGEHLP_hHeap; @@ -78,57 +60,69 @@ /*********************************************************************** * ImageLoad (IMAGEHLP.@) */ -PLOADED_IMAGE WINAPI ImageLoad(PCSTR DllName, PCSTR DllPath) -{ - PLOADED_IMAGE pLoadedImage; - - FIXME("(%s, %s): stub\n", DllName, DllPath); - - pLoadedImage = HeapAlloc(IMAGEHLP_hHeap, 0, sizeof(LOADED_IMAGE)); - if (pLoadedImage) - pLoadedImage->FileHeader = HeapAlloc(IMAGEHLP_hHeap, 0, sizeof(IMAGE_NT_HEADERS)); - - return pLoadedImage; +PLOADED_IMAGE WINAPI ImageLoad(PCSTR dll_name, PCSTR dll_path) +{ + LOADED_IMAGE *image; + + TRACE("(%s, %s)\n", dll_name, dll_path); + + image = HeapAlloc(IMAGEHLP_hHeap, 0, sizeof(*image)); + if (!image) return NULL; + + if (!MapAndLoad(dll_name, dll_path, image, TRUE, TRUE)) + { + HeapFree(IMAGEHLP_hHeap, 0, image); + return NULL; + } + + image->Links.Flink = image_list.Flink; + image->Links.Blink = &image_list; + image_list.Flink->Blink = &image->Links; + image_list.Flink = &image->Links; + + return image; } /*********************************************************************** * ImageUnload (IMAGEHLP.@) */ -BOOL WINAPI ImageUnload(PLOADED_IMAGE pLoadedImage) -{ - LIST_ENTRY *pCurrent, *pFind; - - TRACE("(%p)\n", pLoadedImage); - - if(!IMAGEHLP_pFirstLoadedImage || !pLoadedImage) - { - /* No image loaded or null pointer */ - SetLastError(ERROR_INVALID_PARAMETER); - return FALSE; - } - - pFind=&pLoadedImage->Links; - pCurrent=&IMAGEHLP_pFirstLoadedImage->Links; - while((pCurrent != pFind) && - (pCurrent != NULL)) - pCurrent = pCurrent->Flink; - if(!pCurrent) - { - /* Not found */ - SetLastError(ERROR_INVALID_PARAMETER); - return FALSE; - } - - if(pCurrent->Blink) - pCurrent->Blink->Flink = pCurrent->Flink; - else - IMAGEHLP_pFirstLoadedImage = pCurrent->Flink?CONTAINING_RECORD( - pCurrent->Flink, LOADED_IMAGE, Links):NULL; - - if(pCurrent->Flink) - pCurrent->Flink->Blink = pCurrent->Blink; - - return FALSE; +BOOL WINAPI ImageUnload(PLOADED_IMAGE loaded_image) +{ + LIST_ENTRY *entry, *mark; + PLOADED_IMAGE image; + + FIXME("(%p)\n", loaded_image); + + if (!loaded_image) + { + /* No image loaded or null pointer */ + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + + /* FIXME: do we really need to check this? */ + mark = &image_list; + for (entry = mark->Flink; entry != mark; entry = entry->Flink) + { + image = CONTAINING_RECORD(entry, LOADED_IMAGE, Links); + if (image == loaded_image) + break; + } + + if (entry == mark) + { + /* Not found */ + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + + entry->Blink->Flink = entry->Flink; + entry->Flink->Blink = entry->Blink; + + UnMapAndLoad(loaded_image); + HeapFree(IMAGEHLP_hHeap, 0, loaded_image); + + return TRUE; } /*********************************************************************** Modified: trunk/reactos/dll/win32/imagehlp/modify.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/imagehlp/modify.…
============================================================================== --- trunk/reactos/dll/win32/imagehlp/modify.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/imagehlp/modify.c [iso-8859-1] Sun Nov 22 10:24:00 2015 @@ -20,6 +20,7 @@ #include "precomp.h" +#include <wine/exception.h> #include <wine/winternl.h> static WORD CalcCheckSum(DWORD StartValue, LPVOID BaseAddress, DWORD WordCount); @@ -151,26 +152,25 @@ /*********************************************************************** * CheckSum (internal) */ -static WORD CalcCheckSum( - DWORD StartValue, LPVOID BaseAddress, DWORD WordCount) -{ - LPWORD Ptr; - DWORD Sum; - DWORD i; - - Sum = StartValue; - Ptr = (LPWORD)BaseAddress; - for (i = 0; i < WordCount; i++) - { - Sum += *Ptr; - if (HIWORD(Sum) != 0) - { - Sum = LOWORD(Sum) + HIWORD(Sum); - } - Ptr++; - } - - return (WORD)(LOWORD(Sum) + HIWORD(Sum)); +static WORD CalcCheckSum(DWORD StartValue, LPVOID BaseAddress, DWORD ByteCount) +{ + LPWORD Ptr; + DWORD Sum, i; + + Sum = StartValue; + Ptr = (LPWORD)BaseAddress; + for (i = ByteCount; i > 1; i -= 2) + { + Sum += *Ptr; + if (HIWORD(Sum) != 0) + Sum = LOWORD(Sum) + HIWORD(Sum); + Ptr++; + } + + if (i == 1) + Sum += *(BYTE *)Ptr; + + return (WORD)(LOWORD(Sum) + HIWORD(Sum)); } @@ -184,37 +184,57 @@ IMAGE_DOS_HEADER *dos = (IMAGE_DOS_HEADER *) BaseAddress; PIMAGE_NT_HEADERS32 Header32; PIMAGE_NT_HEADERS64 Header64; + PIMAGE_NT_HEADERS ret = NULL; DWORD *ChecksumFile; DWORD CalcSum; - DWORD HdrSum; + DWORD HdrSum = 0; TRACE("(%p, %d, %p, %p)\n", BaseAddress, FileLength, HeaderSum, CheckSum ); - CalcSum = (DWORD)CalcCheckSum(0, - BaseAddress, - (FileLength + 1) / sizeof(WORD)); - - if (dos->e_magic != IMAGE_DOS_SIGNATURE) - return NULL; - - Header32 = (IMAGE_NT_HEADERS32 *)((char *)dos + dos->e_lfanew); - - if (Header32->Signature != IMAGE_NT_SIGNATURE) - return NULL; - - if (Header32->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR32_MAGIC) - ChecksumFile = &Header32->OptionalHeader.CheckSum; - else if (Header32->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR64_MAGIC) - { - Header64 = (IMAGE_NT_HEADERS64 *)Header32; - ChecksumFile = &Header64->OptionalHeader.CheckSum; - } - else - return NULL; - - HdrSum = *ChecksumFile; + CalcSum = (DWORD)CalcCheckSum(0, BaseAddress, FileLength); + + __TRY + { + if (dos->e_magic != IMAGE_DOS_SIGNATURE) +#ifdef __REACTOS__ + _SEH2_LEAVE; +#else + break; +#endif + + Header32 = (IMAGE_NT_HEADERS32 *)((char *)dos + dos->e_lfanew); + if (Header32->Signature != IMAGE_NT_SIGNATURE) +#ifdef __REACTOS__ + _SEH2_LEAVE; +#else + break; +#endif + + ret = (PIMAGE_NT_HEADERS)Header32; + + if (Header32->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR32_MAGIC) + ChecksumFile = &Header32->OptionalHeader.CheckSum; + else if (Header32->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR64_MAGIC) + { + Header64 = (IMAGE_NT_HEADERS64 *)Header32; + ChecksumFile = &Header64->OptionalHeader.CheckSum; + } + else +#ifdef __REACTOS__ + _SEH2_LEAVE; +#else + break; +#endif + + HdrSum = *ChecksumFile; + } + __EXCEPT_PAGE_FAULT + { + /* nothing */ + } + __ENDTRY /* Subtract image checksum from calculated checksum. */ /* fix low word of checksum */ @@ -241,9 +261,9 @@ CalcSum += FileLength; *CheckSum = CalcSum; - *HeaderSum = *ChecksumFile; - - return (PIMAGE_NT_HEADERS) Header32; + *HeaderSum = HdrSum; + + return ret; } /*********************************************************************** Modified: trunk/reactos/dll/win32/imagehlp/precomp.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/imagehlp/precomp…
============================================================================== --- trunk/reactos/dll/win32/imagehlp/precomp.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/imagehlp/precomp.h [iso-8859-1] Sun Nov 22 10:24:00 2015 @@ -3,7 +3,6 @@ #include <stdarg.h> -#define WIN32_NO_STATUS #define _INC_WINDOWS #define COM_NO_WINDOWS_H Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Sun Nov 22 10:24:00 2015 @@ -77,7 +77,7 @@ reactos/dll/win32/icmp # Out of sync reactos/dll/win32/ieframe # Synced to WineStaging-1.7.55 reactos/dll/win32/imaadp32.acm # Synced to WineStaging-1.7.47 -reactos/dll/win32/imagehlp # Synced to WineStaging-1.7.47 +reactos/dll/win32/imagehlp # Synced to WineStaging-1.7.55 reactos/dll/win32/imm32 # Synced to Wine-1.7.27 reactos/dll/win32/inetcomm # Synced to WineStaging-1.7.47 reactos/dll/win32/inetmib1 # Synced to WineStaging-1.7.47
9 years, 1 month
1
0
0
0
← Newer
1
...
18
19
20
21
22
23
24
...
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