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
January 2018
----- 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
37 participants
372 discussions
Start a n
N
ew thread
01/01: [MSACM32_WINETEST] Sync with Wine 3.0. CORE-14225
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=fa31874ef744d759475ef…
commit fa31874ef744d759475efcc5a2a63980c2f3d42e Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Fri Jan 19 12:32:24 2018 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Fri Jan 19 12:32:24 2018 +0100 [MSACM32_WINETEST] Sync with Wine 3.0. CORE-14225 --- modules/rostests/winetests/msacm32/msacm.c | 71 ------------------------------ 1 file changed, 71 deletions(-) diff --git a/modules/rostests/winetests/msacm32/msacm.c b/modules/rostests/winetests/msacm32/msacm.c index ce1837c0a8..a484896cce 100644 --- a/modules/rostests/winetests/msacm32/msacm.c +++ b/modules/rostests/winetests/msacm32/msacm.c @@ -1276,76 +1276,6 @@ static void test_acmFormatChoose(void) HeapFree(GetProcessHeap(), 0, pwfx); } -static void test_mp3(void) -{ - MPEGLAYER3WAVEFORMAT src; - WAVEFORMATEX dst; - HACMSTREAM has; - DWORD output; - MMRESULT mr; - - src.wfx.wFormatTag = WAVE_FORMAT_MPEGLAYER3; - src.wfx.nSamplesPerSec = 11025; - src.wfx.wBitsPerSample = 0; - src.wfx.nChannels = 1; - src.wfx.nBlockAlign = 576; - src.wfx.nAvgBytesPerSec = 2000; - - src.wID = MPEGLAYER3_ID_MPEG; - src.fdwFlags = 0; - src.nBlockSize = 576; - src.nFramesPerBlock = 1; - src.nCodecDelay = 0; - - dst.cbSize = 0; - dst.wFormatTag = WAVE_FORMAT_PCM; - dst.nSamplesPerSec = 11025; - dst.wBitsPerSample = 16; - dst.nChannels = 1; - dst.nBlockAlign = dst.wBitsPerSample * dst.nChannels / 8; - dst.nAvgBytesPerSec = dst.nSamplesPerSec * dst.nBlockAlign; - - src.wfx.cbSize = 0; - - mr = acmStreamOpen(&has, NULL, (WAVEFORMATEX*)&src, &dst, NULL, 0, 0, 0); - ok(mr == ACMERR_NOTPOSSIBLE, "expected error ACMERR_NOTPOSSIBLE, got 0x%x\n", mr); - if (mr == MMSYSERR_NOERROR) acmStreamClose(has, 0); - - src.wfx.cbSize = MPEGLAYER3_WFX_EXTRA_BYTES; - src.wID = 0; - - mr = acmStreamOpen(&has, NULL, (WAVEFORMATEX*)&src, &dst, NULL, 0, 0, 0); - ok(mr == ACMERR_NOTPOSSIBLE, "expected error ACMERR_NOTPOSSIBLE, got 0x%x\n", mr); - if (mr == MMSYSERR_NOERROR) acmStreamClose(has, 0); - - src.wID = MPEGLAYER3_ID_MPEG; - src.nBlockSize = 0; - - mr = acmStreamOpen(&has, NULL, (WAVEFORMATEX*)&src, &dst, NULL, 0, 0, 0); - ok(mr == MMSYSERR_NOERROR, "failed with error 0x%x\n", mr); - mr = acmStreamClose(has, 0); - ok(mr == MMSYSERR_NOERROR, "failed with error 0x%x\n", mr); - - src.nBlockSize = 576; - src.wfx.nAvgBytesPerSec = 0; - - mr = acmStreamOpen(&has, NULL, (WAVEFORMATEX*)&src, &dst, NULL, 0, 0, 0); - ok(mr == MMSYSERR_NOERROR, "failed with error 0x%x\n", mr); - /* causes a division by zero exception */ - if (0) acmStreamSize(has, 4000, &output, ACM_STREAMSIZEF_SOURCE); - mr = acmStreamClose(has, 0); - ok(mr == MMSYSERR_NOERROR, "failed with error 0x%x\n", mr); - - src.wfx.nAvgBytesPerSec = 2000; - - mr = acmStreamOpen(&has, NULL, (WAVEFORMATEX*)&src, &dst, NULL, 0, 0, 0); - ok(mr == MMSYSERR_NOERROR, "failed with error 0x%x\n", mr); - mr = acmStreamSize(has, 4000, &output, ACM_STREAMSIZEF_SOURCE); - ok(mr == MMSYSERR_NOERROR, "failed with error 0x%x\n", mr); - mr = acmStreamClose(has, 0); - ok(mr == MMSYSERR_NOERROR, "failed with error 0x%x\n", mr); -} - static struct { struct @@ -1516,7 +1446,6 @@ START_TEST(msacm) test_acmFormatSuggest(); test_acmFormatTagDetails(); test_acmFormatChoose(); - test_mp3(); /* Test acmDriverAdd in the end as it may conflict * with other tests due to codec lookup order */ test_acmDriverAdd();
6 years, 11 months
1
0
0
0
01/01: [MPR_WINETEST] Sync with Wine 3.0. CORE-14225
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=96960b6e182beed8d18e3…
commit 96960b6e182beed8d18e38c4d8150840ed7e010b Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Fri Jan 19 12:30:38 2018 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Fri Jan 19 12:30:38 2018 +0100 [MPR_WINETEST] Sync with Wine 3.0. CORE-14225 --- modules/rostests/winetests/mpr/mpr.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/modules/rostests/winetests/mpr/mpr.c b/modules/rostests/winetests/mpr/mpr.c index 19097b8a28..330e66bf89 100644 --- a/modules/rostests/winetests/mpr/mpr.c +++ b/modules/rostests/winetests/mpr/mpr.c @@ -55,7 +55,7 @@ static void test_WNetGetUniversalName(void) ret = WNetGetUniversalNameA(driveA, UNIVERSAL_NAME_INFO_LEVEL, buffer, &fail_size); if(drive_type == DRIVE_REMOTE) - todo_wine ok(ret == WN_BAD_VALUE, "WNetGetUniversalNameA failed: %08x\n", ret); + todo_wine ok(ret == WN_BAD_VALUE || ret == WN_MORE_DATA, "WNetGetUniversalNameA failed: %08x\n", ret); else ok(ret == WN_NOT_CONNECTED || ret == WN_NO_NET_OR_BAD_PATH, "(%s) WNetGetUniversalNameW gave wrong error: %u\n", driveA, ret); @@ -101,23 +101,25 @@ static void test_WNetGetRemoteName(void) info_size = sizeof(buffer); ret = WNetGetUniversalNameA(driveA, REMOTE_NAME_INFO_LEVEL, buffer, &info_size); + todo_wine{ if(drive_type == DRIVE_REMOTE) - todo_wine ok(ret == WN_NO_ERROR, "WNetGetUniversalNameA failed: %08x\n", ret); else ok(ret == WN_NOT_CONNECTED || ret == WN_NO_NET_OR_BAD_PATH, "(%s) WNetGetUniversalNameA gave wrong error: %u\n", driveA, ret); + } ok(info_size == sizeof(buffer), "Got wrong size: %u\n", info_size); fail_size = 0; ret = WNetGetUniversalNameA(driveA, REMOTE_NAME_INFO_LEVEL, buffer, &fail_size); + todo_wine{ if(drive_type == DRIVE_REMOTE) - todo_wine - ok(ret == WN_BAD_VALUE, "WNetGetUniversalNameA failed: %08x\n", ret); + ok(ret == WN_BAD_VALUE || ret == WN_MORE_DATA, "WNetGetUniversalNameA failed: %08x\n", ret); else ok(ret == WN_NOT_CONNECTED || ret == WN_NO_NET_OR_BAD_PATH, "(%s) WNetGetUniversalNameA gave wrong error: %u\n", driveA, ret); + } ret = WNetGetUniversalNameA(driveA, REMOTE_NAME_INFO_LEVEL, buffer, NULL); todo_wine ok(ret == WN_BAD_POINTER, "WNetGetUniversalNameA failed: %08x\n", ret); @@ -125,12 +127,13 @@ static void test_WNetGetRemoteName(void) ret = WNetGetUniversalNameA(driveA, REMOTE_NAME_INFO_LEVEL, NULL, &info_size); + todo_wine { if(drive_type == DRIVE_REMOTE) - todo_wine - ok(ret == WN_BAD_POINTER, "WNetGetUniversalNameA failed: %08x\n", ret); + ok(ret == WN_BAD_POINTER || ret == WN_BAD_VALUE, "WNetGetUniversalNameA failed: %08x\n", ret); else ok(ret == WN_NOT_CONNECTED || ret == WN_BAD_VALUE, "(%s) WNetGetUniversalNameA gave wrong error: %u\n", driveA, ret); + } fail_size = sizeof(driveA) / sizeof(char) - 1; ret = WNetGetUniversalNameA(driveA, REMOTE_NAME_INFO_LEVEL, @@ -281,8 +284,9 @@ static void test_WNetUseConnection(void) strcpy(netRes->lpRemoteName, "\\\\127.0.0.1\\c$"); bufSize = 0; ret = pWNetUseConnectionA(NULL, netRes, NULL, NULL, 0, NULL, &bufSize, &outRes); - if (ret == ERROR_ALREADY_ASSIGNED) continue; + if (ret != ERROR_ALREADY_ASSIGNED) break; } + if (ret == ERROR_ALREADY_ASSIGNED) goto end; /* no drives available */ todo_wine ok(ret == WN_SUCCESS, "Unexpected return: %u\n", ret); ok(bufSize == 0, "Unexpected buffer size: %u\n", bufSize); if (ret == WN_SUCCESS) WNetCancelConnectionA(drive, TRUE); @@ -307,6 +311,7 @@ static void test_WNetUseConnection(void) ok(bufSize == 4, "Unexpected buffer size: %u\n", bufSize); if (ret == WN_SUCCESS) WNetCancelConnectionA(drive, TRUE); +end: HeapFree(GetProcessHeap(), 0, netRes); }
6 years, 11 months
1
0
0
0
01/01: [MPR] Sync with Wine 3.0. CORE-14225
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=78214931715938939aff3…
commit 78214931715938939aff30812e471ddfa7e135b5 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Fri Jan 19 12:30:00 2018 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Fri Jan 19 12:30:00 2018 +0100 [MPR] Sync with Wine 3.0. CORE-14225 --- dll/win32/mpr/wnet.c | 2 +- media/doc/README.WINE | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dll/win32/mpr/wnet.c b/dll/win32/mpr/wnet.c index 62c66454a7..fc701b6595 100644 --- a/dll/win32/mpr/wnet.c +++ b/dll/win32/mpr/wnet.c @@ -2577,7 +2577,7 @@ DWORD WINAPI WNetGetUniversalNameA ( LPCSTR lpLocalPath, DWORD dwInfoLevel, break; } case REMOTE_NAME_INFO_LEVEL: - err = WN_NOT_CONNECTED; + err = WN_NO_NETWORK; break; default: diff --git a/media/doc/README.WINE b/media/doc/README.WINE index ffe6380a79..b99c43d5be 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -98,7 +98,7 @@ reactos/dll/win32/mciwave # Synced to WineStaging-2.9 reactos/dll/win32/mgmtapi # Synced to WineStaging-2.9 reactos/dll/win32/mlang # Synced to Wine-3.0 reactos/dll/win32/mmdevapi # Synced to WineStaging-1.9.23 -reactos/dll/win32/mpr # Synced to WineStaging-2.9 +reactos/dll/win32/mpr # Synced to Wine-3.0 reactos/dll/win32/mprapi # Synced to WineStaging-2.9 reactos/dll/win32/msacm32 # Synced to WineStaging-2.16 reactos/dll/win32/msacm32.drv # Synced to WineStaging-2.9
6 years, 11 months
1
0
0
0
01/01: [MLANG_WINETEST] Sync with Wine 3.0. CORE-14225
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=44e39baf4a8d6aea6be7f…
commit 44e39baf4a8d6aea6be7f342b373a1b7120775f8 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Fri Jan 19 12:28:36 2018 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Fri Jan 19 12:28:36 2018 +0100 [MLANG_WINETEST] Sync with Wine 3.0. CORE-14225 --- modules/rostests/winetests/mlang/CMakeLists.txt | 2 +- modules/rostests/winetests/mlang/mlang.c | 488 +++++++++++++++++++++++- 2 files changed, 488 insertions(+), 2 deletions(-) diff --git a/modules/rostests/winetests/mlang/CMakeLists.txt b/modules/rostests/winetests/mlang/CMakeLists.txt index 49e74141a9..2a74329278 100644 --- a/modules/rostests/winetests/mlang/CMakeLists.txt +++ b/modules/rostests/winetests/mlang/CMakeLists.txt @@ -2,5 +2,5 @@ add_definitions(-DUSE_WINE_TODOS) add_executable(mlang_winetest mlang.c testlist.c) set_module_type(mlang_winetest win32cui) -add_importlibs(mlang_winetest mlang oleaut32 ole32 gdi32 msvcrt kernel32) +add_importlibs(mlang_winetest mlang oleaut32 ole32 user32 gdi32 msvcrt kernel32) add_rostests_file(TARGET mlang_winetest) diff --git a/modules/rostests/winetests/mlang/mlang.c b/modules/rostests/winetests/mlang/mlang.c index 23ccd57396..58471d938e 100644 --- a/modules/rostests/winetests/mlang/mlang.c +++ b/modules/rostests/winetests/mlang/mlang.c @@ -226,6 +226,318 @@ static const info_table_entry info_table[] = { }; +struct cpinfo_test_data +{ + MIMECPINFO cpinfo; + + BOOL todo_GetCodePageInfo; + BOOL todo_dwFlags; + BOOL todo_uiFamilyCodePage; + BOOL todo_wszDescription; + BOOL todo_wszWebCharset; + BOOL todo_wszHeaderCharset; + BOOL todo_wszBodyCharset; + BOOL todo_wszFixedWidthFont; + BOOL todo_wszProportionalFont; +}; + +static const struct cpinfo_test_data iml2_cpinfo_data[] = +{ + /* 0. Chinese Simplified (Auto-Select) */ + { + { + MIMECONTF_IMPORT | MIMECONTF_VALID | MIMECONTF_VALID_NLS | MIMECONTF_MIME_LATEST, + 50936, 936, {'C','h','i','n','e','s','e',' ','S','i','m','p','l','i','f','i','e','d',' ','(','A','u','t','o','-','S','e','l','e','c','t',')',0}, + {'_','a','u','t','o','d','e','t','e','c','t','_','c','h','s',0}, + {'_','a','u','t','o','d','e','t','e','c','t','_','c','h','s',0}, + {'_','a','u','t','o','d','e','t','e','c','t','_','c','h','s',0}, + {'S','i','m','s','u','n',0}, + {'S','i','m','s','u','n',0}, 134 + }, + }, + /* 1. Chinese Simplified (GB2312) */ + { + { + MIMECONTF_MAILNEWS | MIMECONTF_BROWSER | MIMECONTF_MINIMAL | MIMECONTF_IMPORT | + MIMECONTF_SAVABLE_MAILNEWS | MIMECONTF_SAVABLE_BROWSER | MIMECONTF_EXPORT | MIMECONTF_VALID | + MIMECONTF_VALID_NLS | MIMECONTF_MIME_IE4 | MIMECONTF_MIME_LATEST, + 936, 936, {'C','h','i','n','e','s','e',' ','S','i','m','p','l','i','f','i','e','d',' ','(','G','B','2','3','1','2',')',0}, + {'g','b','2','3','1','2',0}, + {'g','b','2','3','1','2',0}, + {'g','b','2','3','1','2',0}, + {'S','i','m','s','u','n',0}, + {'S','i','m','s','u','n',0}, 134 + }, + }, + /* 2. Chinese Simplified (GB2312-80) */ + { + { + MIMECONTF_IMPORT | MIMECONTF_EXPORT | MIMECONTF_VALID | MIMECONTF_VALID_NLS | + MIMECONTF_MIME_LATEST, + 20936, 936, {'C','h','i','n','e','s','e',' ','S','i','m','p','l','i','f','i','e','d',' ','(','G','B','2','3','1','2','-','8','0',')',0}, + {'x','-','c','p','2','0','9','3','6',0}, + {'x','-','c','p','2','0','9','3','6',0}, + {'x','-','c','p','2','0','9','3','6',0}, + {'S','i','m','s','u','n',0}, + {'S','i','m','s','u','n',0}, 134 + }, + }, + /* 3. Chinese Simplified (HZ) */ + { + { + MIMECONTF_MAILNEWS | MIMECONTF_BROWSER | MIMECONTF_IMPORT | MIMECONTF_SAVABLE_MAILNEWS | + MIMECONTF_SAVABLE_BROWSER | MIMECONTF_EXPORT | MIMECONTF_VALID | MIMECONTF_VALID_NLS | + MIMECONTF_MIME_IE4 | MIMECONTF_MIME_LATEST, + 52936, 936, {'C','h','i','n','e','s','e',' ','S','i','m','p','l','i','f','i','e','d',' ','(','H','Z',')',0}, + {'h','z','-','g','b','-','2','3','1','2',0}, + {'h','z','-','g','b','-','2','3','1','2',0}, + {'h','z','-','g','b','-','2','3','1','2',0}, + {'S','i','m','s','u','n',0}, + {'S','i','m','s','u','n',0}, 134 + }, + }, + /* 4. Chinese Simplified (GB18030) */ + { + { + MIMECONTF_MAILNEWS | MIMECONTF_BROWSER | MIMECONTF_MINIMAL | MIMECONTF_IMPORT | + MIMECONTF_SAVABLE_MAILNEWS | MIMECONTF_SAVABLE_BROWSER | MIMECONTF_EXPORT | MIMECONTF_VALID | + MIMECONTF_VALID_NLS | MIMECONTF_MIME_LATEST, + 54936, 936, {'C','h','i','n','e','s','e',' ','S','i','m','p','l','i','f','i','e','d',' ','(','G','B','1','8','0','3','0',')',0}, + {'G','B','1','8','0','3','0',0}, + {'G','B','1','8','0','3','0',0}, + {'G','B','1','8','0','3','0',0}, + {'S','i','m','s','u','n',0}, + {'S','i','m','s','u','n',0}, 134 + }, + }, + /* 5. Chinese Traditional (Auto-Select) */ + { + { + MIMECONTF_IMPORT | MIMECONTF_VALID | MIMECONTF_VALID_NLS | MIMECONTF_MIME_LATEST, + 50950, 950, {'C','h','i','n','e','s','e',' ','T','r','a','d','i','t','i','o','n','a','l',' ','(','A','u','t','o','-','S','e','l','e','c','t',')',0}, + {'_','a','u','t','o','d','e','t','e','c','t','_','c','h','t',0}, + {'_','a','u','t','o','d','e','t','e','c','t','_','c','h','t',0}, + {'_','a','u','t','o','d','e','t','e','c','t','_','c','h','t',0}, + {'M','i','n','g','L','i','u',0}, + {'N','e','w',' ','M','i','n','g','L','i','u',0}, 136 + }, + }, + /* 6. Chinese Traditional (Big5) */ + { + { + MIMECONTF_MAILNEWS | MIMECONTF_BROWSER | MIMECONTF_MINIMAL | MIMECONTF_IMPORT | + MIMECONTF_SAVABLE_MAILNEWS | MIMECONTF_SAVABLE_BROWSER | MIMECONTF_EXPORT | MIMECONTF_VALID | + MIMECONTF_VALID_NLS | MIMECONTF_MIME_IE4 | MIMECONTF_MIME_LATEST, + 950, 950, {'C','h','i','n','e','s','e',' ','T','r','a','d','i','t','i','o','n','a','l',' ','(','B','i','g','5',')',0}, + {'b','i','g','5',0}, + {'b','i','g','5',0}, + {'b','i','g','5',0}, + {'M','i','n','g','L','i','u',0}, + {'N','e','w',' ','M','i','n','g','L','i','u',0}, 136 + }, + }, + /* 7. Chinese Traditional (CNS) */ + { + { + MIMECONTF_IMPORT | MIMECONTF_EXPORT | MIMECONTF_VALID | MIMECONTF_VALID_NLS | + MIMECONTF_MIME_LATEST, + 20000, 950, {'C','h','i','n','e','s','e',' ','T','r','a','d','i','t','i','o','n','a','l',' ','(','C','N','S',')',0}, + {'x','-','C','h','i','n','e','s','e','-','C','N','S',0}, + {'x','-','C','h','i','n','e','s','e','-','C','N','S',0}, + {'x','-','C','h','i','n','e','s','e','-','C','N','S',0}, + {'M','i','n','g','L','i','u',0}, + {'N','e','w',' ','M','i','n','g','L','i','u',0}, 136 + }, + }, + /* 8. Arabic (Windows) */ + { + { + MIMECONTF_MAILNEWS | MIMECONTF_BROWSER | MIMECONTF_IMPORT | MIMECONTF_SAVABLE_MAILNEWS | + MIMECONTF_SAVABLE_BROWSER | MIMECONTF_EXPORT | MIMECONTF_VALID | MIMECONTF_VALID_NLS | + MIMECONTF_MIME_LATEST, + 1256, 1256, {'A','r','a','b','i','c',' ','(','W','i','n','d','o','w','s',')',0}, + {'w','i','n','d','o','w','s','-','1','2','5','6',0}, + {'w','i','n','d','o','w','s','-','1','2','5','6',0}, + {'w','i','n','d','o','w','s','-','1','2','5','6',0}, + {'S','i','m','p','l','i','f','i','e','d',' ','A','r','a','b','i','c',' ','F','i','x','e','d',0}, + {'S','i','m','p','l','i','f','i','e','d',' ','A','r','a','b','i','c',0}, 178 + }, + }, + /* 9. Baltic (Windows) */ + { + { + MIMECONTF_MAILNEWS | MIMECONTF_BROWSER | MIMECONTF_MINIMAL | MIMECONTF_IMPORT | + MIMECONTF_SAVABLE_MAILNEWS | MIMECONTF_SAVABLE_BROWSER | MIMECONTF_EXPORT | MIMECONTF_VALID | + MIMECONTF_VALID_NLS | MIMECONTF_MIME_LATEST, + 1257, 1257, {'B','a','l','t','i','c',' ','(','W','i','n','d','o','w','s',')',0}, + {'w','i','n','d','o','w','s','-','1','2','5','7',0}, + {'w','i','n','d','o','w','s','-','1','2','5','7',0}, + {'w','i','n','d','o','w','s','-','1','2','5','7',0}, + {'C','o','u','r','i','e','r',' ','N','e','w',0}, + {'A','r','i','a','l',0}, 186 + }, + }, + /* 10. Central European (Windows) */ + { + { + MIMECONTF_MAILNEWS | MIMECONTF_BROWSER | MIMECONTF_IMPORT | MIMECONTF_SAVABLE_MAILNEWS | + MIMECONTF_SAVABLE_BROWSER | MIMECONTF_EXPORT | MIMECONTF_VALID | MIMECONTF_VALID_NLS | + MIMECONTF_MIME_LATEST, + 1250, 1250, {'C','e','n','t','r','a','l',' ','E','u','r','o','p','e','a','n',' ','(','W','i','n','d','o','w','s',')',0}, + {'w','i','n','d','o','w','s','-','1','2','5','0',0}, + {'w','i','n','d','o','w','s','-','1','2','5','0',0}, + {'i','s','o','-','8','8','5','9','-','2',0}, + {'C','o','u','r','i','e','r',' ','N','e','w',0}, + {'A','r','i','a','l',0}, 238 + }, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE + }, + /* 11. Cyrillic (Windows) */ + { + { + MIMECONTF_MAILNEWS | MIMECONTF_BROWSER | MIMECONTF_IMPORT | MIMECONTF_SAVABLE_MAILNEWS | + MIMECONTF_SAVABLE_BROWSER | MIMECONTF_EXPORT | MIMECONTF_VALID | MIMECONTF_VALID_NLS | + MIMECONTF_MIME_LATEST, + 1251, 1251, {'C','y','r','i','l','l','i','c',' ','(','W','i','n','d','o','w','s',')',0}, + {'w','i','n','d','o','w','s','-','1','2','5','1',0}, + {'w','i','n','d','o','w','s','-','1','2','5','1',0}, + {'k','o','i','8','-','r',0}, + {'C','o','u','r','i','e','r',' ','N','e','w',0}, + {'A','r','i','a','l',0}, 204 + }, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE + }, + /* 12. Greek (Windows) */ + { + { + MIMECONTF_MAILNEWS | MIMECONTF_BROWSER | MIMECONTF_IMPORT | MIMECONTF_SAVABLE_MAILNEWS | + MIMECONTF_SAVABLE_BROWSER | MIMECONTF_EXPORT | MIMECONTF_VALID | MIMECONTF_VALID_NLS | + MIMECONTF_MIME_LATEST, + 1253, 1253, {'G','r','e','e','k',' ','(','W','i','n','d','o','w','s',')',0}, + {'w','i','n','d','o','w','s','-','1','2','5','3',0}, + {'w','i','n','d','o','w','s','-','1','2','5','3',0}, + {'i','s','o','-','8','8','5','9','-','7',0}, + {'C','o','u','r','i','e','r',' ','N','e','w',0}, + {'A','r','i','a','l',0}, 161 + }, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE + }, + /* 13. Hebrew (Windows) */ + { + { + MIMECONTF_MAILNEWS | MIMECONTF_BROWSER | MIMECONTF_IMPORT | MIMECONTF_SAVABLE_MAILNEWS | + MIMECONTF_SAVABLE_BROWSER | MIMECONTF_EXPORT | MIMECONTF_VALID | MIMECONTF_VALID_NLS | + MIMECONTF_MIME_LATEST, + 1255, 1255, {'H','e','b','r','e','w',' ','(','W','i','n','d','o','w','s',')',0}, + {'w','i','n','d','o','w','s','-','1','2','5','5',0}, + {'w','i','n','d','o','w','s','-','1','2','5','5',0}, + {'w','i','n','d','o','w','s','-','1','2','5','5',0}, + {'M','i','r','i','a','m',' ','F','i','x','e','d',0}, + {'D','a','v','i','d',0}, 177 + }, + }, + /* 14. Japanese (Shift-JIS) */ + { + { + MIMECONTF_MAILNEWS | MIMECONTF_BROWSER | MIMECONTF_MINIMAL | MIMECONTF_IMPORT | + MIMECONTF_SAVABLE_MAILNEWS | MIMECONTF_SAVABLE_BROWSER | MIMECONTF_EXPORT | MIMECONTF_VALID | + MIMECONTF_VALID_NLS | MIMECONTF_MIME_IE4 | MIMECONTF_MIME_LATEST, + 932, 932, {'J','a','p','a','n','e','s','e',' ','(','S','h','i','f','t','-','J','I','S',')',0}, + {'s','h','i','f','t','_','j','i','s',0}, + {'i','s','o','-','2','0','2','2','-','j','p',0}, + {'i','s','o','-','2','0','2','2','-','j','p',0}, + {'M','S',' ','G','o','t','h','i','c',0}, + {'M','S',' ','P','G','o','t','h','i','c',0}, 128 + } + }, + /* 15. Korean */ + { + { + MIMECONTF_MAILNEWS | MIMECONTF_BROWSER | MIMECONTF_MINIMAL | MIMECONTF_IMPORT | + MIMECONTF_SAVABLE_MAILNEWS | MIMECONTF_SAVABLE_BROWSER | MIMECONTF_EXPORT | MIMECONTF_VALID | + MIMECONTF_VALID_NLS | MIMECONTF_MIME_LATEST, + 949, 949, {'K','o','r','e','a','n',0}, + {'k','s','_','c','_','5','6','0','1','-','1','9','8','7',0}, + {'k','s','_','c','_','5','6','0','1','-','1','9','8','7',0}, + {'k','s','_','c','_','5','6','0','1','-','1','9','8','7',0}, + {'G','u','l','i','m','C','h','e',0}, + {'G','u','l','i','m',0}, 129 + }, + }, + /* 16. Thai (Windows) */ + { + { + MIMECONTF_MAILNEWS | MIMECONTF_BROWSER | MIMECONTF_MINIMAL | MIMECONTF_IMPORT | + MIMECONTF_SAVABLE_MAILNEWS | MIMECONTF_SAVABLE_BROWSER | MIMECONTF_EXPORT | MIMECONTF_VALID | + MIMECONTF_VALID_NLS | MIMECONTF_MIME_LATEST, + 874, 874, {'T','h','a','i',' ','(','W','i','n','d','o','w','s',')',0}, + {'w','i','n','d','o','w','s','-','8','7','4',0}, + {'w','i','n','d','o','w','s','-','8','7','4',0}, + {'w','i','n','d','o','w','s','-','8','7','4',0}, + {'T','a','h','o','m','a',0}, + {'T','a','h','o','m','a',0}, 222 + }, + FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE + }, + /* 17. Turkish (Windows) */ + { + { + MIMECONTF_MAILNEWS | MIMECONTF_BROWSER | MIMECONTF_MINIMAL | MIMECONTF_IMPORT | + MIMECONTF_SAVABLE_MAILNEWS | MIMECONTF_SAVABLE_BROWSER | MIMECONTF_EXPORT | MIMECONTF_VALID | + MIMECONTF_VALID_NLS | MIMECONTF_MIME_LATEST, + 1254, 1254, {'T','u','r','k','i','s','h',' ','(','W','i','n','d','o','w','s',')',0}, + {'w','i','n','d','o','w','s','-','1','2','5','4',0}, + {'w','i','n','d','o','w','s','-','1','2','5','4',0}, + {'i','s','o','-','8','8','5','9','-','9',0}, + {'C','o','u','r','i','e','r',' ','N','e','w',0}, + {'A','r','i','a','l',0}, 162 + }, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE + }, + /* 18. Vietnamese (Windows) */ + { + { + MIMECONTF_MAILNEWS | MIMECONTF_BROWSER | MIMECONTF_IMPORT | MIMECONTF_SAVABLE_MAILNEWS | + MIMECONTF_SAVABLE_BROWSER | MIMECONTF_EXPORT | MIMECONTF_VALID | MIMECONTF_VALID_NLS | + MIMECONTF_MIME_IE4 | MIMECONTF_MIME_LATEST, + 1258, 1258, {'V','i','e','t','n','a','m','e','s','e',' ','(','W','i','n','d','o','w','s',')',0}, + {'w','i','n','d','o','w','s','-','1','2','5','8',0}, + {'w','i','n','d','o','w','s','-','1','2','5','8',0}, + {'w','i','n','d','o','w','s','-','1','2','5','8',0}, + {'C','o','u','r','i','e','r',' ','N','e','w',0}, + {'A','r','i','a','l',0}, 163 + }, + }, + /* 19. Western European (Windows) */ + { + { + MIMECONTF_MAILNEWS | MIMECONTF_BROWSER | MIMECONTF_MINIMAL | MIMECONTF_IMPORT | + MIMECONTF_SAVABLE_MAILNEWS | MIMECONTF_SAVABLE_BROWSER | MIMECONTF_EXPORT | MIMECONTF_VALID | + MIMECONTF_VALID_NLS | MIMECONTF_MIME_LATEST, + 1252, 1252, {'W','e','s','t','e','r','n',' ','E','u','r','o','p','e','a','n',' ','(','W','i','n','d','o','w','s',')',0}, + {'W','i','n','d','o','w','s','-','1','2','5','2',0}, + {'W','i','n','d','o','w','s','-','1','2','5','2',0}, + {'i','s','o','-','8','8','5','9','-','1',0}, + {'C','o','u','r','i','e','r',' ','N','e','w',0}, + {'A','r','i','a','l',0}, 0 + }, + FALSE, FALSE, FALSE, FALSE, TRUE, TRUE + }, + /* 20. Unicode */ + { + { + MIMECONTF_MINIMAL | MIMECONTF_IMPORT | MIMECONTF_SAVABLE_BROWSER | MIMECONTF_EXPORT | + MIMECONTF_VALID | MIMECONTF_VALID_NLS | MIMECONTF_MIME_IE4 | MIMECONTF_MIME_LATEST, + 1200, 1200, {'U','n','i','c','o','d','e',0}, + {'u','n','i','c','o','d','e',0}, + {'u','n','i','c','o','d','e',0}, + {'u','n','i','c','o','d','e',0}, + {'C','o','u','r','i','e','r',' ','N','e','w',0}, + {'A','r','i','a','l',0}, 1 + }, + } +}; + static BOOL init_function_ptrs(void) { HMODULE hMlang; @@ -2212,6 +2524,177 @@ static void test_DetectOutboundCodePageInIStream(IMultiLanguage3 *ml) todo_wine ok(detected[2] == 1200, "got %u\n", detected[2]); } +static void test_GetCodePageInfo(IMultiLanguage2 *iML2) +{ + static const DWORD VALID_MASK = (DWORD)(~(MIMECONTF_VALID_NLS | MIMECONTF_VALID)); + + const struct cpinfo_test_data *test_data = NULL; + UINT test_data_num; + MIMECPINFO cpinfo_cmp; + MIMECPINFO cpinfo; + UINT i; + HRESULT ret; + + test_data = iml2_cpinfo_data; + test_data_num = sizeof(iml2_cpinfo_data) / sizeof(iml2_cpinfo_data[0]); + for (i = 0; i < test_data_num; i++) + { + ret = IMultiLanguage2_GetCodePageInfo(iML2, test_data[i].cpinfo.uiCodePage, LANG_NEUTRAL, &cpinfo); + todo_wine_if(test_data[i].todo_GetCodePageInfo) + ok(ret == S_OK, "%d: IMultiLanguage2_GetCodePageInfo failed: 0x%08x.\n", i, ret); + + if (ret == S_OK) + { + cpinfo_cmp = test_data[i].cpinfo; + todo_wine_if(test_data[i].todo_dwFlags) + ok((cpinfo.dwFlags == cpinfo_cmp.dwFlags ) || + /* some code pages are not installed on the Wine Test Bot */ + ((cpinfo.dwFlags & VALID_MASK) == (cpinfo_cmp.dwFlags & VALID_MASK)), + "%d: got wrong dwFlags expected 0x%x return 0x%x.\n", + i, cpinfo_cmp.dwFlags, cpinfo.dwFlags); + ok(cpinfo.uiCodePage == cpinfo_cmp.uiCodePage, + "%d: got wrong uiCodePage expected %u return %u.\n", + i, cpinfo_cmp.uiCodePage, cpinfo.uiCodePage); + todo_wine_if(test_data[i].todo_uiFamilyCodePage) + ok(cpinfo.uiFamilyCodePage == cpinfo_cmp.uiFamilyCodePage, + "%d: got wrong uiFamilyCodePage expected %u return %u.\n", + i, cpinfo_cmp.uiFamilyCodePage, cpinfo.uiFamilyCodePage); + + todo_wine_if(test_data[i].todo_wszWebCharset) + ok(!lstrcmpW(cpinfo.wszWebCharset, cpinfo_cmp.wszWebCharset), + "%d: got wrong wszWebCharset expected %s return %s.\n", + i, wine_dbgstr_w(cpinfo_cmp.wszWebCharset), wine_dbgstr_w(cpinfo.wszWebCharset)); + todo_wine_if(test_data[i].todo_wszHeaderCharset) + ok(!lstrcmpW(cpinfo.wszHeaderCharset, cpinfo_cmp.wszHeaderCharset), + "%d: got wrong wszHeaderCharset expected %s return %s.\n", + i, wine_dbgstr_w(cpinfo_cmp.wszHeaderCharset), wine_dbgstr_w(cpinfo.wszHeaderCharset)); + todo_wine_if(test_data[i].todo_wszBodyCharset) + ok(!lstrcmpW(cpinfo.wszBodyCharset, cpinfo_cmp.wszBodyCharset), + "%d: got wrong wszBodyCharset expected %s return %s.\n", + i, wine_dbgstr_w(cpinfo_cmp.wszBodyCharset), wine_dbgstr_w(cpinfo.wszBodyCharset)); + + if ((PRIMARYLANGID(LANGIDFROMLCID(GetSystemDefaultLCID())) != LANG_ENGLISH) || + (PRIMARYLANGID(LANGIDFROMLCID(GetThreadLocale())) != LANG_ENGLISH)) + { + /* FIXME: Windows returns description and font name in system's language */ + skip("Non-English locale\n"); + } + else + { + todo_wine_if(test_data[i].todo_wszDescription) + ok(!lstrcmpW(cpinfo.wszDescription, cpinfo_cmp.wszDescription), + "%d: got wrong wszDescription expected %s return %s.\n", + i, wine_dbgstr_w(cpinfo_cmp.wszDescription), wine_dbgstr_w(cpinfo.wszDescription)); + todo_wine_if(test_data[i].todo_wszFixedWidthFont) + ok(!lstrcmpW(cpinfo.wszFixedWidthFont, cpinfo_cmp.wszFixedWidthFont), + "%d: got wrong wszFixedWidthFont expected %s return %s.\n", + i, wine_dbgstr_w(cpinfo_cmp.wszFixedWidthFont), wine_dbgstr_w(cpinfo.wszFixedWidthFont)); + todo_wine_if(test_data[i].todo_wszProportionalFont) + ok(!lstrcmpW(cpinfo.wszProportionalFont, cpinfo_cmp.wszProportionalFont), + "%d: got wrong wszProportionalFont expected %s return %s.\n", + i, wine_dbgstr_w(cpinfo_cmp.wszProportionalFont), wine_dbgstr_w(cpinfo.wszProportionalFont)); + } + } + } +} + +static void test_MapFont(IMLangFontLink *font_link, IMLangFontLink2 *font_link2) +{ + HFONT old_font = NULL; + HFONT new_font = NULL; + HFONT last_font = NULL; + HFONT font1 = NULL; + HFONT font2 = NULL; + DWORD codepages; + DWORD font_codepages; + HRESULT ret; + HDC hdc; + WCHAR ch; + + hdc = GetDC(NULL); + codepages = FS_LATIN1 | FS_LATIN2 | FS_CYRILLIC | FS_GREEK | FS_TURKISH | + FS_HEBREW | FS_ARABIC | FS_BALTIC | FS_VIETNAMESE | FS_THAI | + FS_JISJAPAN | FS_CHINESESIMP | FS_WANSUNG | FS_CHINESETRAD; + old_font = GetCurrentObject(hdc, OBJ_FONT); + ch = 0xfeed; + + /* Tests for IMLangFontLink */ + + ret = IMLangFontLink_ResetFontMapping(font_link); + ok(ret == S_OK, "IMLangFontLink_ResetFontMapping: expected S_OK, got %08x\n", ret); + + ret = IMLangFontLink_MapFont(font_link, NULL, 0, NULL, NULL); + ok(ret == E_FAIL, "IMLangFontLink_MapFont: expected E_FAIL, got %08x\n", ret); + ret = IMLangFontLink_MapFont(font_link, NULL, codepages, old_font, &new_font); + ok(ret == E_FAIL, "IMLangFontLink_MapFont: expected E_FAIL, got %08x\n", ret); + ret = IMLangFontLink_MapFont(font_link, hdc, codepages, NULL, &new_font); + ok(ret == E_FAIL, "IMLangFontLink_MapFont: expected E_FAIL, got %08x\n", ret); + + ret = IMLangFontLink_MapFont(font_link, hdc, codepages, old_font, NULL); + ok(ret == S_OK, "IMLangFontLink_MapFont: expected S_OK, got %08x\n", ret); + ret = IMLangFontLink_MapFont(font_link, hdc, codepages, old_font, &new_font); + ok(ret == S_OK && new_font != NULL, "IMLangFontLink_MapFont: expected S_OK/!NULL, got %08x/%p\n", ret, new_font); + last_font = new_font; + ret = IMLangFontLink_MapFont(font_link, hdc, codepages, old_font, &new_font); + ok(ret == S_OK && new_font == last_font, "IMLangFontLink_MapFont: expected S_OK/%p, got %08x/%p\n", last_font, ret, new_font); + + ret = IMLangFontLink_ReleaseFont(font_link, NULL); + ok(ret == E_FAIL, "IMLangFontLink_ReleaseFont: expected E_FAIL, got %08x\n", ret); + ret = IMLangFontLink_ReleaseFont(font_link, new_font); + ok(ret == S_OK, "IMLangFontLink_ReleaseFont: expected S_OK, got %08x\n", ret); + ret = IMLangFontLink_ResetFontMapping(font_link); + ok(ret == S_OK, "IMLangFontLink_ResetFontMapping: expected S_OK, got %08x\n", ret); + + /* Tests for IMLangFontLink2 */ + + ret = IMLangFontLink2_ResetFontMapping(font_link2); + ok(ret == S_OK, "IMLangFontLink2_ResetFontMapping: expected S_OK, got %08x\n", ret); + + ret = IMLangFontLink2_MapFont(font_link2, NULL, 0, 0, NULL); + ok(ret == E_FAIL, "IMLangFontLink2_MapFont: expected E_FAIL, got %08x\n", ret); + ret = IMLangFontLink2_MapFont(font_link2, NULL, codepages, ch, &new_font); + ok(ret == E_FAIL, "IMLangFontLink2_MapFont: expected E_FAIL, got %08x\n", ret); + ret = IMLangFontLink2_MapFont(font_link2, hdc, 0, 0, NULL); + ok(ret == E_INVALIDARG, "IMLangFontLink2_MapFont: expected E_INVALIDARG, got %08x\n", ret); + ret = IMLangFontLink2_MapFont(font_link2, hdc, 0, ch, NULL); + ok(ret == E_INVALIDARG, "IMLangFontLink2_MapFont: expected E_INVALIDARG, got %08x\n", ret); + + ret = IMLangFontLink2_MapFont(font_link2, hdc, 0, ch, &new_font); + todo_wine + ok(ret == S_OK || broken(ret == E_FAIL), /* got E_FAIL on winxp and win2k */ + "IMLangFontLink2_MapFont: expected S_OK || E_FAIL, got %08x\n", ret); + ret = IMLangFontLink2_MapFont(font_link2, hdc, codepages, 0, NULL); + ok(ret == S_OK, "IMLangFontLink2_MapFont: expected S_OK, got %08x\n", ret); + ret = IMLangFontLink2_MapFont(font_link2, hdc, codepages, 0, &new_font); + ok(ret == S_OK && new_font != NULL, "IMLangFontLink2_MapFont: expected S_OK/!NULL, got %08x/%p\n", ret, new_font); + last_font = new_font; + ret = IMLangFontLink2_MapFont(font_link2, hdc, codepages, 0, &new_font); + ok(ret == S_OK && new_font == last_font, "IMLangFontLink2_MapFont: expected S_OK/%p, got %08x/%p\n", last_font, ret, new_font); + + ret = IMLangFontLink2_ReleaseFont(font_link2, NULL); + ok(ret == E_FAIL, "IMLangFontLink2_ReleaseFont: expected E_FAIL, got %08x\n", ret); + ret = IMLangFontLink2_ReleaseFont(font_link2, new_font); + ok(ret == S_OK, "IMLangFontLink2_ReleaseFont: expected S_OK, got %08x\n", ret); + ret = IMLangFontLink2_ResetFontMapping(font_link2); + ok(ret == S_OK, "IMLangFontLink2_ResetFontMapping: expected S_OK, got %08x\n", ret); + + /* Show that the font cache is global */ + ret = IMLangFontLink_MapFont(font_link, hdc, codepages, old_font, &font1); + ok(ret == S_OK, "MapFont() failed, hr %#x.\n", ret); + ret = IMLangFontLink2_MapFont(font_link2, hdc, codepages, 0, &font2); + ok(ret == S_OK, "MapFont() failed, hr %#x.\n", ret); + ok(font1 != NULL && font2 != NULL, "expected !NULL/!NULL, got %p/%p\n", font1, font2); + ok(font1 == font2, "expected equal, got not equal\n"); + + IMLangFontLink_GetFontCodePages(font_link, hdc, font1, &font_codepages); + ok((codepages & (~font_codepages)) != 0 && (codepages & font_codepages) != 0, + "code pages of font is incorrect\n"); + + IMLangFontLink_ResetFontMapping(font_link); + IMLangFontLink2_ResetFontMapping(font_link2); + ReleaseDC(NULL, hdc); +} + START_TEST(mlang) { IMultiLanguage *iML = NULL; @@ -2255,6 +2738,7 @@ START_TEST(mlang) test_GetRfc1766FromLcid(iML2); test_GetRfc1766Info(iML2); test_GetNumberOfCodePageInfo(iML2); + test_GetCodePageInfo(iML2); test_EnumCodePages(iML2, 0); test_EnumCodePages(iML2, MIMECONTF_MIME_LATEST); @@ -2287,7 +2771,6 @@ START_TEST(mlang) if (ret != S_OK || !iMLFL) return; IMLangFontLink_Test(iMLFL); - IMLangFontLink_Release(iMLFL); /* IMLangFontLink2 */ ret = CoCreateInstance(&CLSID_CMultiLanguage, NULL, CLSCTX_INPROC_SERVER, @@ -2297,6 +2780,9 @@ START_TEST(mlang) test_GetScriptFontInfo(iMLFL2); test_GetFontUnicodeRanges(iMLFL2); test_CodePageToScriptID(iMLFL2); + test_MapFont(iMLFL, iMLFL2); + + IMLangFontLink_Release(iMLFL); IMLangFontLink2_Release(iMLFL2); trace("IMultiLanguage3\n");
6 years, 11 months
1
0
0
0
01/01: [MLANG] Sync with Wine 3.0. CORE-14225
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=5e2c163f70cab88b32d55…
commit 5e2c163f70cab88b32d5501ea9c91e8681893ea9 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Fri Jan 19 12:27:23 2018 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Fri Jan 19 12:27:23 2018 +0100 [MLANG] Sync with Wine 3.0. CORE-14225 --- dll/win32/mlang/mlang.c | 242 +++++++++++++++++++++++++++++++++++++++++------- media/doc/README.WINE | 2 +- 2 files changed, 212 insertions(+), 32 deletions(-) diff --git a/dll/win32/mlang/mlang.c b/dll/win32/mlang/mlang.c index a9d1393541..9554c4de33 100644 --- a/dll/win32/mlang/mlang.c +++ b/dll/win32/mlang/mlang.c @@ -41,6 +41,7 @@ #include <mlang.h> #include <mimeole.h> +#include <wine/list.h> #include <wine/unicode.h> #include <wine/debug.h> @@ -121,13 +122,33 @@ static const MIME_CP_INFO baltic_cp[] = }; static const MIME_CP_INFO chinese_simplified_cp[] = { + { "Chinese Simplified (Auto-Select)", + 50936, MIMECONTF_IMPORT | MIMECONTF_VALID | MIMECONTF_VALID_NLS | + MIMECONTF_MIME_LATEST, + "_autodetect_chs", "_autodetect_chs", "_autodetect_chs" }, { "Chinese Simplified (GB2312)", 936, MIMECONTF_MAILNEWS | MIMECONTF_BROWSER | MIMECONTF_MINIMAL | - MIMECONTF_IMPORT | MIMECONTF_SAVABLE_MAILNEWS | + MIMECONTF_IMPORT | MIMECONTF_SAVABLE_MAILNEWS | MIMECONTF_VALID | MIMECONTF_SAVABLE_BROWSER | MIMECONTF_EXPORT | MIMECONTF_VALID_NLS | MIMECONTF_MIME_IE4 | MIMECONTF_MIME_LATEST, "gb2312", "gb2312", "gb2312" }, - { "Chinese Simplified (GBK)", + { "Chinese Simplified (GB2312-80)", + 20936, MIMECONTF_IMPORT | MIMECONTF_EXPORT | MIMECONTF_VALID | + MIMECONTF_VALID_NLS | MIMECONTF_MIME_LATEST, + "x-cp20936", "x-cp20936", "x-cp20936" }, + { "Chinese Simplified (HZ)", + 52936, MIMECONTF_MAILNEWS | MIMECONTF_BROWSER | MIMECONTF_IMPORT | + MIMECONTF_SAVABLE_MAILNEWS | MIMECONTF_SAVABLE_BROWSER | MIMECONTF_EXPORT | + MIMECONTF_VALID | MIMECONTF_VALID_NLS | MIMECONTF_MIME_IE4 | + MIMECONTF_MIME_LATEST, + "hz-gb-2312", "hz-gb-2312", "hz-gb-2312" }, + { "Chinese Simplified (GB18030)", + 54936, MIMECONTF_MAILNEWS | MIMECONTF_BROWSER | MIMECONTF_MINIMAL | + MIMECONTF_IMPORT | MIMECONTF_SAVABLE_MAILNEWS | MIMECONTF_SAVABLE_BROWSER | + MIMECONTF_EXPORT | MIMECONTF_VALID | MIMECONTF_VALID_NLS | + MIMECONTF_MIME_LATEST, + "GB18030", "GB18030", "GB18030" }, + { "Chinese Simplified (GBK)", 936, MIMECONTF_MAILNEWS | MIMECONTF_BROWSER | MIMECONTF_MINIMAL | MIMECONTF_IMPORT | MIMECONTF_SAVABLE_MAILNEWS | MIMECONTF_SAVABLE_BROWSER | MIMECONTF_EXPORT | MIMECONTF_VALID_NLS | @@ -136,12 +157,20 @@ static const MIME_CP_INFO chinese_simplified_cp[] = }; static const MIME_CP_INFO chinese_traditional_cp[] = { + { "Chinese Traditional (Auto-Select)", + 50950, MIMECONTF_IMPORT | MIMECONTF_VALID | MIMECONTF_VALID_NLS | + MIMECONTF_MIME_LATEST, + "_autodetect_cht", "_autodetect_cht", "_autodetect_cht" }, { "Chinese Traditional (Big5)", 950, MIMECONTF_MAILNEWS | MIMECONTF_BROWSER | MIMECONTF_MINIMAL | MIMECONTF_IMPORT | MIMECONTF_SAVABLE_MAILNEWS | - MIMECONTF_SAVABLE_BROWSER | MIMECONTF_EXPORT | + MIMECONTF_SAVABLE_BROWSER | MIMECONTF_EXPORT | MIMECONTF_VALID | MIMECONTF_VALID_NLS | MIMECONTF_MIME_IE4 | MIMECONTF_MIME_LATEST, - "big5", "big5", "big5" } + "big5", "big5", "big5" }, + { "Chinese Traditional (CNS)", + 20000, MIMECONTF_IMPORT | MIMECONTF_EXPORT | MIMECONTF_VALID | + MIMECONTF_VALID_NLS | MIMECONTF_MIME_LATEST, + "x-Chinese-CNS", "x-Chinese-CNS", "x-Chinese-CNS" } }; static const MIME_CP_INFO central_european_cp[] = { @@ -469,36 +498,54 @@ static const struct mlang_data } mlang_data[] = { { "Arabic",1256,sizeof(arabic_cp)/sizeof(arabic_cp[0]),arabic_cp, - "Courier","Arial", sidArabic }, /* FIXME */ + "Simplified Arabic Fixed","Simplified Arabic", sidArabic }, { "Baltic",1257,sizeof(baltic_cp)/sizeof(baltic_cp[0]),baltic_cp, - "Courier","Arial", sidAsciiLatin }, /* FIXME */ + "Courier New","Arial", sidAsciiLatin }, { "Chinese Simplified",936,sizeof(chinese_simplified_cp)/sizeof(chinese_simplified_cp[0]),chinese_simplified_cp, - "Courier","Arial", sidHan }, /* FIXME */ + "Simsun","Simsun", sidHan }, { "Chinese Traditional",950,sizeof(chinese_traditional_cp)/sizeof(chinese_traditional_cp[0]),chinese_traditional_cp, - "Courier","Arial", sidBopomofo }, /* FIXME */ + "MingLiu","New MingLiu", sidBopomofo }, { "Central European",1250,sizeof(central_european_cp)/sizeof(central_european_cp[0]),central_european_cp, - "Courier","Arial", sidAsciiLatin }, /* FIXME */ + "Courier New","Arial", sidAsciiLatin }, { "Cyrillic",1251,sizeof(cyrillic_cp)/sizeof(cyrillic_cp[0]),cyrillic_cp, - "Courier","Arial", sidCyrillic }, /* FIXME */ + "Courier New","Arial", sidCyrillic }, { "Greek",1253,sizeof(greek_cp)/sizeof(greek_cp[0]),greek_cp, - "Courier","Arial", sidGreek }, /* FIXME */ + "Courier New","Arial", sidGreek }, { "Hebrew",1255,sizeof(hebrew_cp)/sizeof(hebrew_cp[0]),hebrew_cp, - "Courier","Arial", sidHebrew }, /* FIXME */ + "Miriam Fixed","David", sidHebrew }, { "Japanese",932,sizeof(japanese_cp)/sizeof(japanese_cp[0]),japanese_cp, "MS Gothic","MS PGothic", sidKana }, { "Korean",949,sizeof(korean_cp)/sizeof(korean_cp[0]),korean_cp, - "Courier","Arial", sidHangul }, /* FIXME */ + "GulimChe","Gulim", sidHangul }, { "Thai",874,sizeof(thai_cp)/sizeof(thai_cp[0]),thai_cp, - "Courier","Arial", sidThai }, /* FIXME */ + "Tahoma","Tahoma", sidThai }, { "Turkish",1254,sizeof(turkish_cp)/sizeof(turkish_cp[0]),turkish_cp, - "Courier","Arial", sidAsciiLatin }, /* FIXME */ + "Courier New","Arial", sidAsciiLatin }, { "Vietnamese",1258,sizeof(vietnamese_cp)/sizeof(vietnamese_cp[0]),vietnamese_cp, - "Courier","Arial", sidAsciiLatin }, /* FIXME */ + "Courier New","Arial", sidAsciiLatin }, { "Western European",1252,sizeof(western_cp)/sizeof(western_cp[0]),western_cp, - "Courier","Arial", sidAsciiLatin }, /* FIXME */ + "Courier New","Arial", sidAsciiLatin }, { "Unicode",CP_UNICODE,sizeof(unicode_cp)/sizeof(unicode_cp[0]),unicode_cp, - "Courier","Arial" } /* FIXME */ + "Courier New","Arial" } +}; + +struct font_list +{ + struct list list_entry; + HFONT base_font; + HFONT font; + UINT charset; +}; + +static struct list font_cache = LIST_INIT(font_cache); +static CRITICAL_SECTION font_cache_critical; +static CRITICAL_SECTION_DEBUG font_cache_critical_debug = +{ + 0, 0, &font_cache_critical, + { &font_cache_critical_debug.ProcessLocksList, &font_cache_critical_debug.ProcessLocksList }, + 0, 0, { (DWORD_PTR)(__FILE__ ": font_cache_critical") } }; +static CRITICAL_SECTION font_cache_critical = { &font_cache_critical_debug, -1, 0, 0, 0, 0 }; static void fill_cp_info(const struct mlang_data *ml_data, UINT index, MIMECPINFO *mime_cp_info); @@ -1287,6 +1334,119 @@ HRESULT WINAPI Rfc1766ToLcidA(LCID *lcid, LPCSTR rfc1766A) return Rfc1766ToLcidW(lcid, rfc1766W); } +static HRESULT map_font(HDC hdc, DWORD codepages, HFONT src_font, HFONT *dst_font) +{ + struct font_list *font_list_entry; + CHARSETINFO charset_info; + HFONT new_font, old_font; + LOGFONTW font_attr; + DWORD mask, Csb[2]; + BOOL found_cached; + UINT charset; + BOOL ret; + UINT i; + + if (hdc == NULL || src_font == NULL) return E_FAIL; + + for (i = 0; i < 32; i++) + { + mask = (DWORD)(1 << i); + if (codepages & mask) + { + Csb[0] = mask; + Csb[1] = 0x0; + ret = TranslateCharsetInfo(Csb, &charset_info, TCI_SRCFONTSIG); + if (!ret) continue; + + /* use cached font if possible */ + found_cached = FALSE; + EnterCriticalSection(&font_cache_critical); + LIST_FOR_EACH_ENTRY(font_list_entry, &font_cache, struct font_list, list_entry) + { + if (font_list_entry->charset == charset_info.ciCharset && + font_list_entry->base_font == src_font) + { + if (dst_font != NULL) + *dst_font = font_list_entry->font; + found_cached = TRUE; + } + } + LeaveCriticalSection(&font_cache_critical); + if (found_cached) return S_OK; + + GetObjectW(src_font, sizeof(font_attr), &font_attr); + font_attr.lfCharSet = (BYTE)charset_info.ciCharset; + font_attr.lfWidth = 0; + font_attr.lfFaceName[0] = 0; + new_font = CreateFontIndirectW(&font_attr); + if (new_font == NULL) continue; + + old_font = SelectObject(hdc, new_font); + charset = GetTextCharset(hdc); + SelectObject(hdc, old_font); + if (charset == charset_info.ciCharset) + { + font_list_entry = HeapAlloc(GetProcessHeap(), 0, sizeof(*font_list_entry)); + if (font_list_entry == NULL) return E_OUTOFMEMORY; + + font_list_entry->base_font = src_font; + font_list_entry->font = new_font; + font_list_entry->charset = charset; + + EnterCriticalSection(&font_cache_critical); + list_add_tail(&font_cache, &font_list_entry->list_entry); + LeaveCriticalSection(&font_cache_critical); + + if (dst_font != NULL) + *dst_font = new_font; + return S_OK; + } + } + } + + return E_FAIL; +} + +static HRESULT release_font(HFONT font) +{ + struct font_list *font_list_entry; + HRESULT hr; + + hr = E_FAIL; + EnterCriticalSection(&font_cache_critical); + LIST_FOR_EACH_ENTRY(font_list_entry, &font_cache, struct font_list, list_entry) + { + if (font_list_entry->font == font) + { + list_remove(&font_list_entry->list_entry); + DeleteObject(font); + HeapFree(GetProcessHeap(), 0, font_list_entry); + hr = S_OK; + break; + } + } + LeaveCriticalSection(&font_cache_critical); + + return hr; +} + +static HRESULT clear_font_cache(void) +{ + struct font_list *font_list_entry; + struct font_list *font_list_entry2; + + EnterCriticalSection(&font_cache_critical); + LIST_FOR_EACH_ENTRY_SAFE(font_list_entry, font_list_entry2, &font_cache, struct font_list, list_entry) + { + list_remove(&font_list_entry->list_entry); + DeleteObject(font_list_entry->font); + HeapFree(GetProcessHeap(), 0, font_list_entry); + } + LeaveCriticalSection(&font_cache_critical); + + return S_OK; +} + /****************************************************************************** * MLANG ClassFactory */ @@ -1898,23 +2058,26 @@ static HRESULT WINAPI fnIMLangFontLink_MapFont( HFONT hSrcFont, HFONT* phDestFont) { - FIXME("\n"); - return E_NOTIMPL; + TRACE("(%p)->%p %08x %p %p\n",iface, hDC, dwCodePages, hSrcFont, phDestFont); + + return map_font(hDC, dwCodePages, hSrcFont, phDestFont); } static HRESULT WINAPI fnIMLangFontLink_ReleaseFont( IMLangFontLink* iface, HFONT hFont) { - FIXME("\n"); - return E_NOTIMPL; + TRACE("(%p)->%p\n",iface, hFont); + + return release_font(hFont); } static HRESULT WINAPI fnIMLangFontLink_ResetFontMapping( IMLangFontLink* iface) { - FIXME("\n"); - return E_NOTIMPL; + TRACE("(%p)\n",iface); + + return clear_font_cache(); } @@ -2474,7 +2637,7 @@ static ULONG WINAPI fnIMultiLanguage3_Release( IMultiLanguage3* iface ) TRACE("(%p)->(%d)\n", This, ref); if (ref == 0) { - HeapFree(GetProcessHeap(), 0, This); + HeapFree(GetProcessHeap(), 0, This); UnlockModule(); } @@ -3326,21 +3489,38 @@ static HRESULT WINAPI fnIMLangFontLink2_GetFontCodePages(IMLangFontLink2 *iface, static HRESULT WINAPI fnIMLangFontLink2_ReleaseFont(IMLangFontLink2* This, HFONT hFont) { - FIXME("(%p)->%p\n",This, hFont); - return E_NOTIMPL; + TRACE("(%p)->%p\n",This, hFont); + + return release_font(hFont); } static HRESULT WINAPI fnIMLangFontLink2_ResetFontMapping(IMLangFontLink2* This) { - FIXME("(%p)->\n",This); - return E_NOTIMPL; + TRACE("(%p)\n",This); + + return clear_font_cache(); } static HRESULT WINAPI fnIMLangFontLink2_MapFont(IMLangFontLink2* This, HDC hDC, DWORD dwCodePages, WCHAR chSrc, HFONT *pFont) { - FIXME("(%p)->%p %i %s %p\n",This, hDC, dwCodePages, debugstr_wn(&chSrc,1), pFont); - return E_NOTIMPL; + HFONT old_font; + + TRACE("(%p)->%p %08x %04x %p\n",This, hDC, dwCodePages, chSrc, pFont); + + if (!hDC) return E_FAIL; + + if (dwCodePages != 0) + { + old_font = GetCurrentObject(hDC, OBJ_FONT); + return map_font(hDC, dwCodePages, old_font, pFont); + } + else + { + if (pFont == NULL) return E_INVALIDARG; + FIXME("the situation where dwCodepages is set to zero is not implemented\n"); + return E_FAIL; + } } static HRESULT WINAPI fnIMLangFontLink2_GetFontUnicodeRanges(IMLangFontLink2* This, diff --git a/media/doc/README.WINE b/media/doc/README.WINE index 13f6bdd797..ffe6380a79 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -96,7 +96,7 @@ reactos/dll/win32/mciqtz32 # Synced to WineStaging-2.9 reactos/dll/win32/mciseq # Synced to WineStaging-2.9 reactos/dll/win32/mciwave # Synced to WineStaging-2.9 reactos/dll/win32/mgmtapi # Synced to WineStaging-2.9 -reactos/dll/win32/mlang # Synced to WineStaging-2.9 +reactos/dll/win32/mlang # Synced to Wine-3.0 reactos/dll/win32/mmdevapi # Synced to WineStaging-1.9.23 reactos/dll/win32/mpr # Synced to WineStaging-2.9 reactos/dll/win32/mprapi # Synced to WineStaging-2.9
6 years, 11 months
1
0
0
0
01/01: [TRANSLATION] Polish translation update (#284).
by Adam Słaboń
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=86908fc64734b2e6d4205…
commit 86908fc64734b2e6d42056aa37efcbfaa14db915 Author: Adam Słaboń <32551254+archeYR(a)users.noreply.github.com> AuthorDate: Fri Jan 12 00:55:08 2018 +0100 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Fri Jan 19 12:06:38 2018 +0100 [TRANSLATION] Polish translation update (#284). --- dll/cpl/desk/lang/pl-PL.rc | 8 ++++---- dll/cpl/sysdm/lang/pl-PL.rc | 22 +++++++++++----------- media/inf/hdaudbus.inf | 9 +++++++++ media/inf/input.inf | 11 ++++++++++- media/inf/legcydrv.inf | 4 ++++ media/inf/netrtl.inf | 3 +++ media/inf/usb.inf | 1 + media/inf/wmiacpi.inf | 7 +++++-- media/inf/xboxdisp.inf | 4 ++++ 9 files changed, 51 insertions(+), 18 deletions(-) diff --git a/dll/cpl/desk/lang/pl-PL.rc b/dll/cpl/desk/lang/pl-PL.rc index f6f59bd371..a108d91f0a 100644 --- a/dll/cpl/desk/lang/pl-PL.rc +++ b/dll/cpl/desk/lang/pl-PL.rc @@ -214,10 +214,10 @@ BEGIN IDS_CPLDESCRIPTION "Dostosowuje wygląd pulpitu oraz wygaszacze." IDS_NONE "(brak)" IDS_CENTER "Do środka" - IDS_STRETCH "Rozciągnięcie" + IDS_STRETCH "Rozciągnij" IDS_TILE "Sąsiadująco" - IDS_FIT "Fit" - IDS_FILL "Fill" + IDS_FIT "Dopasuj" + IDS_FILL "Wypełnij" END STRINGTABLE @@ -243,7 +243,7 @@ BEGIN IDS_MESSBOX "Okno komunikatu" IDS_MESSTEXT "Treść wiadomości" IDS_BUTTEXT "OK" - IDS_CLASSIC_THEME "Classic Theme" + IDS_CLASSIC_THEME "Motyw klasyczny" END STRINGTABLE diff --git a/dll/cpl/sysdm/lang/pl-PL.rc b/dll/cpl/sysdm/lang/pl-PL.rc index 6421937276..682d92eb15 100644 --- a/dll/cpl/sysdm/lang/pl-PL.rc +++ b/dll/cpl/sysdm/lang/pl-PL.rc @@ -95,12 +95,12 @@ BEGIN PUSHBUTTON "&Kopiuj", IDC_HRDPROFCOPY, 63, 106, 50, 14, WS_DISABLED PUSHBUTTON "Z&mień nazwę", IDC_HRDPROFRENAME, 118, 106, 50, 14, WS_DISABLED PUSHBUTTON "&Usuń", IDC_HRDPROFDEL, 173, 106, 50, 14, WS_DISABLED - GROUPBOX "Wybór profili sprzętu", IDC_STATIC, 7, 130, 240, 75 + GROUPBOX "Wybór profili sprzętu", IDC_STATIC, 7, 130, 240, 80 LTEXT "Podczas uruchamiania ReactOS:", IDC_STATIC, 14, 142, 210, 8 AUTORADIOBUTTON "&Czekaj na wybór profilu sprzętu przez użytkownika", IDC_HRDPROFWAIT, 14, 158, 175, 8, WS_GROUP - AUTORADIOBUTTON "&Wybierz &pierwszy profil na liście, jeżeli użytkownik nie wybierze profilu w ciągu", IDC_HRDPROFSELECT, 14, 173, 190, 8 - LTEXT "s", IDC_STATIC, 65, 187, 35, 8 - EDITTEXT IDC_HRDPROFEDIT, 25, 185, 35, 12 + AUTORADIOBUTTON "&Wybierz &pierwszy profil na liście, jeżeli użytkownik nie wybierze \nprofilu w ciągu", IDC_HRDPROFSELECT, 14, 173, 215, 15, BS_MULTILINE + LTEXT "s", IDC_STATIC, 65, 195, 35, 8 + EDITTEXT IDC_HRDPROFEDIT, 25, 193, 35, 12 CONTROL "", IDC_HRDPROFUPDWN, "msctls_updown32", UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | WS_CHILD | WS_VISIBLE, 25, 185, 7, 10 DEFPUSHBUTTON "OK", IDOK, 143, 213, 50, 14 @@ -159,7 +159,7 @@ CAPTION "Profile użytkownika" FONT 8, "MS Shell Dlg" BEGIN ICON IDI_USERPROF, IDC_STATIC, 6, 11, 16, 16, SS_ICON - LTEXT "Profile użytkownika przechowują ustawienia pulpitu oraz inne informacje związane z kontem użytkownika. Możesz utworzyć inny profil na każdym z używanych komputerów lub wybrać profil mobilny, który jest taki sam dla każdego z używanych komputerów.", IDC_STATIC, 40, 11, 204, 35 + LTEXT "Profile użytkownika przechowują ustawienia pulpitu oraz inne informacje związane z kontem użytkownika. Możesz utworzyć inny profil na każdym z używanych komputerów lub wybrać profil mobilny, który jest taki sam dla każdego z używanych komputerów.", IDC_STATIC, 40, 9, 214, 39 LTEXT "&Profile przechowywane na tym komputerze:", IDC_STATIC, 16, 51, 204, 9 CONTROL "", IDC_USERPROFILE_LIST, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SORTASCENDING | WS_BORDER | WS_TABSTOP, 6, 66, 244, 85, WS_EX_CLIENTEDGE @@ -180,16 +180,16 @@ BEGIN GROUPBOX "Uruchamianie systemu", IDC_STATIC, 7, 12, 238, 95 LTEXT "&Domyślny system operacyjny:", IDC_STATIC, 14, 26, 100, 8 COMBOBOX IDC_STRECOSCOMBO, 14, 37, 224, 46, CBS_DROPDOWNLIST | WS_VSCROLL - AUTOCHECKBOX "&Czas wyświetlania listy systemów operacyjnych:", IDC_STRECLIST, 14, 56, 150, 8 - EDITTEXT IDC_STRRECLISTEDIT, 179, 54, 30, 12, ES_NUMBER + AUTOCHECKBOX "&Czas wyświetlania listy systemów operacyjnych:", IDC_STRECLIST, 14, 56, 170, 8 + EDITTEXT IDC_STRRECLISTEDIT, 204, 54, 30, 12, ES_NUMBER CONTROL "", IDC_STRRECLISTUPDWN, "msctls_updown32", UDS_WRAP | UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | WS_CHILD | WS_VISIBLE, 0, 0, 8, 13 - LTEXT "s", IDC_STATIC, 215, 56, 25, 8 - AUTOCHECKBOX "Czas wyświetlania w razie potrzeby &opcji odzyskiwania:", IDC_STRRECREC, 14, 70, 163, 8 - EDITTEXT IDC_STRRECRECEDIT, 179, 68, 30, 12, ES_NUMBER + LTEXT "s", IDC_STATIC, 237, 56, 5, 8 + AUTOCHECKBOX "Czas wyświetlania w razie potrzeby &opcji odzyskiwania:", IDC_STRRECREC, 14, 70, 188, 8 + EDITTEXT IDC_STRRECRECEDIT, 204, 68, 30, 12, ES_NUMBER CONTROL "", IDC_STRRECRECUPDWN, "msctls_updown32", UDS_WRAP | UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | WS_CHILD | WS_VISIBLE, 0, 0, 8, 13 - LTEXT "s", IDC_STATIC, 215, 70, 25, 8 + LTEXT "s", IDC_STATIC, 237, 70, 5, 8 LTEXT "Aby ręcznie edytować plik opcji autostartu, kliknij przycisk Edytuj.", IDC_STATIC, 14, 89, 187, 8 PUSHBUTTON "&Edytuj", IDC_STRRECEDIT, 202, 87, 36, 14 GROUPBOX "Awaria systemu", IDC_STATIC, 7, 111, 238, 140 diff --git a/media/inf/hdaudbus.inf b/media/inf/hdaudbus.inf index 7ac3b70863..2d293fa0f7 100644 --- a/media/inf/hdaudbus.inf +++ b/media/inf/hdaudbus.inf @@ -70,6 +70,15 @@ MODEMFG = "Modem Device on High Definition Audio Bus" UNKNOWNFG = "Unknown Device on High Definition Audio Bus" HDAudioBUS = "Internal High Definition Audio Bus" +[Strings.0415] +DiskId1 = "Sterownik magistrali ReactOS UAA dla High Definition Audio. Dysk instalacyjny #1" +HDAudio.DeviceDesc = "Kontroler High Definition Audio" +HDAudBus.SVCDESC = "Sterownik magistrali ReactOS UAA dla High Definition Audio." +AUDIOFG = "Urządzenie audio na High Definition Audio Bus" +MODEMFG = "Urządzenie telefoniczne na High Definition Audio Bus" +UNKNOWNFG = "Nieznane urządzenie na High Definition Audio Bus" +HDAudioBUS = "Wewnętrzna magistrala High Definition Audio" + [Strings.0418] DiskId1 = "Modúl-pilot ReactOS de magistrală UAA pentru dispozitive audio de înaltă definiție. Disc de instalare №1" HDAudio.DeviceDesc = "Dispozitiv de control audio de înaltă definiție" diff --git a/media/inf/input.inf b/media/inf/input.inf index 91fdc0496f..97c4a796a8 100644 --- a/media/inf/input.inf +++ b/media/inf/input.inf @@ -82,7 +82,6 @@ HID_DEVICE = "HID-compatible Device" StdMfg = "(Standard Human Interface Devices)" MSMice = "Microsoft" - USB\VID_045E&PID_0009.DeviceDesc="Microsoft IntelliMouse (USB)" USB\VID_045E&PID_001E.DeviceDesc="Microsoft IntelliMouse Explorer (USB)" USB\VID_045E&PID_0023.DeviceDesc="Microsoft Trackball Optical (USB)" @@ -107,10 +106,20 @@ HID.DeviceDesc = "Dispositivos de interfaz humana USB" HID_DEVICE = "Dispositivo compatible con otros dispositivos de interfaz humana" StdMfg = "(Dispositivos de interfaz humana estándar)" +[Strings.0415] +ReactOS = "Ekipa ReactOS" +HID.ClassName = "Urządzenia interfejsu HID" +HID.DeviceDesc = "Urządzenie USB interfejsu HID" + +HID_DEVICE = "Urządzenie zgodne z HID" +StdMfg = "(Standardowe urządzenia HID)" +MSMice = "Microsoft" + [Strings.0418] ReactOS = "Echipa ReactOS" HID.ClassName = "Dispozitive de interfațare umană" HID.DeviceDesc = "Dispozitiv USB de interfațare umană" + HID_DEVICE = "Dispozitiv compatibil de interfațare umană" StdMfg = "(dispozitive generice de interfațare umană)" diff --git a/media/inf/legcydrv.inf b/media/inf/legcydrv.inf index 53ecbee286..37e88cb4df 100644 --- a/media/inf/legcydrv.inf +++ b/media/inf/legcydrv.inf @@ -31,6 +31,10 @@ LegacyDriverClassName = "Nicht-PnP Treiber" ReactOS = "Equipo de ReactOS" LegacyDriverClassName = "Controladores incompatibles con PnP" +[Strings.0415] +ReactOS = "Ekipa ReactOS" +LegacyDriverClassName = "Sterowniki niezgodne z Plug and Play" + [Strings.0418] ReactOS = "Echipa ReactOS" LegacyDriverClassName = "Modúle pilot de cuplare statică (non-PnP)" diff --git a/media/inf/netrtl.inf b/media/inf/netrtl.inf index 6072f83bee..4d8869701d 100644 --- a/media/inf/netrtl.inf +++ b/media/inf/netrtl.inf @@ -84,6 +84,9 @@ DLinkDFE538TX.DeviceDesc = "Adaptador Ethernet D-Link DFE-538TX (RTL8139)" LevelOneFPC0106TX.DeviceDesc = "Adaptador Ethernet LevelOne FPC-0106Tx (RTL8139)" CompaqHNE300.DeviceDesc = "Adaptador Ethernet Compaq HNE-300 (RTL8139C)" +[Strings.0415] +ReactOS = "Ekipa ReactOS" + [Strings.0418] ReactOS = "Echipa ReactOS" diff --git a/media/inf/usb.inf b/media/inf/usb.inf index ec96335955..8c1762fe6a 100644 --- a/media/inf/usb.inf +++ b/media/inf/usb.inf @@ -94,6 +94,7 @@ USB\CLASS_09.DeviceDesc = "標準 USBハブ" [Strings.0415] ReactOS = "Ekipa ReactOS" GenericMfg = "(Standardowy koncentrator USB)" +USB\COMPOSITE.DeviceDesc = "Urządzenie kompozytowe USB" USB\CLASS_09.DeviceDesc = "Standardowy koncentrator USB" [Strings.0416] diff --git a/media/inf/wmiacpi.inf b/media/inf/wmiacpi.inf index 0c8073d0de..70d2cd70f6 100644 --- a/media/inf/wmiacpi.inf +++ b/media/inf/wmiacpi.inf @@ -33,7 +33,6 @@ AddService = , 0x00000002 [Strings] ReactOS = "ReactOS Team" - GenericMfg = "(Generic system devices)" *PNP0C14.DeviceDesc = "WMI for ACPI" @@ -44,6 +43,11 @@ GenericMfg = "(Generická systémová zařízení)" GenericMfg = "(Generische Systemgeräte)" *PNP0C14.DeviceDesc = "WMI für ACPI" +[Strings.0415] +ReactOS = "Ekipa ReactOS" +GenericMfg = "(Standardowe urządzenia systemowe)" +*PNP0C14.DeviceDesc = "WMI dla ACPI" + [Strings.0418] ReactOS = "Echipa ReactOS" GenericMfg = "(dispozitive generice de sistem)" @@ -56,6 +60,5 @@ GenericMfg = "(Универсальные системные устройств [Strings.041f] ReactOS = "ReactOS Takımı" - GenericMfg = "(Umûmî Dizge Aygıtları)" *PNP0C14.DeviceDesc = "ACPI için WMI" diff --git a/media/inf/xboxdisp.inf b/media/inf/xboxdisp.inf index 19004e68f7..fa4547ac75 100644 --- a/media/inf/xboxdisp.inf +++ b/media/inf/xboxdisp.inf @@ -56,6 +56,10 @@ PCI\VEN_10DE&DEV_02A0.DeviceDesc = "NV2A Xbox Graphics Processing Unit" ReactOS = "Equipo de ReactOS" PCI\VEN_10DE&DEV_02A0.DeviceDesc = "Unidad de procesamiento de gráficos de Xbox NV2A" +[Strings.0415] +ReactOS = "Ekipa ReactOS" +PCI\VEN_10DE&DEV_02A0.DeviceDesc = "Procesor graficzny Xbox NV2A" + [Strings.0418] ReactOS = "Echipa ReactOS" nVidiaMfg = "Corporația nVidia"
6 years, 11 months
1
0
0
0
01/01: [JSCRIPT_WINETEST] Sync with Wine 3.0. CORE-14225
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=df52b0e7e28b25387fd87…
commit df52b0e7e28b25387fd87aad22d4e01ced556378 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Fri Jan 19 00:46:30 2018 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Fri Jan 19 00:46:30 2018 +0100 [JSCRIPT_WINETEST] Sync with Wine 3.0. CORE-14225 --- modules/rostests/winetests/jscript/run.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/modules/rostests/winetests/jscript/run.c b/modules/rostests/winetests/jscript/run.c index 9d9f4af85c..05fea3b111 100644 --- a/modules/rostests/winetests/jscript/run.c +++ b/modules/rostests/winetests/jscript/run.c @@ -1322,7 +1322,7 @@ static HRESULT WINAPI Global_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, return S_OK; case DISPID_GLOBAL_TESTARGTYPES: { - VARIANT args[7], v; + VARIANT args[8], v; DISPPARAMS dp = {args, NULL, sizeof(args)/sizeof(*args), 0}; HRESULT hres; @@ -1364,6 +1364,8 @@ static HRESULT WINAPI Global_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, V_VARIANTREF(args+5) = &v; V_VT(args+6) = VT_R4; V_R4(args+6) = 0.5; + V_VT(args+7) = VT_UI2; + V_R4(args+7) = 3; V_VT(&v) = VT_I4; V_I4(&v) = 2; hres = IDispatch_Invoke(V_DISPATCH(pdp->rgvarg), DISPID_VALUE, &IID_NULL, 0, DISPATCH_METHOD, &dp, NULL, NULL, NULL); @@ -2152,6 +2154,8 @@ static HRESULT parse_script_expr(const char *expr, VARIANT *res, IActiveScript * HRESULT hres; engine = create_script(); + if(!engine) + return E_FAIL; hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParse, (void**)&parser); ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres); @@ -2196,6 +2200,8 @@ static void test_retval(void) HRESULT hres; engine = create_script(); + if(!engine) + return; hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParse, (void**)&parser); ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres); @@ -2654,7 +2660,7 @@ static BOOL run_tests(void) SET_EXPECT(global_testargtypes_i); parse_script_a("testArgTypes(dispUnk, intProp(), intProp, getShort(), shortProp," - "function(r4,i4ref,ui4,nullunk,d,i,s) {" + "function(ui2,r4,i4ref,ui4,nullunk,d,i,s) {" " ok(getVT(i) === 'VT_I4', 'getVT(i) = ' + getVT(i));" " ok(getVT(s) === 'VT_I4', 'getVT(s) = ' + getVT(s));" " ok(getVT(d) === 'VT_DISPATCH', 'getVT(d) = ' + getVT(d));" @@ -2666,6 +2672,7 @@ static BOOL run_tests(void) " ok(i4ref === 2, 'i4ref = ' + i4ref);" " ok(r4 === 0.5, 'r4 = ' + r4);" " ok(getVT(r4) === 'VT_R8', 'getVT(r4) = ' + getVT(r4));" + " ok(getVT(ui2) === 'VT_I4', 'getVT(ui2) = ' + getVT(ui2));" "});"); CHECK_CALLED(global_testargtypes_i);
6 years, 11 months
1
0
0
0
01/01: [JSCRIPT] Sync with Wine 3.0. CORE-14225
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=3381ee4b89c4f15e09e6b…
commit 3381ee4b89c4f15e09e6b7b3384bdb7b482a42a2 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Fri Jan 19 00:45:08 2018 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Fri Jan 19 00:45:08 2018 +0100 [JSCRIPT] Sync with Wine 3.0. CORE-14225 --- dll/win32/jscript/compile.c | 7 ++++--- dll/win32/jscript/dispex.c | 4 ++++ dll/win32/jscript/engine.c | 32 +++++++++++++------------------- dll/win32/jscript/jsutils.c | 10 ++++++++++ media/doc/README.WINE | 2 +- 5 files changed, 32 insertions(+), 23 deletions(-) diff --git a/dll/win32/jscript/compile.c b/dll/win32/jscript/compile.c index 7afbf01586..b9dff8fe30 100644 --- a/dll/win32/jscript/compile.c +++ b/dll/win32/jscript/compile.c @@ -1867,12 +1867,13 @@ static BOOL alloc_variable(compiler_ctx_t *ctx, const WCHAR *name) return alloc_local(ctx, ident, ctx->func->var_cnt++); } -static BOOL visit_function_expression(compiler_ctx_t *ctx, function_expression_t *expr) +static HRESULT visit_function_expression(compiler_ctx_t *ctx, function_expression_t *expr) { expr->func_id = ctx->func->func_cnt++; ctx->func_tail = ctx->func_tail ? (ctx->func_tail->next = expr) : (ctx->func_head = expr); - return !expr->identifier || expr->event_target || alloc_variable(ctx, expr->identifier); + return !expr->identifier || expr->event_target || alloc_variable(ctx, expr->identifier) + ? S_OK : E_OUTOFMEMORY; } static HRESULT visit_expression(compiler_ctx_t *ctx, expression_t *expr) @@ -1985,7 +1986,7 @@ static HRESULT visit_expression(compiler_ctx_t *ctx, expression_t *expr) break; } case EXPR_FUNC: - visit_function_expression(ctx, (function_expression_t*)expr); + hres = visit_function_expression(ctx, (function_expression_t*)expr); break; case EXPR_MEMBER: hres = visit_expression(ctx, ((member_expression_t*)expr)->expression); diff --git a/dll/win32/jscript/dispex.c b/dll/win32/jscript/dispex.c index a6c14d6c1b..8bc03d1662 100644 --- a/dll/win32/jscript/dispex.c +++ b/dll/win32/jscript/dispex.c @@ -1096,6 +1096,8 @@ HRESULT disp_call(script_ctx_t *ctx, IDispatch *disp, DISPID id, WORD flags, uns return E_FAIL; } + if(ctx != jsdisp->ctx) + flags &= ~DISPATCH_JSCRIPT_INTERNAL_MASK; hres = jsdisp_call(jsdisp, id, flags, argc, argv, ret); jsdisp_release(jsdisp); return hres; @@ -1184,6 +1186,8 @@ HRESULT disp_call_value(script_ctx_t *ctx, IDispatch *disp, IDispatch *jsthis, W jsdisp = iface_to_jsdisp(disp); if(jsdisp) { + if(ctx != jsdisp->ctx) + flags &= ~DISPATCH_JSCRIPT_INTERNAL_MASK; hres = jsdisp_call_value(jsdisp, jsthis, flags, argc, argv, r); jsdisp_release(jsdisp); return hres; diff --git a/dll/win32/jscript/engine.c b/dll/win32/jscript/engine.c index a731930fd8..16fe6aaeae 100644 --- a/dll/win32/jscript/engine.c +++ b/dll/win32/jscript/engine.c @@ -18,8 +18,6 @@ #include "jscript.h" -WINE_DECLARE_DEBUG_CHANNEL(jscript_except); - static const WCHAR booleanW[] = {'b','o','o','l','e','a','n',0}; static const WCHAR functionW[] = {'f','u','n','c','t','i','o','n',0}; static const WCHAR numberW[] = {'n','u','m','b','e','r',0}; @@ -2661,29 +2659,27 @@ static void print_backtrace(script_ctx_t *ctx) call_frame_t *frame; for(frame = ctx->call_ctx; frame; frame = frame->prev_frame) { - TRACE_(jscript_except)("%u\t", depth); + WARN("%u\t", depth); depth++; if(frame->this_obj && frame->this_obj != to_disp(ctx->global) && frame->this_obj != ctx->host_global) - TRACE_(jscript_except)("%p->", frame->this_obj); - TRACE_(jscript_except)("%s(", frame->function->name ? debugstr_w(frame->function->name) : "[unnamed]"); + WARN("%p->", frame->this_obj); + WARN("%s(", frame->function->name ? debugstr_w(frame->function->name) : "[unnamed]"); if(frame->base_scope && frame->base_scope->frame) { for(i=0; i < frame->argc; i++) { if(i < frame->function->param_cnt) - TRACE_(jscript_except)("%s%s=%s", i ? ", " : "", - debugstr_w(frame->function->params[i]), - debugstr_jsval(ctx->stack[local_off(frame, -i-1)])); + WARN("%s%s=%s", i ? ", " : "", debugstr_w(frame->function->params[i]), + debugstr_jsval(ctx->stack[local_off(frame, -i-1)])); else - TRACE_(jscript_except)("%s%s", i ? ", " : "", - debugstr_jsval(ctx->stack[local_off(frame, -i-1)])); + WARN("%s%s", i ? ", " : "", debugstr_jsval(ctx->stack[local_off(frame, -i-1)])); } }else { - TRACE_(jscript_except)("[detached frame]"); + WARN("[detached frame]"); } - TRACE_(jscript_except)(")\n"); + WARN(")\n"); if(!(frame->flags & EXEC_RETURN_TO_INTERP)) { - TRACE_(jscript_except)("%u\t[native code]\n", depth); + WARN("%u\t[native code]\n", depth); depth++; } } @@ -2697,26 +2693,24 @@ static HRESULT unwind_exception(script_ctx_t *ctx, HRESULT exception_hres) unsigned catch_off; HRESULT hres; - TRACE("%08x\n", exception_hres); - - if(TRACE_ON(jscript_except)) { + if(WARN_ON(jscript)) { jsdisp_t *error_obj; jsval_t msg; static const WCHAR messageW[] = {'m','e','s','s','a','g','e',0}; - TRACE_(jscript_except)("Exception %08x %s", exception_hres, debugstr_jsval(ctx->ei.val)); + WARN("Exception %08x %s", exception_hres, debugstr_jsval(ctx->ei.val)); if(jsval_type(ctx->ei.val) == JSV_OBJECT) { error_obj = to_jsdisp(get_object(ctx->ei.val)); if(error_obj) { hres = jsdisp_propget_name(error_obj, messageW, &msg); if(SUCCEEDED(hres)) { - TRACE_(jscript_except)(" (message %s)", debugstr_jsval(msg)); + WARN(" (message %s)", debugstr_jsval(msg)); jsval_release(msg); } } } - TRACE_(jscript_except)(" in:\n"); + WARN(" in:\n"); print_backtrace(ctx); } diff --git a/dll/win32/jscript/jsutils.c b/dll/win32/jscript/jsutils.c index 20b30f0d71..fb691afe8d 100644 --- a/dll/win32/jscript/jsutils.c +++ b/dll/win32/jscript/jsutils.c @@ -287,12 +287,22 @@ HRESULT variant_to_jsval(VARIANT *var, jsval_t *r) case VT_I2: *r = jsval_number(V_I2(var)); return S_OK; + case VT_UI2: + *r = jsval_number(V_UI2(var)); + return S_OK; case VT_INT: *r = jsval_number(V_INT(var)); return S_OK; case VT_UI4: *r = jsval_number(V_UI4(var)); return S_OK; + case VT_UI8: + /* + * Native doesn't support VT_UI8 here, but it's needed for IE9+ APIs + * (native IE9 doesn't use jscript.dll for JavaScript). + */ + *r = jsval_number(V_UI8(var)); + return S_OK; case VT_R4: *r = jsval_number(V_R4(var)); return S_OK; diff --git a/media/doc/README.WINE b/media/doc/README.WINE index 52792aaca6..13f6bdd797 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -85,7 +85,7 @@ reactos/dll/win32/inseng # Synced to Wine-3.0 reactos/dll/win32/iphlpapi # Out of sync reactos/dll/win32/itircl # Synced to WineStaging-2.9 reactos/dll/win32/itss # Synced to Wine-3.0 -reactos/dll/win32/jscript # Synced to WineStaging-2.16 +reactos/dll/win32/jscript # Synced to Wine-3.0 reactos/dll/win32/jsproxy # Synced to WineStaging-2.16 reactos/dll/win32/loadperf # Synced to WineStaging-2.9 reactos/dll/win32/lz32 # Synced to WineStaging-2.9
6 years, 11 months
1
0
0
0
01/01: [ITSS] Sync with Wine 3.0. CORE-14225
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=08fb1fc8febb7128c2a28…
commit 08fb1fc8febb7128c2a28e397c1dd07086c6a5ef Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Fri Jan 19 00:43:54 2018 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Fri Jan 19 00:43:54 2018 +0100 [ITSS] Sync with Wine 3.0. CORE-14225 --- dll/win32/itss/chm_lib.c | 13 ++++--------- media/doc/README.WINE | 2 +- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/dll/win32/itss/chm_lib.c b/dll/win32/itss/chm_lib.c index e1d50342c6..12ba5fd0f2 100644 --- a/dll/win32/itss/chm_lib.c +++ b/dll/win32/itss/chm_lib.c @@ -922,15 +922,10 @@ static UInt64 _chm_parse_cword(UChar **pEntry) /* parse a utf-8 string into an ASCII char buffer */ static BOOL _chm_parse_UTF8(UChar **pEntry, UInt64 count, WCHAR *path) { - /* MJM - Modified to return real Unicode strings */ - while (count != 0) - { - *path++ = (*(*pEntry)++); - --count; - } - - *path = '\0'; - return TRUE; + DWORD length = MultiByteToWideChar(CP_UTF8, 0, (char *)*pEntry, count, path, CHM_MAX_PATHLEN); + path[length] = '\0'; + *pEntry += count; + return !!length; } /* parse a PMGL entry into a chmUnitInfo struct; return 1 on success. */ diff --git a/media/doc/README.WINE b/media/doc/README.WINE index 2e3b15e1d6..52792aaca6 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -84,7 +84,7 @@ reactos/dll/win32/initpki # Synced to WineStaging-2.9 reactos/dll/win32/inseng # Synced to Wine-3.0 reactos/dll/win32/iphlpapi # Out of sync reactos/dll/win32/itircl # Synced to WineStaging-2.9 -reactos/dll/win32/itss # Synced to WineStaging-2.9 +reactos/dll/win32/itss # Synced to Wine-3.0 reactos/dll/win32/jscript # Synced to WineStaging-2.16 reactos/dll/win32/jsproxy # Synced to WineStaging-2.16 reactos/dll/win32/loadperf # Synced to WineStaging-2.9
6 years, 11 months
1
0
0
0
01/01: [INSENG] Sync with Wine 3.0. CORE-14225
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=31fbc03b8683e1c93c04f…
commit 31fbc03b8683e1c93c04f22b806b692482d6ba66 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Fri Jan 19 00:42:56 2018 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Fri Jan 19 00:42:56 2018 +0100 [INSENG] Sync with Wine 3.0. CORE-14225 --- dll/win32/inseng/CMakeLists.txt | 8 +- dll/win32/inseng/guid.c | 15 - dll/win32/inseng/icif.c | 1726 ------------------------------------- dll/win32/inseng/inf.c | 434 ---------- dll/win32/inseng/inseng.spec | 4 +- dll/win32/inseng/inseng_main.c | 1010 ++-------------------- dll/win32/inseng/inseng_private.h | 110 --- media/doc/README.WINE | 2 +- 8 files changed, 69 insertions(+), 3240 deletions(-) diff --git a/dll/win32/inseng/CMakeLists.txt b/dll/win32/inseng/CMakeLists.txt index fd0d3c8383..7df9dd96ab 100644 --- a/dll/win32/inseng/CMakeLists.txt +++ b/dll/win32/inseng/CMakeLists.txt @@ -7,16 +7,12 @@ include_directories(${REACTOS_SOURCE_DIR}/sdk/include/reactos/wine) spec2def(inseng.dll inseng.spec) list(APPEND SOURCE - icif.c - inf.c inseng_main.c - inseng_private.h ${CMAKE_CURRENT_BINARY_DIR}/inseng_stubs.c ${CMAKE_CURRENT_BINARY_DIR}/inseng.def) -add_library(inseng SHARED ${SOURCE} guid.c inseng.rc) +add_library(inseng SHARED ${SOURCE} inseng.rc) set_module_type(inseng win32dll) target_link_libraries(inseng uuid wine) -add_importlibs(inseng ole32 urlmon kernel32_vista msvcrt kernel32 ntdll) -add_pch(inseng inseng_private.h SOURCE) +add_importlibs(inseng ole32 advapi32 msvcrt kernel32 ntdll) add_cd_file(TARGET inseng DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/inseng/guid.c b/dll/win32/inseng/guid.c deleted file mode 100644 index cb44059951..0000000000 --- a/dll/win32/inseng/guid.c +++ /dev/null @@ -1,15 +0,0 @@ -/* DO NOT USE THE PRECOMPILED HEADER FOR THIS FILE! */ - -#include <stdarg.h> - -#define WIN32_NO_STATUS -#define _INC_WINDOWS -#define COM_NO_WINDOWS_H - -#include <windef.h> -#include <winbase.h> -#include <objbase.h> -#include <initguid.h> -#include <inseng.h> - -/* NO CODE HERE, THIS IS JUST REQUIRED FOR THE GUID DEFINITIONS */ diff --git a/dll/win32/inseng/icif.c b/dll/win32/inseng/icif.c deleted file mode 100644 index b9d5227610..0000000000 --- a/dll/win32/inseng/icif.c +++ /dev/null @@ -1,1726 +0,0 @@ -/* - * Copyright 2016 Michael Müller - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#include "inseng_private.h" - -#define DEFAULT_INSTALLER_DESC "Active Setup Installation" - -struct cifgroup -{ - ICifGroup ICifGroup_iface; - - struct list entry; - - ICifFile *parent; - - char *id; - char *description; - DWORD priority; -}; - -struct ciffenum_components -{ - IEnumCifComponents IEnumCifComponents_iface; - LONG ref; - - ICifFile *file; - struct list *start; - struct list *position; - - char *group_id; -}; - -struct ciffenum_groups -{ - IEnumCifGroups IEnumCifGroups_iface; - LONG ref; - - ICifFile *file; - struct list *start; - struct list *position; -}; - -struct url_info -{ - struct list entry; - INT index; - char *url; - DWORD flags; -}; - -struct dependency_info -{ - struct list entry; - char *id; - char *type; -}; - -struct cifcomponent -{ - ICifComponent ICifComponent_iface; - - struct list entry; - - ICifFile *parent; - - char *id; - char *guid; - char *description; - char *details; - char *group; - - - DWORD version; - DWORD build; - char *patchid; - - char *locale; - char *key_uninstall; - - DWORD size_win; - DWORD size_app; - DWORD size_download; - DWORD size_extracted; - - char *key_success; - char *key_progress; - char *key_cancel; - - DWORD as_aware; - DWORD reboot; - DWORD admin; - DWORD visibleui; - - DWORD priority; - DWORD platform; - - struct list dependencies; - struct list urls; - - /* mode */ - /* det version */ - /* one component */ - /* custom data */ - - /* in memory state */ - DWORD queue_state; - DWORD current_priority; - DWORD size_actual_download; - BOOL downloaded; - BOOL installed; -}; - -struct ciffile -{ - ICifFile ICifFile_iface; - LONG ref; - - struct list components; - struct list groups; - - char *name; -}; - -static inline struct ciffile *impl_from_ICiffile(ICifFile *iface) -{ - return CONTAINING_RECORD(iface, struct ciffile, ICifFile_iface); -} - -static inline struct cifcomponent *impl_from_ICifComponent(ICifComponent *iface) -{ - return CONTAINING_RECORD(iface, struct cifcomponent, ICifComponent_iface); -} - -static inline struct cifgroup *impl_from_ICifGroup(ICifGroup *iface) -{ - return CONTAINING_RECORD(iface, struct cifgroup, ICifGroup_iface); -} - -static inline struct ciffenum_components *impl_from_IEnumCifComponents(IEnumCifComponents *iface) -{ - return CONTAINING_RECORD(iface, struct ciffenum_components, IEnumCifComponents_iface); -} - -static inline struct ciffenum_groups *impl_from_IEnumCifGroups(IEnumCifGroups *iface) -{ - return CONTAINING_RECORD(iface, struct ciffenum_groups, IEnumCifGroups_iface); -} - -static HRESULT enum_components_create(ICifFile *file, struct list *start, char *group_id, IEnumCifComponents **iface); - -static HRESULT copy_substring_null(char *dest, int max_len, char *src) -{ - if (!src) - return E_FAIL; - - if (max_len <= 0) - return S_OK; - - if (!dest) - return E_FAIL; - - while (*src && max_len-- > 1) - *dest++ = *src++; - *dest = 0; - - return S_OK; -} - -static void url_entry_free(struct url_info *url) -{ - heap_free(url->url); - heap_free(url); -} - -static void dependency_entry_free(struct dependency_info *dependency) -{ - heap_free(dependency->id); - heap_free(dependency); -} - -static void component_free(struct cifcomponent *comp) -{ - struct dependency_info *dependency, *dependency_next; - struct url_info *url, *url_next; - - heap_free(comp->id); - heap_free(comp->guid); - heap_free(comp->description); - heap_free(comp->details); - heap_free(comp->group); - - heap_free(comp->patchid); - - heap_free(comp->locale); - heap_free(comp->key_uninstall); - - heap_free(comp->key_success); - heap_free(comp->key_progress); - heap_free(comp->key_cancel); - - LIST_FOR_EACH_ENTRY_SAFE(dependency, dependency_next, &comp->dependencies, struct dependency_info, entry) - { - list_remove(&dependency->entry); - dependency_entry_free(dependency); - } - - LIST_FOR_EACH_ENTRY_SAFE(url, url_next, &comp->urls, struct url_info, entry) - { - list_remove(&url->entry); - url_entry_free(url); - } - - heap_free(comp); -} - -static void group_free(struct cifgroup *group) -{ - heap_free(group->id); - heap_free(group->description); - heap_free(group); -} - -static HRESULT WINAPI group_GetID(ICifGroup *iface, char *id, DWORD size) -{ - struct cifgroup *This = impl_from_ICifGroup(iface); - - TRACE("(%p)->(%p, %u)\n", This, id, size); - - return copy_substring_null(id, size, This->id); -} - -static HRESULT WINAPI group_GetDescription(ICifGroup *iface, char *desc, DWORD size) -{ - struct cifgroup *This = impl_from_ICifGroup(iface); - - TRACE("(%p)->(%p, %u)\n", This, desc, size); - - return copy_substring_null(desc, size, This->description); -} - -static DWORD WINAPI group_GetPriority(ICifGroup *iface) -{ - struct cifgroup *This = impl_from_ICifGroup(iface); - - TRACE("(%p)\n", This); - - return This->priority; -} - -static HRESULT WINAPI group_EnumComponents(ICifGroup *iface, IEnumCifComponents **enum_components, DWORD filter, LPVOID pv) -{ - struct cifgroup *This = impl_from_ICifGroup(iface); - struct ciffile *file; - - TRACE("(%p)->(%p, %u, %p)\n", This, enum_components, filter, pv); - - if (filter) - FIXME("filter (%x) not supported\n", filter); - if (pv) - FIXME("how to handle pv (%p)?\n", pv); - - file = impl_from_ICiffile(This->parent); - return enum_components_create(This->parent, &file->components, This->id, enum_components); -} - -static DWORD WINAPI group_GetCurrentPriority(ICifGroup *iface) -{ - struct cifgroup *This = impl_from_ICifGroup(iface); - - FIXME("(%p): stub\n", This); - - return 0; -} - -static const ICifGroupVtbl cifgroupVtbl = -{ - group_GetID, - group_GetDescription, - group_GetPriority, - group_EnumComponents, - group_GetCurrentPriority, -}; - -void component_set_actual_download_size(ICifComponent *iface, DWORD size) -{ - struct cifcomponent *This = impl_from_ICifComponent(iface); - - This->size_actual_download = size; -} - -void component_set_downloaded(ICifComponent *iface, BOOL value) -{ - struct cifcomponent *This = impl_from_ICifComponent(iface); - - This->downloaded = value; -} - -void component_set_installed(ICifComponent *iface, BOOL value) -{ - struct cifcomponent *This = impl_from_ICifComponent(iface); - - This->installed = value; -} - -char *component_get_id(ICifComponent *iface) -{ - struct cifcomponent *This = impl_from_ICifComponent(iface); - - return This->id; -} - -static HRESULT WINAPI component_GetID(ICifComponent *iface, char *id, DWORD size) -{ - struct cifcomponent *This = impl_from_ICifComponent(iface); - - TRACE("(%p)->(%p, %u)\n", This, id, size); - - return copy_substring_null(id, size, This->id); -} - -static HRESULT WINAPI component_GetGUID(ICifComponent *iface, char *guid, DWORD size) -{ - struct cifcomponent *This = impl_from_ICifComponent(iface); - - TRACE("(%p)->(%p, %u)\n", This, guid, size); - - return copy_substring_null(guid, size, This->guid); -} - -static HRESULT WINAPI component_GetDescription(ICifComponent *iface, char *desc, DWORD size) -{ - struct cifcomponent *This = impl_from_ICifComponent(iface); - - TRACE("(%p)->(%p, %u)\n", This, desc, size); - - return copy_substring_null(desc, size, This->description); -} - -static HRESULT WINAPI component_GetDetails(ICifComponent *iface, char *details, DWORD size) -{ - struct cifcomponent *This = impl_from_ICifComponent(iface); - - TRACE("(%p)->(%p, %u)\n", This, details, size); - - return copy_substring_null(details, size, This->details); -} - -static HRESULT WINAPI component_GetUrl(ICifComponent *iface, UINT index, char *url, DWORD size, DWORD *flags) -{ - struct cifcomponent *This = impl_from_ICifComponent(iface); - struct url_info *entry; - - TRACE("(%p)->(%u, %p, %u, %p)\n", This, index, url, size, flags); - - /* FIXME: check how functions behaves for url == NULL */ - - if (!flags) - return E_FAIL; - - LIST_FOR_EACH_ENTRY(entry, &This->urls, struct url_info, entry) - { - if (entry->index != index) - continue; - - *flags = entry->flags; - return copy_substring_null(url, size, entry->url); - } - - return E_FAIL; -} - -static HRESULT WINAPI component_GetFileExtractList(ICifComponent *iface, UINT index, char *list, DWORD size) -{ - struct cifcomponent *This = impl_from_ICifComponent(iface); - - FIXME("(%p)->(%u, %p, %u): stub\n", This, index, list, size); - - return E_NOTIMPL; -} - -static HRESULT WINAPI component_GetUrlCheckRange(ICifComponent *iface, UINT index, DWORD *min, DWORD *max) -{ - struct cifcomponent *This = impl_from_ICifComponent(iface); - - FIXME("(%p)->(%u, %p, %p): stub\n", This, index, min, max); - - return E_NOTIMPL; -} - -static HRESULT WINAPI component_GetCommand(ICifComponent *iface, UINT index, char *cmd, DWORD cmd_size, char *switches, DWORD switch_size, DWORD *type) -{ - struct cifcomponent *This = impl_from_ICifComponent(iface); - - FIXME("(%p)->(%u, %p, %u, %p, %u, %p): stub\n", This, index, cmd, cmd_size, switches, switch_size, type); - - return E_NOTIMPL; -} - -static HRESULT WINAPI component_GetVersion(ICifComponent *iface, DWORD *version, DWORD *build) -{ - struct cifcomponent *This = impl_from_ICifComponent(iface); - - TRACE("(%p)->(%p, %p)\n", This, version, build); - - if (!version || !build) - return E_FAIL; - - *version = This->version; - *build = This->build; - - return S_OK; -} - -static HRESULT WINAPI component_GetLocale(ICifComponent *iface, char *locale, DWORD size) -{ - struct cifcomponent *This = impl_from_ICifComponent(iface); - - TRACE("(%p)->(%p, %u)\n", This, locale, size); - - return copy_substring_null(locale, size, This->locale); -} - -static HRESULT WINAPI component_GetUninstallKey(ICifComponent *iface, char *key, DWORD size) -{ - struct cifcomponent *This = impl_from_ICifComponent(iface); - - TRACE("(%p)->(%p, %u)\n", This, key, size); - - return copy_substring_null(key, size, This->key_uninstall); -} - -static HRESULT WINAPI component_GetInstalledSize(ICifComponent *iface, DWORD *win, DWORD *app) -{ - struct cifcomponent *This = impl_from_ICifComponent(iface); - - TRACE("(%p)->(%p, %p)\n", This, win, app); - - if (!win || !app) - return E_FAIL; - - *win = This->size_win; - *app = This->size_app; - - return S_OK; -} - -static DWORD WINAPI component_GetDownloadSize(ICifComponent *iface) -{ - struct cifcomponent *This = impl_from_ICifComponent(iface); - - TRACE("(%p)\n", This); - - return This->size_download; -} - -static DWORD WINAPI component_GetExtractSize(ICifComponent *iface) -{ - struct cifcomponent *This = impl_from_ICifComponent(iface); - - TRACE("(%p)\n", This); - - return This->size_extracted; -} - -static HRESULT WINAPI component_GetSuccessKey(ICifComponent *iface, char *key, DWORD size) -{ - struct cifcomponent *This = impl_from_ICifComponent(iface); - - TRACE("(%p)->(%p, %u)\n", This, key, size); - - return copy_substring_null(key, size, This->key_success); -} - -static HRESULT WINAPI component_GetProgressKeys(ICifComponent *iface, char *progress, DWORD progress_size, - char *cancel, DWORD cancel_size) -{ - struct cifcomponent *This = impl_from_ICifComponent(iface); - HRESULT hr; - - TRACE("(%p)->(%p, %u, %p, %u): semi-stub\n", This, progress, progress_size, cancel, cancel_size); - - hr = copy_substring_null(progress, progress_size, This->key_progress); - if (hr != S_OK) return hr; - - if (cancel_size > 0 && cancel) - *cancel = 0; - - return S_OK; -} - -static HRESULT WINAPI component_IsActiveSetupAware(ICifComponent *iface) -{ - struct cifcomponent *This = impl_from_ICifComponent(iface); - - TRACE("(%p)\n", This); - - return This->as_aware ? S_OK : S_FALSE; -} - -static HRESULT WINAPI component_IsRebootRequired(ICifComponent *iface) -{ - struct cifcomponent *This = impl_from_ICifComponent(iface); - - TRACE("(%p)\n", This); - - return This->reboot ? S_OK : S_FALSE; -} - -static HRESULT WINAPI component_RequiresAdminRights(ICifComponent *iface) -{ - struct cifcomponent *This = impl_from_ICifComponent(iface); - - TRACE("(%p)\n", This); - - return This->admin ? S_OK : S_FALSE; -} - -static DWORD WINAPI component_GetPriority(ICifComponent *iface) -{ - struct cifcomponent *This = impl_from_ICifComponent(iface); - - TRACE("(%p)\n", This); - - return This->priority; -} - -static HRESULT WINAPI component_GetDependency(ICifComponent *iface, UINT index, char *id, DWORD id_size, char *type, DWORD *ver, DWORD *build) -{ - struct cifcomponent *This = impl_from_ICifComponent(iface); - struct dependency_info *entry; - ICifComponent *dependency; - int pos = 0; - - TRACE("(%p)->(%u, %p, %u, %p, %p, %p)\n", This, index, id, id_size, type, ver, build); - - if (!id || !ver || !build) - return E_FAIL; - - LIST_FOR_EACH_ENTRY(entry, &This->dependencies, struct dependency_info, entry) - { - if (pos++ < index) - continue; - - if (ICifFile_FindComponent(This->parent, entry->id, &dependency) == S_OK) - { - ICifComponent_GetVersion(dependency, ver, build); - } - else - { - *ver = -1; - *build = -1; - } - - if (entry->type) - *type = *entry->type; - else - *type = 'I'; - - return copy_substring_null(id, id_size, entry->id); - } - - return E_FAIL; -} - -static DWORD WINAPI component_GetPlatform(ICifComponent *iface) -{ - struct cifcomponent *This = impl_from_ICifComponent(iface); - - TRACE("(%p)\n", This); - - return This->platform; -} - -static HRESULT WINAPI component_GetMode(ICifComponent *iface, UINT index, char *mode, DWORD size) -{ - struct cifcomponent *This = impl_from_ICifComponent(iface); - - FIXME("(%p)->(%u, %p, %u): stub\n", This, index, mode, size); - - return E_NOTIMPL; -} - -static HRESULT WINAPI component_GetGroup(ICifComponent *iface, char *id, DWORD size) -{ - struct cifcomponent *This = impl_from_ICifComponent(iface); - - TRACE("(%p)->(%p, %u)\n", This, id, size); - - return copy_substring_null(id, size, This->group); -} - -static HRESULT WINAPI component_IsUIVisible(ICifComponent *iface) -{ - struct cifcomponent *This = impl_from_ICifComponent(iface); - - TRACE("(%p)\n", This); - - return This->visibleui ? S_OK : S_FALSE; -} - -static HRESULT WINAPI component_GetPatchID(ICifComponent *iface, char *id, DWORD size) -{ - struct cifcomponent *This = impl_from_ICifComponent(iface); - - TRACE("(%p)->(%p, %u)\n", This, id, size); - - return copy_substring_null(id, size, This->patchid); -} - -static HRESULT WINAPI component_GetDetVersion(ICifComponent *iface, char *dll, DWORD dll_size, char *entry, DWORD entry_size) -{ - struct cifcomponent *This = impl_from_ICifComponent(iface); - - FIXME("(%p)->(%p, %u, %p, %u): stub\n", This, dll, dll_size, entry, entry_size); - - return E_NOTIMPL; -} - -static HRESULT WINAPI component_GetTreatAsOneComponents(ICifComponent *iface, UINT index, char *id, DWORD size) -{ - struct cifcomponent *This = impl_from_ICifComponent(iface); - - FIXME("(%p)->(%u, %p, %u): stub\n", This, index, id, size); - - return E_NOTIMPL; -} - -static HRESULT WINAPI component_GetCustomData(ICifComponent *iface, char *key, char *data, DWORD size) -{ - struct cifcomponent *This = impl_from_ICifComponent(iface); - - FIXME("(%p)->(%s, %p, %u): stub\n", This, debugstr_a(key), data, size); - - return E_NOTIMPL; -} - -static DWORD WINAPI component_IsComponentInstalled(ICifComponent *iface) -{ - struct cifcomponent *This = impl_from_ICifComponent(iface); - - TRACE("(%p)\n", This); - - return This->installed; -} - -static HRESULT WINAPI component_IsComponentDownloaded(ICifComponent *iface) -{ - struct cifcomponent *This = impl_from_ICifComponent(iface); - - TRACE("(%p)\n", This); - - return This->downloaded ? S_OK : S_FALSE; -} - -static DWORD WINAPI component_IsThisVersionInstalled(ICifComponent *iface, DWORD version, DWORD build, DWORD *ret_version, DWORD *ret_build) -{ - struct cifcomponent *This = impl_from_ICifComponent(iface); - - FIXME("(%p)->(%u, %u, %p, %p): stub\n", This, version, build, ret_version, ret_build); - - return 0; -} - -static DWORD WINAPI component_GetInstallQueueState(ICifComponent *iface) -{ - struct cifcomponent *This = impl_from_ICifComponent(iface); - - TRACE("(%p)\n", This); - - return This->queue_state; -} - -static HRESULT WINAPI component_SetInstallQueueState(ICifComponent *iface, DWORD state) -{ - struct cifcomponent *This = impl_from_ICifComponent(iface); - - TRACE("(%p)->(%u)\n", This, state); - - This->queue_state = state; - return S_OK; -} - -static DWORD WINAPI component_GetActualDownloadSize(ICifComponent *iface) -{ - struct cifcomponent *This = impl_from_ICifComponent(iface); - - TRACE("(%p)\n", This); - - return This->size_download; -} - -static DWORD WINAPI component_GetCurrentPriority(ICifComponent *iface) -{ - struct cifcomponent *This = impl_from_ICifComponent(iface); - - TRACE("(%p)\n", This); - - return This->current_priority; -} - - -static HRESULT WINAPI component_SetCurrentPriority(ICifComponent *iface, DWORD priority) -{ - struct cifcomponent *This = impl_from_ICifComponent(iface); - - TRACE("(%p)->(%u)\n", This, priority); - - This->current_priority = priority; - return S_OK; -} - -static const ICifComponentVtbl cifcomponentVtbl = -{ - component_GetID, - component_GetGUID, - component_GetDescription, - component_GetDetails, - component_GetUrl, - component_GetFileExtractList, - component_GetUrlCheckRange, - component_GetCommand, - component_GetVersion, - component_GetLocale, - component_GetUninstallKey, - component_GetInstalledSize, - component_GetDownloadSize, - component_GetExtractSize, - component_GetSuccessKey, - component_GetProgressKeys, - component_IsActiveSetupAware, - component_IsRebootRequired, - component_RequiresAdminRights, - component_GetPriority, - component_GetDependency, - component_GetPlatform, - component_GetMode, - component_GetGroup, - component_IsUIVisible, - component_GetPatchID, - component_GetDetVersion, - component_GetTreatAsOneComponents, - component_GetCustomData, - component_IsComponentInstalled, - component_IsComponentDownloaded, - component_IsThisVersionInstalled, - component_GetInstallQueueState, - component_SetInstallQueueState, - component_GetActualDownloadSize, - component_GetCurrentPriority, - component_SetCurrentPriority, -}; - -static HRESULT WINAPI enum_components_QueryInterface(IEnumCifComponents *iface, REFIID riid, void **ppv) -{ - struct ciffenum_components *This = impl_from_IEnumCifComponents(iface); - - if (IsEqualGUID(&IID_IUnknown, riid)) - { - TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv); - *ppv = &This->IEnumCifComponents_iface; - } - /* - else if (IsEqualGUID(&IID_IEnumCifComponents, riid)) - { - TRACE("(%p)->(IID_ICifFile %p)\n", This, ppv); - *ppv = &This->IEnumCifComponents_iface; - } - */ - else - { - FIXME("(%p)->(%s %p) not found\n", This, debugstr_guid(riid), ppv); - *ppv = NULL; - return E_NOINTERFACE; - } - - IUnknown_AddRef((IUnknown *)*ppv); - return S_OK; -} - -static ULONG WINAPI enum_components_AddRef(IEnumCifComponents *iface) -{ - struct ciffenum_components *This = impl_from_IEnumCifComponents(iface); - LONG ref = InterlockedIncrement(&This->ref); - - TRACE("(%p) ref=%d\n", This, ref); - - return ref; -} - -static ULONG WINAPI enum_components_Release(IEnumCifComponents *iface) -{ - struct ciffenum_components *This = impl_from_IEnumCifComponents(iface); - LONG ref = InterlockedDecrement(&This->ref); - - TRACE("(%p) ref=%d\n", This, ref); - - if(!ref) - { - ICifFile_Release(This->file); - heap_free(This); - } - - return ref; -} - -static HRESULT WINAPI enum_components_Next(IEnumCifComponents *iface, ICifComponent **component) -{ - struct ciffenum_components *This = impl_from_IEnumCifComponents(iface); - struct cifcomponent *comp; - - TRACE("(%p)->(%p)\n", This, component); - - if (!component) - return E_FAIL; - - if (!This->position) - { - *component = NULL; - return E_FAIL; - } - - do - { - This->position = list_next(This->start, This->position); - if (!This->position) - { - *component = NULL; - return E_FAIL; - } - - comp = CONTAINING_RECORD(This->position, struct cifcomponent, entry); - } while (This->group_id && (!comp->group || strcmp(This->group_id, comp->group))); - - *component = &comp->ICifComponent_iface; - return S_OK; -} - -static HRESULT WINAPI enum_components_Reset(IEnumCifComponents *iface) -{ - struct ciffenum_components *This = impl_from_IEnumCifComponents(iface); - - TRACE("(%p)\n", This); - - This->position = This->start; - return S_OK; -} - -static const IEnumCifComponentsVtbl enum_componentsVtbl = -{ - enum_components_QueryInterface, - enum_components_AddRef, - enum_components_Release, - enum_components_Next, - enum_components_Reset, -}; - -static HRESULT enum_components_create(ICifFile *file, struct list *start, char *group_id, IEnumCifComponents **iface) -{ - struct ciffenum_components *enumerator; - - enumerator = heap_zero_alloc(sizeof(*enumerator)); - if (!enumerator) return E_OUTOFMEMORY; - - enumerator->IEnumCifComponents_iface.lpVtbl = &enum_componentsVtbl; - enumerator->ref = 1; - enumerator->file = file; - enumerator->start = start; - enumerator->position = start; - enumerator->group_id = group_id; - - ICifFile_AddRef(file); - - *iface = &enumerator->IEnumCifComponents_iface; - return S_OK; -} - -static HRESULT WINAPI enum_groups_QueryInterface(IEnumCifGroups *iface, REFIID riid, void **ppv) -{ - struct ciffenum_groups *This = impl_from_IEnumCifGroups(iface); - - if (IsEqualGUID(&IID_IUnknown, riid)) - { - TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv); - *ppv = &This->IEnumCifGroups_iface; - } - /* - else if (IsEqualGUID(&IID_IEnumCifGroups, riid)) - { - TRACE("(%p)->(IID_ICifFile %p)\n", This, ppv); - *ppv = &This->IEnumCifGroups_iface; - } - */ - else - { - FIXME("(%p)->(%s %p) not found\n", This, debugstr_guid(riid), ppv); - *ppv = NULL; - return E_NOINTERFACE; - } - - IUnknown_AddRef((IUnknown *)*ppv); - return S_OK; -} - -static ULONG WINAPI enum_groups_AddRef(IEnumCifGroups *iface) -{ - struct ciffenum_groups *This = impl_from_IEnumCifGroups(iface); - LONG ref = InterlockedIncrement(&This->ref); - - TRACE("(%p) ref=%d\n", This, ref); - - return ref; -} - -static ULONG WINAPI enum_groups_Release(IEnumCifGroups *iface) -{ - struct ciffenum_groups *This = impl_from_IEnumCifGroups(iface); - LONG ref = InterlockedDecrement(&This->ref); - - TRACE("(%p) ref=%d\n", This, ref); - - if(!ref) - { - ICifFile_Release(This->file); - heap_free(This); - } - - return ref; -} - -static HRESULT WINAPI enum_groups_Next(IEnumCifGroups *iface, ICifGroup **group) -{ - struct ciffenum_groups *This = impl_from_IEnumCifGroups(iface); - struct cifgroup *gp; - - TRACE("(%p)->(%p)\n", This, group); - - if (!This->position || !group) - return E_FAIL; - - This->position = list_next(This->start, This->position); - - if (!This->position) - return E_FAIL; - - gp = CONTAINING_RECORD(This->position, struct cifgroup, entry); - *group = &gp->ICifGroup_iface; - return S_OK; -} - -static HRESULT WINAPI enum_groups_Reset(IEnumCifGroups *iface) -{ - struct ciffenum_groups *This = impl_from_IEnumCifGroups(iface); - - TRACE("(%p)\n", This); - - This->position = This->start; - return S_OK; -} - -static const IEnumCifGroupsVtbl enum_groupsVtbl = -{ - enum_groups_QueryInterface, - enum_groups_AddRef, - enum_groups_Release, - enum_groups_Next, - enum_groups_Reset, -}; - -static HRESULT enum_groups_create(ICifFile *file, struct list *start, IEnumCifGroups **iface) -{ - struct ciffenum_groups *enumerator; - - enumerator = heap_zero_alloc(sizeof(*enumerator)); - if (!enumerator) return E_OUTOFMEMORY; - - enumerator->IEnumCifGroups_iface.lpVtbl = &enum_groupsVtbl; - enumerator->ref = 1; - enumerator->file = file; - enumerator->start = start; - enumerator->position = start; - - ICifFile_AddRef(file); - - *iface = &enumerator->IEnumCifGroups_iface; - return S_OK; -} - -static HRESULT WINAPI ciffile_QueryInterface(ICifFile *iface, REFIID riid, void **ppv) -{ - struct ciffile *This = impl_from_ICiffile(iface); - - if (IsEqualGUID(&IID_IUnknown, riid)) - { - TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv); - *ppv = &This->ICifFile_iface; - } - else if (IsEqualGUID(&IID_ICifFile, riid)) - { - TRACE("(%p)->(IID_ICifFile %p)\n", This, ppv); - *ppv = &This->ICifFile_iface; - } - else - { - FIXME("(%p)->(%s %p) not found\n", This, debugstr_guid(riid), ppv); - *ppv = NULL; - return E_NOINTERFACE; - } - - IUnknown_AddRef((IUnknown *)*ppv); - return S_OK; -} - -static ULONG WINAPI ciffile_AddRef(ICifFile *iface) -{ - struct ciffile *This = impl_from_ICiffile(iface); - LONG ref = InterlockedIncrement(&This->ref); - - TRACE("(%p) ref=%d\n", This, ref); - - return ref; -} - -static ULONG WINAPI ciffile_Release(ICifFile *iface) -{ - struct ciffile *This = impl_from_ICiffile(iface); - LONG ref = InterlockedDecrement(&This->ref); - - TRACE("(%p) ref=%d\n", This, ref); - - if(!ref) - { - struct cifcomponent *comp, *comp_next; - struct cifgroup *group, *group_next; - - heap_free(This->name); - - LIST_FOR_EACH_ENTRY_SAFE(comp, comp_next, &This->components, struct cifcomponent, entry) - { - list_remove(&comp->entry); - component_free(comp); - } - - LIST_FOR_EACH_ENTRY_SAFE(group, group_next, &This->groups, struct cifgroup, entry) - { - list_remove(&group->entry); - group_free(group); - } - - heap_free(This); - } - - return ref; -} - -static HRESULT WINAPI ciffile_EnumComponents(ICifFile *iface, IEnumCifComponents **enum_components, DWORD filter, void *pv) -{ - struct ciffile *This = impl_from_ICiffile(iface); - - TRACE("(%p)->(%p, %u, %p)\n", This, enum_components, filter, pv); - - if (filter) - FIXME("filter (%x) not supported\n", filter); - if (pv) - FIXME("how to handle pv (%p)?\n", pv); - - return enum_components_create(iface, &This->components, NULL, enum_components); -} - -static HRESULT WINAPI ciffile_FindComponent(ICifFile *iface, const char *id, ICifComponent **component) -{ - struct ciffile *This = impl_from_ICiffile(iface); - struct cifcomponent *comp; - - TRACE("(%p)->(%s, %p)\n", This, debugstr_a(id), component); - - LIST_FOR_EACH_ENTRY(comp, &This->components, struct cifcomponent, entry) - { - if (strcmp(comp->id, id) != 0) - continue; - - *component = &comp->ICifComponent_iface; - return S_OK; - } - - return E_FAIL; -} - -static HRESULT WINAPI ciffile_EnumGroups(ICifFile *iface, IEnumCifGroups **enum_groups, DWORD filter, void *pv) -{ - struct ciffile *This = impl_from_ICiffile(iface); - - TRACE("(%p)->(%p, %u, %p)\n", This, enum_groups, filter, pv); - - if (filter) - FIXME("filter (%x) not supported\n", filter); - if (pv) - FIXME("how to handle pv (%p)?\n", pv); - - return enum_groups_create(iface, &This->groups, enum_groups); -} - -static HRESULT WINAPI ciffile_FindGroup(ICifFile *iface, const char *id, ICifGroup **group) -{ - struct ciffile *This = impl_from_ICiffile(iface); - struct cifgroup *gp; - - TRACE("(%p)->(%s, %p)\n", This, debugstr_a(id), group); - - LIST_FOR_EACH_ENTRY(gp, &This->groups, struct cifgroup, entry) - { - if (strcmp(gp->id, id) != 0) - continue; - - *group = &gp->ICifGroup_iface; - return S_OK; - } - - return E_FAIL; -} - -static HRESULT WINAPI ciffile_EnumModes(ICifFile *iface, IEnumCifModes **cuf_modes, DWORD filter, void *pv) -{ - struct ciffile *This = impl_from_ICiffile(iface); - - FIXME("(%p)->(%p, %u, %p): stub\n", This, cuf_modes, filter, pv); - - return E_NOTIMPL; -} - -static HRESULT WINAPI ciffile_FindMode(ICifFile *iface, const char *id, ICifMode **mode) -{ - struct ciffile *This = impl_from_ICiffile(iface); - - FIXME("(%p)->(%s, %p): stub\n", This, debugstr_a(id), mode); - - return E_NOTIMPL; -} - -static HRESULT WINAPI ciffile_GetDescription(ICifFile *iface, char *desc, DWORD size) -{ - struct ciffile *This = impl_from_ICiffile(iface); - - TRACE("(%p)->(%p, %u)\n", This, desc, size); - - return copy_substring_null(desc, size, This->name); -} - -static HRESULT WINAPI ciffile_GetDetDlls(ICifFile *iface, char *dlls, DWORD size) -{ - struct ciffile *This = impl_from_ICiffile(iface); - - FIXME("(%p)->(%p, %u): stub\n", This, dlls, size); - - return E_NOTIMPL; -} - -static const ICifFileVtbl ciffileVtbl = -{ - ciffile_QueryInterface, - ciffile_AddRef, - ciffile_Release, - ciffile_EnumComponents, - ciffile_FindComponent, - ciffile_EnumGroups, - ciffile_FindGroup, - ciffile_EnumModes, - ciffile_FindMode, - ciffile_GetDescription, - ciffile_GetDetDlls, -}; - -static BOOL copy_string(char **dest, const char *source) -{ - if (!source) - { - *dest = NULL; - return TRUE; - } - - *dest = strdupA(source); - if (!dest) return FALSE; - return TRUE; -} - -static BOOL section_get_str(struct inf_section *inf_sec, const char *key, char **value, const char *def) -{ - struct inf_value *inf_val; - - inf_val = inf_get_value(inf_sec, key); - if (!inf_val) return copy_string(value, def); - - *value = inf_value_get_value(inf_val); - if (!*value) return FALSE; - - return TRUE; -} - -static char *next_part(char **str, BOOL strip_quotes) -{ - char *start = *str; - char *next = *str; - - while (*next && *next != ',') - next++; - - if (!*next) - { - *str = trim(start, NULL, strip_quotes); - return NULL; - } - - *next = 0; - *str = trim(start, NULL, strip_quotes); - return ++next; -} - -static BOOL value_get_str_field(struct inf_value *inf_val, int field, char **value, const char *def) -{ - char *line, *str, *next; - int i = 0; - - line = inf_value_get_value(inf_val); - if (!line) return FALSE; - - str = line; - do - { - i++; - next = next_part(&str, TRUE); - - if (field == i) - { - BOOL ret = copy_string(value, str); - heap_free(line); - return ret; - } - - str = next; - } while (str); - - return copy_string(value, def); -} - -/* -static BOOL section_get_str_field(struct inf_section *inf_sec, const char *key, int field, char **value, const char *def) -{ - struct inf_value *inf_val; - - inf_val = inf_get_value(inf_sec, key); - if (!inf_val) return copy_string(value, def); - - return value_get_str_field(inf_val, field, value, def); -} -*/ - -static BOOL section_get_dword(struct inf_section *inf_sec, const char *key, DWORD *value, DWORD def) -{ - struct inf_value *inf_val; - char *str; - - inf_val = inf_get_value(inf_sec, key); - if (!inf_val) - { - *value = def; - return TRUE; - } - - str = inf_value_get_value(inf_val); - if (!str) return FALSE; - - *value = atoi(str); - heap_free(str); - - return TRUE; -} - -static BOOL value_get_dword_field(struct inf_value *inf_val, int field, DWORD *value, DWORD def) -{ - char *value_str; - BOOL ret; - - ret = value_get_str_field(inf_val, field, &value_str, NULL); - if (!ret) return FALSE; - if (!value_str) - { - *value = def; - return TRUE; - } - - *value = atoi(value_str); - heap_free(value_str); - - return TRUE; -} - -static BOOL section_get_dword_field(struct inf_section *inf_sec, const char *key, int field, DWORD *value, DWORD def) -{ - struct inf_value *inf_val; - - inf_val = inf_get_value(inf_sec, key); - if (!inf_val) - { - *value = def; - return TRUE; - } - - return value_get_dword_field(inf_val, field, value, def); -} - -static HRESULT process_version(struct ciffile *file, struct inf_section *section) -{ - if (!section_get_str(section, "DisplayName", &file->name, DEFAULT_INSTALLER_DESC)) - return E_OUTOFMEMORY; - - return S_OK; -} - -static BOOL read_version_entry(struct inf_section *section, DWORD *ret_ver, DWORD *ret_build) -{ - DWORD version = 0; - DWORD build = 0; - char *line, *str, *next; - - if (!section_get_str(section, "Version", &line, NULL)) - return FALSE; - if (!line) goto done; - - str = line; - - next = next_part(&str, TRUE); - version |= atoi(str) << 16; - if (!next) goto done; - str = next; - - next = next_part(&str, TRUE); - version |= atoi(str) & 0xffff; - if (!next) goto done; - str = next; - - next = next_part(&str, TRUE); - build |= atoi(str) << 16; - if (!next) goto done; - str = next; - - next_part(&str, TRUE); - build |= atoi(str) & 0xffff; - -done: - heap_free(line); - *ret_ver = version; - *ret_build = build; - return TRUE; -} - -static BOOL read_platform_entry(struct inf_section *section, DWORD *ret_platform) -{ - DWORD platform = PLATFORM_ALL; - char *line, *str, *next; - - if (!section_get_str(section, "Platform", &line, NULL)) - return FALSE; - if (!line) goto done; - - platform = 0; - str = line; - do - { - next = next_part(&str, TRUE); - - if (strcasecmp(str, "Win95") == 0) - platform |= PLATFORM_WIN98; - else if (strcasecmp(str, "Win98") == 0) - platform |= PLATFORM_WIN98; - else if (strcasecmp(str, "NT4") == 0) - platform |= PLATFORM_NT4; - else if (strcasecmp(str, "NT5") == 0) - platform |= PLATFORM_NT5; - else if (strcasecmp(str, "NT4Alpha") == 0) - platform |= PLATFORM_NT4; - else if (strcasecmp(str, "NT5Alpha") == 0) - platform |= PLATFORM_NT5; - else if (strcasecmp(str, "Millen") == 0) - platform |= PLATFORM_MILLEN; - else - FIXME("Unknown platform: %s\n", debugstr_a(str)); - - str = next; - } while (str); - -done: - heap_free(line); - *ret_platform = platform; - return TRUE; -} - -static BOOL read_dependencies(struct cifcomponent *component, struct inf_section *section) -{ - struct dependency_info *dependency; - char *line, *str, *next; - BOOL ret = TRUE; - - if (!section_get_str(section, "Dependencies", &line, NULL)) - return E_OUTOFMEMORY; - if (!line) goto done; - - ret = FALSE; - str = line; - do - { - next = next_part(&str, TRUE); - - dependency = heap_zero_alloc(sizeof(*dependency)); - if (!dependency) goto done; - - dependency->id = strdupA(str); - if (!dependency->id) - { - heap_free(dependency); - goto done; - } - - dependency->type = strstr(dependency->id, ":"); - if (dependency->type) *dependency->type++ = 0; - - list_add_tail(&component->dependencies, &dependency->entry); - - str = next; - } while (str); - - ret = TRUE; - -done: - heap_free(line); - return ret; -} - -static BOOL read_urls(struct cifcomponent *component, struct inf_section *section) -{ - struct inf_value *inf_value = NULL; - struct url_info *url_entry; - char *str, *next; - int index; - - while (inf_section_next_value(section, &inf_value)) - { - str = inf_value_get_key(inf_value); - if (!str) return E_OUTOFMEMORY; - - if (strncasecmp(str, "URL", 3)) - goto next; - - if (!str[3]) - goto next; - - index = strtol(str+3, &next, 10); - if (next == str+3 || *next != 0 || index < 1) - goto next; - index--; - - url_entry = heap_zero_alloc(sizeof(*url_entry)); - if (!url_entry) goto error; - - url_entry->index = index; - - if (!value_get_str_field(inf_value, 1, &url_entry->url, NULL)) - goto error; - if (!url_entry->url || !*url_entry->url) - { - url_entry_free(url_entry); - goto next; - } - - if (!value_get_dword_field(inf_value, 2, &url_entry->flags, 0)) - goto error; - - list_add_tail(&component->urls, &url_entry->entry); - - next: - heap_free(str); - } - - return TRUE; - -error: - heap_free(str); - url_entry_free(url_entry); - return FALSE; -}; - -void add_component_by_priority(struct ciffile *file, struct cifcomponent *component) -{ - struct cifcomponent *entry; - - LIST_FOR_EACH_ENTRY(entry, &file->components, struct cifcomponent, entry) - { - if (entry->priority > component->priority) - continue; - - list_add_before(&entry->entry, &component->entry); - return; - } - - list_add_tail(&file->components, &component->entry); -} - -static HRESULT process_component(struct ciffile *file, struct inf_section *section, const char *section_name) -{ - struct cifcomponent *component; - HRESULT hr = E_OUTOFMEMORY; - - component = heap_zero_alloc(sizeof(*component)); - if (!component) return E_OUTOFMEMORY; - - component->ICifComponent_iface.lpVtbl = &cifcomponentVtbl; - component->parent = &file->ICifFile_iface; - - list_init(&component->urls); - list_init(&component->dependencies); - - component->queue_state = ActionNone; - - component->id = strdupA(section_name); - if (!component->id) goto error; - - if (!section_get_str(section, "DisplayName", &component->description, NULL)) - goto error; - if (!section_get_str(section, "GUID", &component->guid, NULL)) - goto error; - if (!section_get_str(section, "Details", &component->details, NULL)) - goto error; - if (!section_get_str(section, "Group", &component->group, NULL)) - goto error; - if (!section_get_str(section, "Locale", &component->locale, "en")) - goto error; - if (!section_get_str(section, "PatchID", &component->patchid, NULL)) - goto error; - - if (!section_get_dword_field(section, "Size", 1, &component->size_download, 0)) - goto error; - if (!section_get_dword_field(section, "Size", 2, &component->size_extracted, 0)) - goto error; - if (!section_get_dword_field(section, "InstalledSize", 1, &component->size_app, 0)) - goto error; - if (!section_get_dword_field(section, "InstalledSize", 2, &component->size_win, 0)) - goto error; - - if (!section_get_str(section, "SuccessKey", &component->key_success, NULL)) - goto error; - if (!section_get_str(section, "CancelKey", &component->key_cancel, NULL)) - goto error; - if (!section_get_str(section, "ProgressKey", &component->key_progress, NULL)) - goto error; - if (!section_get_str(section, "UninstallKey", &component->key_uninstall, NULL)) - goto error; - if (!section_get_dword(section, "Reboot", &component->reboot, 0)) - goto error; - if (!section_get_dword(section, "AdminCheck", &component->admin, 0)) - goto error; - if (!section_get_dword(section, "UIVisible", &component->visibleui, 1)) - goto error; - if (!section_get_dword(section, "ActiveSetupAware", &component->as_aware, 0)) - goto error; - if (!section_get_dword(section, "Priority", &component->priority, 0)) - goto error; - - if (!read_version_entry(section, &component->version, &component->build)) - goto error; - if (!read_platform_entry(section, &component->platform)) - goto error; - if (!read_urls(component, section)) - goto error; - if (!read_dependencies(component, section)) - goto error; - - component->current_priority = component->priority; - - add_component_by_priority(file, component); - return S_OK; - -error: - component_free(component); - return hr; -} - -static HRESULT process_group(struct ciffile *file, struct inf_section *section, const char *section_name) -{ - struct cifgroup *group; - HRESULT hr = E_OUTOFMEMORY; - - group = heap_zero_alloc(sizeof(*group)); - if (!group) return E_OUTOFMEMORY; - - group->ICifGroup_iface.lpVtbl = &cifgroupVtbl; - group->parent = &file->ICifFile_iface; - - group->id = strdupA(section_name); - if (!group->id) goto error; - - if (!section_get_str(section, "DisplayName", &group->description, NULL)) - goto error; - if (!section_get_dword(section, "Priority", &group->priority, 0)) - goto error; - - list_add_head(&file->groups, &group->entry); - return S_OK; - -error: - group_free(group); - return hr; -} - -static HRESULT process_section(struct ciffile *file, struct inf_section *section, const char *section_name) -{ - HRESULT hr; - char *type; - - if (!section_get_str(section, "SectionType", &type, "Component")) - return E_OUTOFMEMORY; - - if (!strcasecmp(type, "Component")) - hr = process_component(file, section, section_name); - else if (strcasecmp(type, "Group") == 0) - hr = process_group(file, section, section_name); - else - FIXME("Don't know how to process %s\n", debugstr_a(type)); - - heap_free(type); - return hr; -} - -static HRESULT process_inf(struct ciffile *file, struct inf_file *inf) -{ - struct inf_section *section = NULL; - char *section_name; - HRESULT hr = S_OK; - - while (SUCCEEDED(hr) && inf_next_section(inf, §ion)) - { - section_name = inf_section_get_name(section); - if (!section_name) return E_OUTOFMEMORY; - - TRACE("start processing section %s\n", debugstr_a(section_name)); - - if (!strcasecmp(section_name, "Strings") || - !strncasecmp(section_name, "Strings.", strlen("Strings."))) - { - /* Ignore string sections */ - } - else if (strcasecmp(section_name, "Version") == 0) - hr = process_version(file, section); - else - hr = process_section(file, section, section_name); - - TRACE("finished processing section %s (%x)\n", debugstr_a(section_name), hr); - heap_free(section_name); - } - - /* In case there was no version section, set the default installer description */ - if (SUCCEEDED(hr) && !file->name) - { - file->name = strdupA(DEFAULT_INSTALLER_DESC); - if (!file->name) hr = E_OUTOFMEMORY; - } - - return hr; -} - -static HRESULT load_ciffile(const char *path, ICifFile **icif) -{ - struct inf_file *inf = NULL; - struct ciffile *file; - HRESULT hr = E_FAIL; - - file = heap_zero_alloc(sizeof(*file)); - if(!file) return E_OUTOFMEMORY; - - file->ICifFile_iface.lpVtbl = &ciffileVtbl; - file->ref = 1; - - list_init(&file->components); - list_init(&file->groups); - - hr = inf_load(path, &inf); - if (FAILED(hr)) goto error; - - hr = process_inf(file, inf); - if (FAILED(hr)) goto error; - - *icif = &file->ICifFile_iface; - return S_OK; - -error: - if (inf) inf_free(inf); - ICifFile_Release(&file->ICifFile_iface); - return hr; -} - -HRESULT WINAPI GetICifFileFromFile(ICifFile **icif, const char *path) -{ - TRACE("(%p, %s)\n", icif, debugstr_a(path)); - - return load_ciffile(path, icif); -} - - -HRESULT WINAPI GetICifRWFileFromFile(ICifRWFile **icif, const char *path) -{ - FIXME("(%p, %s): stub\n", icif, debugstr_a(path)); - - return E_NOTIMPL; -} diff --git a/dll/win32/inseng/inf.c b/dll/win32/inseng/inf.c deleted file mode 100644 index b446283c30..0000000000 --- a/dll/win32/inseng/inf.c +++ /dev/null @@ -1,434 +0,0 @@ -/* - * Copyright 2016 Michael Müller - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#include "inseng_private.h" - -struct inf_value -{ - struct list entry; - char *key; - char *value; - - struct inf_section *section; -}; - -struct inf_section -{ - struct list entry; - char *name; - struct list values; - - struct inf_file *file; -}; - -struct inf_file -{ - char *content; - DWORD size; - struct list sections; -}; - -static void inf_value_free(struct inf_value *value) -{ - heap_free(value); -} - -static void inf_section_free(struct inf_section *section) -{ - struct inf_value *val, *val_next; - LIST_FOR_EACH_ENTRY_SAFE(val, val_next, §ion->values, struct inf_value, entry) - { - list_remove(&val->entry); - inf_value_free(val); - } - - heap_free(section); -} - -static const char *get_substitution(struct inf_file *inf, const char *name, int len) -{ - struct inf_section *sec; - struct inf_value *value = NULL; - - sec = inf_get_section(inf, "Strings"); - if (!sec) return NULL; - - while (inf_section_next_value(sec, &value)) - { - if (strlen(value->key) == len && !strncasecmp(value->key, name, len)) - return value->value; - } - - return NULL; -} - -static int expand_variables_buffer(struct inf_file *inf, const char *str, char *output) -{ - const char *p, *var_start = NULL; - int var_len, len = 0; - const char *substitution; - - for (p = str; *p; p++) - { - if (*p != '%') - { - if (var_start) - var_len++; - else - { - if (output) - *output++ = *p; - len++; - } - - continue; - } - - if (!var_start) - { - var_start = p; - var_len = 0; - - continue; - } - - if (!var_len) - { - /* just an escaped % */ - if (output) - *output++ = '%'; - len += 1; - - var_start = NULL; - continue; - } - - substitution = get_substitution(inf, var_start + 1, var_len); - if (!substitution) - { - if (output) - { - memcpy(output, var_start, var_len + 2); - output += var_len + 2; - } - len += var_len + 2; - } - else - { - int sub_len = strlen(substitution); - - if (output) - { - memcpy(output, substitution, sub_len); - output += sub_len; - } - len += sub_len; - } - - var_start = NULL; - } - - if (output) *output = 0; - return len + 1; -} - -static char *expand_variables(struct inf_file *inf, const char *str) -{ - char *buffer; - int len; - - len = expand_variables_buffer(inf, str, NULL); - buffer = heap_alloc(len); - if (!len) return NULL; - - expand_variables_buffer(inf, str, buffer); - return buffer; -} - -void inf_free(struct inf_file *inf) -{ - struct inf_section *sec, *sec_next; - LIST_FOR_EACH_ENTRY_SAFE(sec, sec_next, &inf->sections, struct inf_section, entry) - { - list_remove(&sec->entry); - inf_section_free(sec); - } - - heap_free(inf->content); - heap_free(inf); -} - -BOOL inf_next_section(struct inf_file *inf, struct inf_section **sec) -{ - struct list *next_entry, *cur_position; - - if (*sec) - cur_position = &(*sec)->entry; - else - cur_position = &inf->sections; - - next_entry = list_next(&inf->sections, cur_position); - if (!next_entry) return FALSE; - - *sec = CONTAINING_RECORD(next_entry, struct inf_section, entry); - return TRUE; -} - -struct inf_section *inf_get_section(struct inf_file *inf, const char *name) -{ - struct inf_section *sec = NULL; - - while (inf_next_section(inf, &sec)) - { - if (!strcasecmp(sec->name, name)) - return sec; - } - - return NULL; -} - -char *inf_section_get_name(struct inf_section *section) -{ - return strdupA(section->name); -} - -BOOL inf_section_next_value(struct inf_section *sec, struct inf_value **value) -{ - struct list *next_entry, *cur_position; - - if (*value) - cur_position = &(*value)->entry; - else - cur_position = &sec->values; - - next_entry = list_next(&sec->values, cur_position); - if (!next_entry) return FALSE; - - *value = CONTAINING_RECORD(next_entry, struct inf_value, entry); - return TRUE; -} - -struct inf_value *inf_get_value(struct inf_section *sec, const char *key) -{ - struct inf_value *value = NULL; - - while (inf_section_next_value(sec, &value)) - { - if (!strcasecmp(value->key, key)) - return value; - } - - return NULL; -} - -char *inf_value_get_key(struct inf_value *value) -{ - return strdupA(value->key); -} - -char *inf_value_get_value(struct inf_value *value) -{ - return expand_variables(value->section->file, value->value); -} - -char *trim(char *str, char **last_chr, BOOL strip_quotes) -{ - char *last; - - for (; *str; str++) - { - if (*str != '\t' && *str != ' ') - break; - } - - if (!*str) - { - if (last_chr) *last_chr = str; - return str; - } - - last = str + strlen(str) - 1; - - for (; last > str; last--) - { - if (*last != '\t' && *last != ' ') - break; - *last = 0; - } - - if (strip_quotes && last != str) - { - if (*last == '"' && *str == '"') - { - str++; - *last = 0; - } - } - - if (last_chr) *last_chr = last; - return str; -} - -static char *get_next_line(char **str, char **last_chr) -{ - BOOL in_next_line = FALSE; - char *start, *next; - - start = *str; - if (!start || !*start) return NULL; - - for (next = start; *next; next++) - { - if (*next == '\n' || *next == '\r') - { - *next = 0; - in_next_line = TRUE; - } - else if (in_next_line) - { - break; - } - } - - *str = next; - return trim(start, last_chr, FALSE); -} - -/* This function only fails in case of an memory allocation error - * and does not touch section in case the parsing failed. */ -static HRESULT inf_section_parse(struct inf_file *inf, char *line, char *last_chr, struct inf_section **section) -{ - struct inf_section *sec; - char *comment; - char *name; - - if (*line != '[') - return S_OK; - - line++; - - comment = strchr(line, ';'); - if (comment) - { - *comment = 0; - line = trim(line, &last_chr, FALSE); - } - - if (*last_chr != ']') - return S_OK; - - *last_chr = 0; - name = trim(line, NULL, FALSE); - if (!name) return S_OK; - - sec = heap_zero_alloc(sizeof(*sec)); - if (!sec) return E_OUTOFMEMORY; - - sec->name = name; - sec->file = inf; - list_init(&sec->values); - - list_add_tail(&inf->sections, &sec->entry); - - *section = sec; - return S_OK; -} - -static HRESULT inf_value_parse(struct inf_section *sec, char *line) -{ - struct inf_value *key_val; - char *key, *value, *del; - - del = strchr(line, '='); - if (!del) return S_OK; - - *del = 0; - key = line; - value = del + 1; - - key = trim(key, NULL, FALSE); - value = trim(value, NULL, TRUE); - - key_val = heap_zero_alloc(sizeof(*key_val)); - if (!key_val) return E_OUTOFMEMORY; - - key_val->key = key; - key_val->value = value; - key_val->section = sec; - - list_add_tail(&sec->values, &key_val->entry); - return S_OK; -} - -static HRESULT inf_process_content(struct inf_file *inf) -{ - struct inf_section *section = NULL; - char *content = inf->content; - char *line, *last_chr; - HRESULT hr = S_OK; - - while (SUCCEEDED(hr) && (line = get_next_line(&content, &last_chr))) - { - if (*line == '[') - hr = inf_section_parse(inf, line, last_chr, §ion); - else if (strchr(line, '=') && section) - hr = inf_value_parse(section, line); - } - - return hr; -} - -HRESULT inf_load(const char *path, struct inf_file **inf_file) -{ - LARGE_INTEGER file_size; - struct inf_file *inf; - HRESULT hr = E_FAIL; - HANDLE file; - DWORD read; - - file = CreateFileA(path, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); - if (file == INVALID_HANDLE_VALUE) return E_FAIL; - - inf = heap_zero_alloc(sizeof(*inf)); - if (!inf) goto error; - - if (!GetFileSizeEx(file, &file_size)) - goto error; - - inf->size = file_size.QuadPart; - - inf->content = heap_zero_alloc(inf->size); - if (!inf->content) goto error; - - list_init(&inf->sections); - - if (!ReadFile(file, inf->content, inf->size, &read, NULL) || read != inf->size) - goto error; - - hr = inf_process_content(inf); - if (FAILED(hr)) goto error; - - CloseHandle(file); - *inf_file = inf; - return S_OK; - -error: - if (inf) inf_free(inf); - CloseHandle(file); - return hr; -} diff --git a/dll/win32/inseng/inseng.spec b/dll/win32/inseng/inseng.spec index 849c3c5663..69703284e6 100644 --- a/dll/win32/inseng/inseng.spec +++ b/dll/win32/inseng/inseng.spec @@ -7,6 +7,6 @@ @ stdcall -private DllRegisterServer() @ stdcall -private DllUnregisterServer() @ stub DownloadFile -@ stdcall GetICifFileFromFile(ptr str) -@ stdcall GetICifRWFileFromFile(ptr str) +@ stdcall -stub GetICifFileFromFile(ptr str) +@ stdcall -stub GetICifRWFileFromFile(ptr str) @ stub PurgeDownloadDirectory diff --git a/dll/win32/inseng/inseng_main.c b/dll/win32/inseng/inseng_main.c index 20374cfe46..4b69f282f7 100644 --- a/dll/win32/inseng/inseng_main.c +++ b/dll/win32/inseng/inseng_main.c @@ -2,7 +2,6 @@ * INSENG Implementation * * Copyright 2006 Mike McCormack - * Copyright 2016 Michael M�ller * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -19,315 +18,48 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "inseng_private.h" +#define WIN32_NO_STATUS +#define _INC_WINDOWS +#define COM_NO_WINDOWS_H -#include <rpcproxy.h> -#include <urlmon.h> +#define COBJMACROS -static HINSTANCE instance; - -enum thread_operation -{ - OP_DOWNLOAD, - OP_INSTALL -}; - -struct thread_info -{ - DWORD operation; - DWORD jobflags; - - IEnumCifComponents *enum_comp; - - DWORD download_size; - DWORD install_size; - - DWORD downloaded_kb; - ULONGLONG download_start; -}; - -struct InstallEngine -{ - IInstallEngine2 IInstallEngine2_iface; - IInstallEngineTiming IInstallEngineTiming_iface; - LONG ref; - - IInstallEngineCallback *callback; - char *baseurl; - char *downloaddir; - ICifFile *icif; - DWORD status; - - /* used for the installation thread */ - struct thread_info thread; -}; - -struct downloadcb -{ - IBindStatusCallback IBindStatusCallback_iface; - LONG ref; - - WCHAR *file_name; - WCHAR *cache_file; - - char *id; - char *display; - - DWORD dl_size; - DWORD dl_previous_kb; - - InstallEngine *engine; - HANDLE event_done; - HRESULT hr; -}; - -static inline struct downloadcb *impl_from_IBindStatusCallback(IBindStatusCallback *iface) -{ - return CONTAINING_RECORD(iface, struct downloadcb, IBindStatusCallback_iface); -} - -static inline InstallEngine *impl_from_IInstallEngine2(IInstallEngine2 *iface) -{ - return CONTAINING_RECORD(iface, InstallEngine, IInstallEngine2_iface); -} - -static inline InstallEngine *impl_from_IInstallEngineTiming(IInstallEngineTiming *iface) -{ - return CONTAINING_RECORD(iface, InstallEngine, IInstallEngineTiming_iface); -} - -static HRESULT WINAPI downloadcb_QueryInterface(IBindStatusCallback *iface, REFIID riid, void **ppv) -{ - struct downloadcb *This = impl_from_IBindStatusCallback(iface); - - if (IsEqualGUID(&IID_IUnknown, riid)) - { - TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv); - *ppv = &This->IBindStatusCallback_iface; - } - else if (IsEqualGUID(&IID_IBindStatusCallback, riid)) - { - TRACE("(%p)->(IID_IBindStatusCallback %p)\n", This, ppv); - *ppv = &This->IBindStatusCallback_iface; - } - else - { - FIXME("(%p)->(%s %p) not found\n", This, debugstr_guid(riid), ppv); - *ppv = NULL; - return E_NOINTERFACE; - } - - IUnknown_AddRef((IUnknown *)*ppv); - return S_OK; -} - -static ULONG WINAPI downloadcb_AddRef(IBindStatusCallback *iface) -{ - struct downloadcb *This = impl_from_IBindStatusCallback(iface); - LONG ref = InterlockedIncrement(&This->ref); - - TRACE("(%p) ref = %d\n", This, ref); - - return ref; -} - -static ULONG WINAPI downloadcb_Release(IBindStatusCallback *iface) -{ - struct downloadcb *This = impl_from_IBindStatusCallback(iface); - LONG ref = InterlockedDecrement(&This->ref); - - TRACE("(%p) ref = %d\n", This, ref); - - if (!ref) - { - heap_free(This->file_name); - heap_free(This->cache_file); - - IInstallEngine2_Release(&This->engine->IInstallEngine2_iface); - heap_free(This); - } - - return ref; -} - -static HRESULT WINAPI downloadcb_OnStartBinding(IBindStatusCallback *iface, DWORD reserved, IBinding *pbind) -{ - struct downloadcb *This = impl_from_IBindStatusCallback(iface); - - TRACE("(%p)->(%u %p)\n", This, reserved, pbind); - - return S_OK; -} - -static HRESULT WINAPI downloadcb_GetPriority(IBindStatusCallback *iface, LONG *priority) -{ - struct downloadcb *This = impl_from_IBindStatusCallback(iface); - - FIXME("(%p)->(%p): stub\n", This, priority); - - return E_NOTIMPL; -} - -static HRESULT WINAPI downloadcb_OnLowResource(IBindStatusCallback *iface, DWORD reserved) -{ - struct downloadcb *This = impl_from_IBindStatusCallback(iface); - - FIXME("(%p)->(%u): stub\n", This, reserved); - - return E_NOTIMPL; -} - -static HRESULT WINAPI downloadcb_OnProgress(IBindStatusCallback *iface, ULONG progress, - ULONG progress_max, ULONG status, const WCHAR *status_text) -{ - struct downloadcb *This = impl_from_IBindStatusCallback(iface); - HRESULT hr = S_OK; - - TRACE("%p)->(%u %u %u %s)\n", This, progress, progress_max, status, debugstr_w(status_text)); - - switch(status) - { - case BINDSTATUS_BEGINDOWNLOADDATA: - if (!This->engine->thread.download_start) - This->engine->thread.download_start = GetTickCount64(); - /* fall-through */ - case BINDSTATUS_DOWNLOADINGDATA: - case BINDSTATUS_ENDDOWNLOADDATA: - This->engine->thread.downloaded_kb = This->dl_previous_kb + progress / 1024; - if (This->engine->callback) - { - hr = IInstallEngineCallback_OnComponentProgress(This->engine->callback, - This->id, INSTALLSTATUS_DOWNLOADING, This->display, NULL, progress / 1024, This->dl_size); - } - break; - - case BINDSTATUS_CACHEFILENAMEAVAILABLE: - This->cache_file = strdupW(status_text); - if (!This->cache_file) - { - ERR("Failed to allocate memory for cache file\n"); - hr = E_OUTOFMEMORY; - } - break; - - case BINDSTATUS_CONNECTING: - case BINDSTATUS_SENDINGREQUEST: - case BINDSTATUS_MIMETYPEAVAILABLE: - case BINDSTATUS_FINDINGRESOURCE: - break; - - default: - FIXME("Unsupported status %u\n", status); - } - - return hr; -} +#include <config.h> -static HRESULT WINAPI downloadcb_OnStopBinding(IBindStatusCallback *iface, HRESULT hresult, LPCWSTR szError) -{ - struct downloadcb *This = impl_from_IBindStatusCallback(iface); +#include <stdarg.h> - TRACE("(%p)->(%08x %s)\n", This, hresult, debugstr_w(szError)); +#include "windef.h" +#include "winbase.h" +#include "winuser.h" +#include "ole2.h" +#include "rpcproxy.h" +#include "initguid.h" +#include "inseng.h" - if (FAILED(hresult)) - { - This->hr = hresult; - goto done; - } +#include "wine/debug.h" - if (!This->cache_file) - { - This->hr = E_FAIL; - goto done; - } +WINE_DEFAULT_DEBUG_CHANNEL(inseng); - if (CopyFileW(This->cache_file, This->file_name, FALSE)) - This->hr = S_OK; - else - { - ERR("CopyFile failed: %u\n", GetLastError()); - This->hr = E_FAIL; - } - -done: - SetEvent(This->event_done); - return S_OK; -} - -static HRESULT WINAPI downloadcb_GetBindInfo(IBindStatusCallback *iface, - DWORD *grfBINDF, BINDINFO *pbindinfo) +static inline void* __WINE_ALLOC_SIZE(1) heap_alloc(size_t size) { - struct downloadcb *This = impl_from_IBindStatusCallback(iface); - - TRACE("(%p)->(%p %p)\n", This, grfBINDF, pbindinfo); - - *grfBINDF = BINDF_PULLDATA | BINDF_NEEDFILE; - return S_OK; + return HeapAlloc(GetProcessHeap(), 0, size); } -static HRESULT WINAPI downloadcb_OnDataAvailable(IBindStatusCallback *iface, - DWORD grfBSCF, DWORD dwSize, FORMATETC *pformatetc, STGMEDIUM *pstgmed) +static inline BOOL heap_free(void *mem) { - struct downloadcb *This = impl_from_IBindStatusCallback(iface); - - TRACE("(%p)->(%08x %u %p %p)\n", This, grfBSCF, dwSize, pformatetc, pstgmed); - - return S_OK; + return HeapFree(GetProcessHeap(), 0, mem); } -static HRESULT WINAPI downloadcb_OnObjectAvailable(IBindStatusCallback *iface, - REFIID riid, IUnknown *punk) -{ - struct downloadcb *This = impl_from_IBindStatusCallback(iface); - - FIXME("(%p)->(%s %p): stub\n", This, debugstr_guid(riid), punk); - - return E_NOTIMPL; -} +static HINSTANCE instance; -static const IBindStatusCallbackVtbl BindStatusCallbackVtbl = -{ - downloadcb_QueryInterface, - downloadcb_AddRef, - downloadcb_Release, - downloadcb_OnStartBinding, - downloadcb_GetPriority, - downloadcb_OnLowResource, - downloadcb_OnProgress, - downloadcb_OnStopBinding, - downloadcb_GetBindInfo, - downloadcb_OnDataAvailable, - downloadcb_OnObjectAvailable +struct InstallEngine { + IInstallEngine2 IInstallEngine2_iface; + LONG ref; }; -static HRESULT downloadcb_create(InstallEngine *engine, HANDLE event, char *file_name, char *id, - char *display, DWORD dl_size, struct downloadcb **callback) +static inline InstallEngine *impl_from_IInstallEngine2(IInstallEngine2 *iface) { - struct downloadcb *cb; - - cb = heap_zero_alloc(sizeof(*cb)); - if (!cb) return E_OUTOFMEMORY; - - cb->IBindStatusCallback_iface.lpVtbl = &BindStatusCallbackVtbl; - cb->ref = 1; - cb->hr = E_FAIL; - cb->id = id; - cb->display = display; - cb->engine = engine; - cb->dl_size = dl_size; - cb->dl_previous_kb = engine->thread.downloaded_kb; - cb->event_done = event; - cb->file_name = strAtoW(file_name); - if (!cb->file_name) - { - heap_free(cb); - return E_OUTOFMEMORY; - } - - IInstallEngine2_AddRef(&engine->IInstallEngine2_iface); - - *callback = cb; - return S_OK; + return CONTAINING_RECORD(iface, InstallEngine, IInstallEngine2_iface); } static HRESULT WINAPI InstallEngine_QueryInterface(IInstallEngine2 *iface, REFIID riid, void **ppv) @@ -343,16 +75,13 @@ static HRESULT WINAPI InstallEngine_QueryInterface(IInstallEngine2 *iface, REFII }else if(IsEqualGUID(&IID_IInstallEngine2, riid)) { TRACE("(%p)->(IID_IInstallEngine2 %p)\n", This, ppv); *ppv = &This->IInstallEngine2_iface; - }else if(IsEqualGUID(&IID_IInstallEngineTiming, riid)) { - TRACE("(%p)->(IID_IInstallEngineTiming %p)\n", This, ppv); - *ppv = &This->IInstallEngineTiming_iface; }else { - FIXME("(%p)->(%s %p) not found\n", This, debugstr_guid(riid), ppv); + TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv); *ppv = NULL; return E_NOINTERFACE; } - IUnknown_AddRef((IUnknown *)*ppv); + IUnknown_AddRef((IUnknown*)*ppv); return S_OK; } @@ -373,726 +102,181 @@ static ULONG WINAPI InstallEngine_Release(IInstallEngine2 *iface) TRACE("(%p) ref=%d\n", This, ref); - if (!ref) - { - if (This->icif) - ICifFile_Release(This->icif); - - heap_free(This->baseurl); - heap_free(This->downloaddir); + if(!ref) heap_free(This); - } return ref; } -static void set_status(InstallEngine *This, DWORD status) -{ - This->status = status; - - if (This->callback) - IInstallEngineCallback_OnEngineStatusChange(This->callback, status, 0); -} - -static HRESULT calc_sizes(IEnumCifComponents *enum_comp, DWORD operation, DWORD *size_download, DWORD *size_install) -{ - ICifComponent *comp; - DWORD download = 0; - DWORD install = 0; - HRESULT hr; - - /* FIXME: what about inactive dependencies and how does - * INSTALLOPTIONS_FORCEDEPENDENCIES play into this ?*/ - - hr = IEnumCifComponents_Reset(enum_comp); - if (FAILED(hr)) return hr; - - while (SUCCEEDED(IEnumCifComponents_Next(enum_comp, &comp))) - { - if (ICifComponent_GetInstallQueueState(comp) != ActionInstall) - continue; - - /* FIXME: handle install options and find out the default options*/ - if (operation == OP_DOWNLOAD && ICifComponent_IsComponentDownloaded(comp) == S_FALSE) - download += ICifComponent_GetDownloadSize(comp); - /* - if (operation == OP_INSTALL && ICifComponent_IsComponentInstalled(comp) == S_FALSE) - install += ICifComponent_GetInstalledSize(comp); - */ - } - - *size_download = download; - *size_install = install; - - return S_OK; -} - -static HRESULT get_next_component(IEnumCifComponents *enum_comp, DWORD operation, ICifComponent **ret_comp) -{ - ICifComponent *comp; - HRESULT hr; - - hr = IEnumCifComponents_Reset(enum_comp); - if (FAILED(hr)) return hr; - - while (SUCCEEDED(IEnumCifComponents_Next(enum_comp, &comp))) - { - if (ICifComponent_GetInstallQueueState(comp) != ActionInstall) - continue; - - /* FIXME: handle install options and find out the default options*/ - if (operation == OP_DOWNLOAD && ICifComponent_IsComponentDownloaded(comp) != S_FALSE) - continue; - if (operation == OP_INSTALL && ICifComponent_IsComponentInstalled(comp) != S_FALSE) - continue; - - *ret_comp = comp; - return S_OK; - } - - return S_FALSE; -} - -static HRESULT get_url(ICifComponent *comp, int index, char **url, DWORD *flags) -{ - char *url_temp = NULL; - int size = MAX_PATH / 2; - HRESULT hr; - - /* FIXME: should we add an internal get function to prevent this ugly code ? */ - - /* check if there is an url with such an index */ - hr = ICifComponent_GetUrl(comp, index, NULL, 0, flags); - if (FAILED(hr)) - { - *url = NULL; - *flags = 0; - return S_OK; - } - - do - { - size *= 2; - heap_free(url_temp); - url_temp = heap_alloc(size); - if (!url_temp) return E_OUTOFMEMORY; - - hr = ICifComponent_GetUrl(comp, index, url_temp, size, flags); - if (FAILED(hr)) - { - heap_free(url_temp); - return hr; - } - } - while (strlen(url_temp) == size-1); - - *url = url_temp; - return S_OK; -} - -static char *combine_url(char *baseurl, char *url) -{ - int len_base = strlen(baseurl); - int len_url = strlen(url); - char *combined; - - combined = heap_alloc(len_base + len_url + 2); - if (!combined) return NULL; - - strcpy(combined, baseurl); - if (len_base && combined[len_base-1] != '/') - strcat(combined, "/"); - strcat(combined, url); - - return combined; -} - -static HRESULT generate_moniker(char *baseurl, char *url, DWORD flags, IMoniker **moniker) -{ - WCHAR *urlW; - HRESULT hr; - - if (flags & URLF_RELATIVEURL) - { - char *combined; - if (!baseurl) - return E_FAIL; - - combined = combine_url(baseurl, url); - if (!combined) return E_OUTOFMEMORY; - - urlW = strAtoW(combined); - heap_free(combined); - if (!urlW) return E_OUTOFMEMORY; - } - else - { - urlW = strAtoW(url); - if (!urlW) return E_OUTOFMEMORY; - } - - hr = CreateURLMoniker(NULL, urlW, moniker); - heap_free(urlW); - return hr; -} - -static char *merge_path(char *path1, char *path2) -{ - int len = strlen(path1) + strlen(path2) + 2; - char *combined = heap_alloc(len); - - if (!combined) return NULL; - strcpy(combined, path1); - strcat(combined, "\\"); - strcat(combined, path2); - - return combined; -} - -static HRESULT download_url(InstallEngine *This, char *id, char *display, char *url, DWORD flags, DWORD dl_size) -{ - struct downloadcb *callback = NULL; - char *filename = NULL; - IUnknown *unk = NULL; - IMoniker *mon = NULL; - IBindCtx *bindctx = NULL; - HANDLE event = NULL; - HRESULT hr; - - if (!This->downloaddir) - { - WARN("No download directory set\n"); - return E_FAIL; - } - - hr = generate_moniker(This->baseurl, url, flags, &mon); - if (FAILED(hr)) - { - FIXME("Failed to create moniker\n"); - return hr; - } - - event = CreateEventW(NULL, TRUE, FALSE, NULL); - if (!event) - { - IMoniker_Release(mon); - return E_FAIL; - } - - filename = strrchr(url, '/'); - if (!filename) filename = url; - - filename = merge_path(This->downloaddir, filename); - if (!filename) - { - hr = E_OUTOFMEMORY; - goto error; - } - - hr = downloadcb_create(This, event, filename, id, display, dl_size, &callback); - if (FAILED(hr)) goto error; - - hr = CreateAsyncBindCtx(0, &callback->IBindStatusCallback_iface, NULL, &bindctx); - if(FAILED(hr)) goto error; - - hr = IMoniker_BindToStorage(mon, bindctx, NULL, &IID_IUnknown, (void**)&unk); - if (FAILED(hr)) goto error; - if (unk) IUnknown_Release(unk); - - heap_free(filename); - IMoniker_Release(mon); - IBindCtx_Release(bindctx); - - WaitForSingleObject(event, INFINITE); - hr = callback->hr; - - CloseHandle(event); - IBindStatusCallback_Release(&callback->IBindStatusCallback_iface); - return hr; - -error: - if (mon) IMoniker_Release(mon); - if (event) CloseHandle(event); - if (callback) IBindStatusCallback_Release(&callback->IBindStatusCallback_iface); - if (bindctx) IBindCtx_Release(bindctx); - if (filename) heap_free(filename); - return hr; -} - -static HRESULT process_component_dependencies(InstallEngine *This, ICifComponent *comp) -{ - char id[MAX_ID_LENGTH+1], type; - DWORD ver, build; - HRESULT hr; - int i; - - for (i = 0;; i++) - { - hr = ICifComponent_GetDependency(comp, i, id, sizeof(id), &type, &ver, &build); - if (SUCCEEDED(hr)) - FIXME("Can't handle dependencies yet: %s\n", debugstr_a(id)); - else - break; - } - - return S_OK; -} - -static HRESULT process_component(InstallEngine *This, ICifComponent *comp) -{ - DWORD size_dl, size_install, phase; - char display[MAX_DISPLAYNAME_LENGTH+1]; - char id[MAX_ID_LENGTH+1]; - HRESULT hr; - int i; - - hr = ICifComponent_GetID(comp, id, sizeof(id)); - if (FAILED(hr)) return hr; - - TRACE("processing component %s\n", debugstr_a(id)); - - hr = ICifComponent_GetDescription(comp, display, sizeof(display)); - if (FAILED(hr)) return hr; - - size_dl = (This->thread.operation == OP_DOWNLOAD) ? ICifComponent_GetDownloadSize(comp) : 0; - size_install = 0; /* (This->thread.operation == OP_INSTALL) ? ICifComponent_GetInstalledSize(comp) : 0; */ - - if (This->callback) - { - IInstallEngineCallback_OnStartComponent(This->callback, id, size_dl, size_install, display); - IInstallEngineCallback_OnComponentProgress(This->callback, id, INSTALLSTATUS_INITIALIZING, display, NULL, 0, 0); - phase = INSTALLSTATUS_INITIALIZING; - } - - hr = process_component_dependencies(This, comp); - if (FAILED(hr)) return hr; - - if (This->thread.operation == OP_DOWNLOAD) - { - for (i = 0;; i++) - { - DWORD flags; - char *url; - - phase = INSTALLSTATUS_DOWNLOADING; - - hr = get_url(comp, i, &url, &flags); - if (FAILED(hr)) goto done; - if (!url) break; - - TRACE("processing url %s\n", debugstr_a(url)); - - hr = download_url(This, id, display, url, flags, size_dl); - heap_free(url); - if (FAILED(hr)) - { - DWORD retry = 0; - - if (This->callback) - IInstallEngineCallback_OnEngineProblem(This->callback, ENGINEPROBLEM_DOWNLOADFAIL, &retry); - if (!retry) goto done; - - i--; - continue; - } - - phase = INSTALLSTATUS_CHECKINGTRUST; - /* FIXME: check trust */ - IInstallEngineCallback_OnComponentProgress(This->callback, id, INSTALLSTATUS_CHECKINGTRUST, display, NULL, 0, 0); - } - - component_set_downloaded(comp, TRUE); - phase = INSTALLSTATUS_DOWNLOADFINISHED; - } - else - FIXME("Installation not yet implemented\n"); - -done: - IInstallEngineCallback_OnStopComponent(This->callback, id, hr, phase, display, 0); - return hr; -} - -DWORD WINAPI thread_installation(LPVOID param) -{ - InstallEngine *This = param; - ICifComponent *comp; - HRESULT hr; - - if (This->callback) - IInstallEngineCallback_OnStartInstall(This->callback, This->thread.download_size, This->thread.install_size); - - for (;;) - { - hr = get_next_component(This->thread.enum_comp, This->thread.operation, &comp); - if (FAILED(hr)) break; - if (hr == S_FALSE) - { - hr = S_OK; - break; - } - - hr = process_component(This, comp); - if (FAILED(hr)) break; - } - - if (This->callback) - IInstallEngineCallback_OnStopInstall(This->callback, hr, NULL, 0); - - IEnumCifComponents_Release(This->thread.enum_comp); - IInstallEngine2_Release(&This->IInstallEngine2_iface); - - set_status(This, ENGINESTATUS_READY); - return 0; -} - -static HRESULT start_installation(InstallEngine *This, DWORD operation, DWORD jobflags) -{ - HANDLE thread; - HRESULT hr; - - This->thread.operation = operation; - This->thread.jobflags = jobflags; - This->thread.downloaded_kb = 0; - This->thread.download_start = 0; - - /* Windows sends the OnStartInstall event from a different thread, - * but OnStartInstall already contains the required download and install size. - * The only way to signal an error from the thread is to send an OnStopComponent / - * OnStopInstall signal which can only occur after OnStartInstall. We need to - * precompute the sizes here to be able inform the application about errors while - * calculating the required sizes. */ - - hr = ICifFile_EnumComponents(This->icif, &This->thread.enum_comp, 0, NULL); - if (FAILED(hr)) return hr; - - hr = calc_sizes(This->thread.enum_comp, operation, &This->thread.download_size, &This->thread.install_size); - if (FAILED(hr)) goto error; - - IInstallEngine2_AddRef(&This->IInstallEngine2_iface); - - thread = CreateThread(NULL, 0, thread_installation, This, 0, NULL); - if (!thread) - { - IInstallEngine2_Release(&This->IInstallEngine2_iface); - hr = E_FAIL; - goto error; - } - - CloseHandle(thread); - return S_OK; - -error: - IEnumCifComponents_Release(This->thread.enum_comp); - return hr; -} - static HRESULT WINAPI InstallEngine_GetEngineStatus(IInstallEngine2 *iface, DWORD *status) { InstallEngine *This = impl_from_IInstallEngine2(iface); - - TRACE("(%p)->(%p)\n", This, status); - - if (!status) - return E_FAIL; - - *status = This->status; - return S_OK; + FIXME("(%p)->(%p)\n", This, status); + return E_NOTIMPL; } static HRESULT WINAPI InstallEngine_SetCifFile(IInstallEngine2 *iface, const char *cab_name, const char *cif_name) { InstallEngine *This = impl_from_IInstallEngine2(iface); - - FIXME("(%p)->(%s %s): stub\n", This, debugstr_a(cab_name), debugstr_a(cif_name)); - + FIXME("(%p)->(%s %s)\n", This, debugstr_a(cab_name), debugstr_a(cif_name)); return E_NOTIMPL; } static HRESULT WINAPI InstallEngine_DownloadComponents(IInstallEngine2 *iface, DWORD flags) { InstallEngine *This = impl_from_IInstallEngine2(iface); - - TRACE("(%p)->(%x)\n", This, flags); - - /* The interface is not really threadsafe on windows, but we can at least prevent multiple installations */ - if (InterlockedCompareExchange((LONG *)&This->status, ENGINESTATUS_INSTALLING, ENGINESTATUS_READY) != ENGINESTATUS_READY) - return E_FAIL; - - if (This->callback) - IInstallEngineCallback_OnEngineStatusChange(This->callback, ENGINESTATUS_INSTALLING, 0); - - return start_installation(This, OP_DOWNLOAD, flags); + FIXME("(%p)->(%x)\n", This, flags); + return E_NOTIMPL; } static HRESULT WINAPI InstallEngine_InstallComponents(IInstallEngine2 *iface, DWORD flags) { InstallEngine *This = impl_from_IInstallEngine2(iface); - - FIXME("(%p)->(%x): stub\n", This, flags); - + FIXME("(%p)->(%x)\n", This, flags); return E_NOTIMPL; } static HRESULT WINAPI InstallEngine_EnumInstallIDs(IInstallEngine2 *iface, UINT index, char **id) { InstallEngine *This = impl_from_IInstallEngine2(iface); - - FIXME("(%p)->(%u %p): stub\n", This, index, id); - + FIXME("(%p)->(%d %p)\n", This, index, id); return E_NOTIMPL; } static HRESULT WINAPI InstallEngine_EnumDownloadIDs(IInstallEngine2 *iface, UINT index, char **id) { InstallEngine *This = impl_from_IInstallEngine2(iface); - IEnumCifComponents *enum_components; - ICifComponent *comp; - HRESULT hr; - - TRACE("(%p)->(%u %p)\n", This, index, id); - - if (!This->icif || !id) - return E_FAIL; - - hr = ICifFile_EnumComponents(This->icif, &enum_components, 0, NULL); - if (FAILED(hr)) return hr; - - for (;;) - { - hr = IEnumCifComponents_Next(enum_components, &comp); - if (FAILED(hr)) goto done; - - if (ICifComponent_GetInstallQueueState(comp) != ActionInstall) - continue; - - if (ICifComponent_IsComponentDownloaded(comp) != S_FALSE) - continue; - - if (index == 0) - { - char *id_src = component_get_id(comp); - *id = CoTaskMemAlloc(strlen(id_src) + 1); - - if (*id) - strcpy(*id, id_src); - else - hr = E_OUTOFMEMORY; - goto done; - } - - index--; - } - -done: - IEnumCifComponents_Release(enum_components); - return hr; + FIXME("(%p)->(%d %p)\n", This, index, id); + return E_NOTIMPL; } static HRESULT WINAPI InstallEngine_IsComponentInstalled(IInstallEngine2 *iface, const char *id, DWORD *status) { InstallEngine *This = impl_from_IInstallEngine2(iface); - - FIXME("(%p)->(%s %p): stub\n", This, debugstr_a(id), status); - + FIXME("(%p)->(%s %p)\n", This, debugstr_a(id), status); return E_NOTIMPL; } static HRESULT WINAPI InstallEngine_RegisterInstallEngineCallback(IInstallEngine2 *iface, IInstallEngineCallback *callback) { InstallEngine *This = impl_from_IInstallEngine2(iface); - - TRACE("(%p)->(%p)\n", This, callback); - - This->callback = callback; - return S_OK; + FIXME("(%p)->(%p)\n", This, callback); + return E_NOTIMPL; } static HRESULT WINAPI InstallEngine_UnregisterInstallEngineCallback(IInstallEngine2 *iface) { InstallEngine *This = impl_from_IInstallEngine2(iface); - - TRACE("(%p)\n", This); - - This->callback = NULL; - return S_OK; + FIXME("(%p)\n", This); + return E_NOTIMPL; } static HRESULT WINAPI InstallEngine_SetAction(IInstallEngine2 *iface, const char *id, DWORD action, DWORD priority) { InstallEngine *This = impl_from_IInstallEngine2(iface); - ICifComponent *comp; - HRESULT hr; - - TRACE("(%p)->(%s %u %u)\n", This, debugstr_a(id), action, priority); - - if (!This->icif) - return E_FAIL; /* FIXME: check error code */ - - hr = ICifFile_FindComponent(This->icif, id, &comp); - if (FAILED(hr)) return hr; - - hr = ICifComponent_SetInstallQueueState(comp, action); - if (FAILED(hr)) return hr; - - hr = ICifComponent_SetCurrentPriority(comp, priority); - return hr; + FIXME("(%p)->(%s %d %d)\n", This, debugstr_a(id), action, priority); + return E_NOTIMPL; } static HRESULT WINAPI InstallEngine_GetSizes(IInstallEngine2 *iface, const char *id, COMPONENT_SIZES *sizes) { InstallEngine *This = impl_from_IInstallEngine2(iface); - - FIXME("(%p)->(%s %p): stub\n", This, debugstr_a(id), sizes); - + FIXME("(%p)->(%s %p)\n", This, debugstr_a(id), sizes); return E_NOTIMPL; } static HRESULT WINAPI InstallEngine_LaunchExtraCommand(IInstallEngine2 *iface, const char *inf_name, const char *section) { InstallEngine *This = impl_from_IInstallEngine2(iface); - - FIXME("(%p)->(%s %s): stub\n", This, debugstr_a(inf_name), debugstr_a(section)); - + FIXME("(%p)->(%s %s)\n", This, debugstr_a(inf_name), debugstr_a(section)); return E_NOTIMPL; } static HRESULT WINAPI InstallEngine_GetDisplayName(IInstallEngine2 *iface, const char *id, const char *name) { InstallEngine *This = impl_from_IInstallEngine2(iface); - - FIXME("(%p)->(%s %s): stub\n", This, debugstr_a(id), debugstr_a(name)); - + FIXME("(%p)->(%s %s)\n", This, debugstr_a(id), debugstr_a(name)); return E_NOTIMPL; } static HRESULT WINAPI InstallEngine_SetBaseUrl(IInstallEngine2 *iface, const char *base_name) { InstallEngine *This = impl_from_IInstallEngine2(iface); - - TRACE("(%p)->(%s)\n", This, debugstr_a(base_name)); - - if (This->baseurl) - heap_free(This->baseurl); - - This->baseurl = strdupA(base_name); - return This->baseurl ? S_OK : E_OUTOFMEMORY; + FIXME("(%p)->(%s)\n", This, debugstr_a(base_name)); + return E_NOTIMPL; } static HRESULT WINAPI InstallEngine_SetDownloadDir(IInstallEngine2 *iface, const char *download_dir) { InstallEngine *This = impl_from_IInstallEngine2(iface); - - TRACE("(%p)->(%s)\n", This, debugstr_a(download_dir)); - - if (This->downloaddir) - heap_free(This->downloaddir); - - This->downloaddir = strdupA(download_dir); - return This->downloaddir ? S_OK : E_OUTOFMEMORY; + FIXME("(%p)->(%s)\n", This, debugstr_a(download_dir)); + return E_NOTIMPL; } static HRESULT WINAPI InstallEngine_SetInstallDrive(IInstallEngine2 *iface, char drive) { InstallEngine *This = impl_from_IInstallEngine2(iface); - - FIXME("(%p)->(%c): stub\n", This, drive); - + FIXME("(%p)->(%c)\n", This, drive); return E_NOTIMPL; } static HRESULT WINAPI InstallEngine_SetInstallOptions(IInstallEngine2 *iface, DWORD flags) { InstallEngine *This = impl_from_IInstallEngine2(iface); - - FIXME("(%p)->(%x): stub\n", This, flags); - + FIXME("(%p)->(%x)\n", This, flags); return E_NOTIMPL; } static HRESULT WINAPI InstallEngine_SetHWND(IInstallEngine2 *iface, HWND hwnd) { InstallEngine *This = impl_from_IInstallEngine2(iface); - - FIXME("(%p)->(%p): stub\n", This, hwnd); - + FIXME("(%p)->(%p)\n", This, hwnd); return E_NOTIMPL; } static HRESULT WINAPI InstallEngine_SetIStream(IInstallEngine2 *iface, IStream *stream) { InstallEngine *This = impl_from_IInstallEngine2(iface); - - FIXME("(%p)->(%p): stub\n", This, stream); - + FIXME("(%p)->(%p)\n", This, stream); return E_NOTIMPL; } static HRESULT WINAPI InstallEngine_Abort(IInstallEngine2 *iface, DWORD flags) { InstallEngine *This = impl_from_IInstallEngine2(iface); - - FIXME("(%p)->(%x): stub\n", This, flags); - + FIXME("(%p)->(%x)\n", This, flags); return E_NOTIMPL; } static HRESULT WINAPI InstallEngine_Suspend(IInstallEngine2 *iface) { InstallEngine *This = impl_from_IInstallEngine2(iface); - - FIXME("(%p): stub\n", This); - + FIXME("(%p)\n", This); return E_NOTIMPL; } static HRESULT WINAPI InstallEngine_Resume(IInstallEngine2 *iface) { InstallEngine *This = impl_from_IInstallEngine2(iface); - - FIXME("(%p): stub\n", This); - + FIXME("(%p)\n", This); return E_NOTIMPL; } static HRESULT WINAPI InstallEngine2_SetLocalCif(IInstallEngine2 *iface, const char *cif) { InstallEngine *This = impl_from_IInstallEngine2(iface); - HRESULT hr; - - TRACE("(%p)->(%s)\n", This, debugstr_a(cif)); - - if (This->icif) - ICifFile_Release(This->icif); - - set_status(This, ENGINESTATUS_LOADING); - - hr = GetICifFileFromFile(&This->icif, cif); - if (SUCCEEDED(hr)) - set_status(This, ENGINESTATUS_READY); - else - { - This->icif = NULL; - set_status(This, ENGINESTATUS_NOTREADY); - } - return hr; + FIXME("(%p)->(%s)\n", This, debugstr_a(cif)); + return E_NOTIMPL; } static HRESULT WINAPI InstallEngine2_GetICifFile(IInstallEngine2 *iface, ICifFile **cif_file) { InstallEngine *This = impl_from_IInstallEngine2(iface); - - TRACE("(%p)->(%p)\n", This, cif_file); - - if (!This->icif || !cif_file) - return E_FAIL; - - ICifFile_AddRef(This->icif); - *cif_file = This->icif; - return S_OK; + FIXME("(%p)->(%p)\n", This, cif_file); + return E_NOTIMPL; } -static const IInstallEngine2Vtbl InstallEngine2Vtbl = -{ +static const IInstallEngine2Vtbl InstallEngine2Vtbl = { InstallEngine_QueryInterface, InstallEngine_AddRef, InstallEngine_Release, @@ -1122,70 +306,6 @@ static const IInstallEngine2Vtbl InstallEngine2Vtbl = InstallEngine2_GetICifFile }; -static HRESULT WINAPI InstallEngineTiming_QueryInterface(IInstallEngineTiming *iface, REFIID riid, void **ppv) -{ - InstallEngine *This = impl_from_IInstallEngineTiming(iface); - return IInstallEngine2_QueryInterface(&This->IInstallEngine2_iface, riid, ppv); -} - -static ULONG WINAPI InstallEngineTiming_AddRef(IInstallEngineTiming *iface) -{ - InstallEngine *This = impl_from_IInstallEngineTiming(iface); - return IInstallEngine2_AddRef(&This->IInstallEngine2_iface); -} - -static ULONG WINAPI InstallEngineTiming_Release(IInstallEngineTiming *iface) -{ - InstallEngine *This = impl_from_IInstallEngineTiming(iface); - return IInstallEngine2_Release(&This->IInstallEngine2_iface); -} - -static HRESULT WINAPI InstallEngineTiming_GetRates(IInstallEngineTiming *iface, DWORD *download, DWORD *install) -{ - InstallEngine *This = impl_from_IInstallEngineTiming(iface); - - FIXME("(%p)->(%p, %p): stub\n", This, download, install); - - *download = 0; - *install = 0; - - return S_OK; -} - -static HRESULT WINAPI InstallEngineTiming_GetInstallProgress(IInstallEngineTiming *iface, INSTALLPROGRESS *progress) -{ - InstallEngine *This = impl_from_IInstallEngineTiming(iface); - ULONGLONG elapsed; - static int once; - - if (!once++) - FIXME("(%p)->(%p): semi-stub\n", This, progress); - else - TRACE("(%p)->(%p): semi-stub\n", This, progress); - - progress->dwDownloadKBRemaining = max(This->thread.download_size, This->thread.downloaded_kb) - This->thread.downloaded_kb; - - elapsed = GetTickCount64() - This->thread.download_start; - if (This->thread.download_start && This->thread.downloaded_kb && elapsed > 100) - progress->dwDownloadSecsRemaining = (progress->dwDownloadKBRemaining * elapsed) / (This->thread.downloaded_kb * 1000); - else - progress->dwDownloadSecsRemaining = -1; - - progress->dwInstallKBRemaining = 0; - progress->dwInstallSecsRemaining = -1; - - return S_OK; -} - -static const IInstallEngineTimingVtbl InstallEngineTimingVtbl = -{ - InstallEngineTiming_QueryInterface, - InstallEngineTiming_AddRef, - InstallEngineTiming_Release, - InstallEngineTiming_GetRates, - InstallEngineTiming_GetInstallProgress, -}; - static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFIID riid, void **ppv) { *ppv = NULL; @@ -1230,14 +350,12 @@ static HRESULT WINAPI InstallEngineCF_CreateInstance(IClassFactory *iface, IUnkn TRACE("(%p %s %p)\n", outer, debugstr_guid(riid), ppv); - engine = heap_zero_alloc(sizeof(*engine)); + engine = heap_alloc(sizeof(*engine)); if(!engine) return E_OUTOFMEMORY; engine->IInstallEngine2_iface.lpVtbl = &InstallEngine2Vtbl; - engine->IInstallEngineTiming_iface.lpVtbl = &InstallEngineTimingVtbl; engine->ref = 1; - engine->status = ENGINESTATUS_NOTREADY; hres = IInstallEngine2_QueryInterface(&engine->IInstallEngine2_iface, riid, ppv); IInstallEngine2_Release(&engine->IInstallEngine2_iface); diff --git a/dll/win32/inseng/inseng_private.h b/dll/win32/inseng/inseng_private.h deleted file mode 100644 index d6862ea413..0000000000 --- a/dll/win32/inseng/inseng_private.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright 2016 Michael Müller - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#ifndef _INSENG_PRIVATE_H -#define _INSENG_PRIVATE_H - -#define WIN32_NO_STATUS -#define _INC_WINDOWS -#define COM_NO_WINDOWS_H - -#define COBJMACROS - -#include <config.h> - -#include <windef.h> -#include <winbase.h> -#include <ole2.h> -#include <inseng.h> - -#include <wine/list.h> -#include <wine/unicode.h> - -#include <wine/debug.h> - -WINE_DEFAULT_DEBUG_CHANNEL(inseng); - -static inline void* __WINE_ALLOC_SIZE(1) heap_alloc(size_t size) -{ - return HeapAlloc(GetProcessHeap(), 0, size); -} - -static inline void *heap_zero_alloc(size_t len) -{ - return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len); -} - -static inline BOOL heap_free(void *mem) -{ - return HeapFree(GetProcessHeap(), 0, mem); -} - -static inline char *strdupA(const char *src) -{ - char *dest = heap_alloc(strlen(src) + 1); - if (dest) strcpy(dest, src); - return dest; -} - -static inline WCHAR *strdupW(const WCHAR *src) -{ - WCHAR *dest; - if (!src) return NULL; - dest = HeapAlloc(GetProcessHeap(), 0, (strlenW(src) + 1) * sizeof(WCHAR)); - if (dest) strcpyW(dest, src); - return dest; -} - -static inline LPWSTR strAtoW(const char *str) -{ - LPWSTR ret = NULL; - - if (str) - { - DWORD len = MultiByteToWideChar( CP_ACP, 0, str, -1, NULL, 0 ); - if ((ret = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)))) - MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len); - } - - return ret; -} - -struct inf_value; -struct inf_section; -struct inf_file; - -HRESULT inf_load(const char *path, struct inf_file **inf_file) DECLSPEC_HIDDEN; -void inf_free(struct inf_file *inf) DECLSPEC_HIDDEN; - -BOOL inf_next_section(struct inf_file *inf, struct inf_section **sec) DECLSPEC_HIDDEN; -struct inf_section *inf_get_section(struct inf_file *inf, const char *name) DECLSPEC_HIDDEN; -char *inf_section_get_name(struct inf_section *section) DECLSPEC_HIDDEN; -BOOL inf_section_next_value(struct inf_section *sec, struct inf_value **value) DECLSPEC_HIDDEN; - -struct inf_value *inf_get_value(struct inf_section *sec, const char *key) DECLSPEC_HIDDEN; -char *inf_value_get_key(struct inf_value *value) DECLSPEC_HIDDEN; -char *inf_value_get_value(struct inf_value *value) DECLSPEC_HIDDEN; - -char *trim(char *str, char **last_chr, BOOL strip_quotes) DECLSPEC_HIDDEN; - -void component_set_actual_download_size(ICifComponent *iface, DWORD size) DECLSPEC_HIDDEN; -void component_set_downloaded(ICifComponent *iface, BOOL value) DECLSPEC_HIDDEN; -void component_set_installed(ICifComponent *iface, BOOL value) DECLSPEC_HIDDEN; - char *component_get_id(ICifComponent *iface) DECLSPEC_HIDDEN; - -#endif /* _INSENG_PRIVATE_H */ diff --git a/media/doc/README.WINE b/media/doc/README.WINE index 15d8e3f5d3..2e3b15e1d6 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -81,7 +81,7 @@ reactos/dll/win32/imm32 # Synced to Wine-2.22 reactos/dll/win32/inetcomm # Synced to Wine-3.0 reactos/dll/win32/inetmib1 # Synced to WineStaging-2.9 reactos/dll/win32/initpki # Synced to WineStaging-2.9 -reactos/dll/win32/inseng # Synced to WineStaging-2.9 +reactos/dll/win32/inseng # Synced to Wine-3.0 reactos/dll/win32/iphlpapi # Out of sync reactos/dll/win32/itircl # Synced to WineStaging-2.9 reactos/dll/win32/itss # Synced to WineStaging-2.9
6 years, 11 months
1
0
0
0
← Newer
1
...
21
22
23
24
25
26
27
...
38
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
Results per page:
10
25
50
100
200