Wine-Devel
By thread
wine-devel@list.winehq.org
By month
Messages by month
- ----- 2026 -----
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
September 2018
- 70 participants
- 1549 messages
[PATCH] testbot: Run the patched tests on Wine.
by Francois Gouget
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
---
testbot/bin/CheckForWinetestUpdate.pl | 4 +-
testbot/bin/WineRunWineTest.pl | 53 +++++++++++++++++++----
testbot/bin/build/WineTest.pl | 61 ++++++++++++++++++++++++++-
testbot/lib/WineTestBot/Config.pm | 8 ++--
testbot/lib/WineTestBot/PatchUtils.pm | 17 +++++++-
testbot/lib/WineTestBot/Patches.pm | 5 ++-
testbot/web/Submit.pl | 9 ++--
7 files changed, 133 insertions(+), 24 deletions(-)
diff --git a/testbot/bin/CheckForWinetestUpdate.pl b/testbot/bin/CheckForWinetestUpdate.pl
index 991cdeb0f..29953642e 100755
--- a/testbot/bin/CheckForWinetestUpdate.pl
+++ b/testbot/bin/CheckForWinetestUpdate.pl
@@ -215,7 +215,7 @@ sub AddJob($$$)
Debug(" $VMKey $Build\n");
my $Task = $Tasks->Add();
$Task->VM($VMs->GetItem($VMKey));
- $Task->Timeout($SuiteTimeout);
+ $Task->Timeout(GetTestTimeout(undef, { $Build => 1 }));
}
# Save it all
@@ -318,7 +318,7 @@ sub AddReconfigJob($)
my $Task = $NewStep->Tasks->Add();
$Task->VM($VM);
$Task->CmdLineArg($Build);
- $Task->Timeout($SuiteTimeout);
+ $Task->Timeout(GetTestTimeout(undef, { $Build => 1 }));
}
}
}
diff --git a/testbot/bin/WineRunWineTest.pl b/testbot/bin/WineRunWineTest.pl
index 90e3403f7..0e438f957 100755
--- a/testbot/bin/WineRunWineTest.pl
+++ b/testbot/bin/WineRunWineTest.pl
@@ -382,7 +382,7 @@ if (!$VM->GetDomain()->IsPoweredOn())
FatalError("The VM is not powered on\n");
}
-if ($Step->Type ne "build" and $Step->Type ne "suite")
+if ($Step->Type ne "build" and $Step->Type ne "suite" and $Step->Type ne "single")
{
FatalError("Unexpected step type '". $Step->Type ."' found\n");
}
@@ -422,7 +422,12 @@ if (defined $FileName)
my $Script = "#!/bin/sh\n".
"( set -x\n".
- " ../bin/build/WineTest.pl ";
+ " export WINETEST_DEBUG=". $Step->DebugLevel ."\n";
+if ($Step->ReportSuccessfulTests)
+{
+ $Script .= " export WINETEST_REPORT_SUCCESS=1\n";
+}
+$Script .= " ../bin/build/WineTest.pl ";
if ($Step->Type eq "suite")
{
my $BaseTag = BuildTag($VM->Name);
@@ -460,7 +465,7 @@ Debug(Elapsed($Start), " Starting the script\n");
my $Pid = $TA->Run(["./task"], 0);
if (!$Pid)
{
- FatalTAError($TA, "Failed to start the task");
+ FatalTAError($TA, "Failed to start the test");
}
@@ -530,8 +535,9 @@ elsif (!defined $TAError)
$TAError = "An error occurred while retrieving the task log: ". $TA->GetLastError();
}
+
#
-# Grab the test logs if any
+# Grab the test reports if any
#
if ($Step->Type ne "build")
@@ -585,14 +591,45 @@ if ($Step->Type ne "build")
Debug(Elapsed($Start), " Disconnecting\n");
$TA->Disconnect();
-# Report the task errors even though they may have been caused by
-# TestAgent trouble.
-LogTaskError($ErrMessage) if (defined $ErrMessage);
-FatalTAError(undef, $TAError, $PossibleCrash) if (defined $TAError);
+
+#
+# Grab a copy of the reference logs
+#
+
+# Note that this may be a bit inaccurate right after a Wine commit.
+# See WineSendLog.pl for more details.
+if ($NewStatus eq 'completed')
+{
+ my $LatestDir = "$DataDir/latest";
+ my $StepDir = $Step->GetDir();
+ my $BuildList = $Task->CmdLineArg;
+ $BuildList =~ s/ .*$//;
+ foreach my $Build (split /,/, $BuildList)
+ {
+ my $RptFileName = "$Build.report";
+ my $RefReport = $Task->VM->Name ."_$RptFileName";
+ for my $Suffix ("", ".err")
+ {
+ if (-f "$LatestDir/$RefReport$Suffix")
+ {
+ unlink "$StepDir/$RefReport$Suffix";
+ if (!link "$LatestDir/$RefReport$Suffix", "$StepDir/$RefReport$Suffix")
+ {
+ Error "Could not link '$RefReport$Suffix': $!\n";
+ }
+ }
+ }
+ }
+}
#
# Wrap up
#
+# Report the task errors even though they may have been caused by
+# TestAgent trouble.
+LogTaskError($ErrMessage) if (defined $ErrMessage);
+FatalTAError(undef, $TAError, $PossibleCrash) if (defined $TAError);
+
WrapUpAndExit($NewStatus, $TaskFailures, undef, $TaskTimedOut);
diff --git a/testbot/bin/build/WineTest.pl b/testbot/bin/build/WineTest.pl
index 9be73a42f..2b26a41ab 100755
--- a/testbot/bin/build/WineTest.pl
+++ b/testbot/bin/build/WineTest.pl
@@ -107,6 +107,46 @@ sub DailyWineTest($$$$$)
return 1;
}
+sub TestPatch($$$)
+{
+ my ($Targets, $Build, $Impacts) = @_;
+
+ return 1 if (!$Targets->{"test$Build"});
+
+ my @TestList;
+ foreach my $Module (sort keys %{$Impacts->{Tests}})
+ {
+ my $TestInfo = $Impacts->{Tests}->{$Module};
+ if ($TestInfo->{All})
+ {
+ push @TestList, $Module;
+ }
+ else
+ {
+ foreach my $Unit (sort keys %{$TestInfo->{Units}})
+ {
+ push @TestList, "$Module:$Unit";
+ }
+ }
+ }
+ return 1 if (!@TestList);
+
+ InfoMsg "\nRunning the tests in the $Build Wine\n";
+ SetupWineEnvironment($Build);
+
+ # Run WineTest. Ignore the exit code since it returns non-zero whenever
+ # there are test failures.
+ RunWine($Build, "./programs/winetest/winetest.exe.so",
+ "-c -o '../$Build.report' -t test-$Build ". join(" ", @TestList));
+ if (!-f "$Build.report")
+ {
+ LogMsg "WineTest did not produce a report file\n";
+ return 0;
+ }
+
+ return 1;
+}
+
#
# Setup and command line processing
@@ -226,6 +266,20 @@ if (!defined $Usage)
$Usage = 2;
}
}
+ else
+ {
+ foreach my $Build ("win32", "wow32", "wow64")
+ {
+ $Targets->{"test$Build"} = 1 if ($Targets->{$Build});
+ }
+ if ($Targets->{"wow32"} or $Targets->{"wow64"})
+ {
+ # Always rebuild both WoW targets before running the tests to make sure
+ # we don't run into issues caused by the two Wine builds being out of
+ # sync.
+ $Targets->{"wow32"} = $Targets->{"wow64"} = 1;
+ }
+ }
if (!defined $FileName and $Action eq "testpatch")
{
@@ -247,7 +301,7 @@ if (defined $Usage)
print "Tests the specified patch or runs WineTest in Wine.\n";
print "\n";
print "Where:\n";
- print " --testpatch Verify that the patch compiles.\n";
+ print " --testpatch Verify that the patch compiles and run the impacted tests.\n";
print " --winetest Run WineTest and submit the result to the website.\n";
print " --no-submit Do not submit the WineTest results to the website.\n";
print " TARGETS Is a comma-separated list of targets for the specified action.\n";
@@ -282,7 +336,10 @@ if ($Action eq "testpatch")
exit(1) if (!$Impacts or
!BuildWine($Targets, "win32") or
!BuildWine($Targets, "wow64") or
- !BuildWine($Targets, "wow32"));
+ !BuildWine($Targets, "wow32") or
+ !TestPatch($Targets, "win32", $Impacts) or
+ !TestPatch($Targets, "wow64", $Impacts) or
+ !TestPatch($Targets, "wow32", $Impacts));
}
elsif ($Action eq "winetest")
{
diff --git a/testbot/lib/WineTestBot/Config.pm b/testbot/lib/WineTestBot/Config.pm
index 157617780..44692295e 100644
--- a/testbot/lib/WineTestBot/Config.pm
+++ b/testbot/lib/WineTestBot/Config.pm
@@ -33,7 +33,7 @@ use vars qw (@ISA @EXPORT @EXPORT_OK $UseSSL $LogDir $DataDir $BinDir
$WinePatchToOverride $WinePatchCc
$ExeBuildNativeTimeout $ExeBuildTestTimeout $ExeModuleTimeout
$WineBuildTimeout $WineModuleTimeout $TimeoutMargin
- $SuiteTimeout $SingleTimeout $MaxUnitSize
+ $SuiteTimeout $SingleTimeout $SingleAvgTime $MaxUnitSize
$TagPrefix $ProjectName $PatchesMailingList $LDAPServer
$LDAPBindDN $LDAPSearchBase $LDAPSearchFilter
$LDAPRealNameAttribute $LDAPEMailAttribute $AgentPort $Tunnel
@@ -49,7 +49,7 @@ require Exporter;
$RobotEMail $WinePatchToOverride $WinePatchCc $SuiteTimeout
$ExeBuildNativeTimeout $ExeBuildTestTimeout $ExeModuleTimeout
$WineBuildTimeout $WineModuleTimeout $TimeoutMargin
- $SuiteTimeout $SingleTimeout $MaxUnitSize
+ $SuiteTimeout $SingleTimeout $SingleAvgTime $MaxUnitSize
$TagPrefix $ProjectName $PatchesMailingList
$LDAPServer $LDAPBindDN $LDAPSearchBase $LDAPSearchFilter
$LDAPRealNameAttribute $LDAPEMailAttribute $AgentPort $Tunnel
@@ -112,8 +112,10 @@ $TimeoutMargin = 2 * 60;
# Test timeouts (in seconds)
# - For the whole test suite
$SuiteTimeout = 30 * 60;
-# - For a single test
+# - For the first two tests
$SingleTimeout = 2 * 60;
+# - For extra tests
+$SingleAvgTime = 2;
# Maximum amount of traces for a test unit.
$MaxUnitSize = 32 * 1024;
diff --git a/testbot/lib/WineTestBot/PatchUtils.pm b/testbot/lib/WineTestBot/PatchUtils.pm
index f03cc40bb..502a781f6 100644
--- a/testbot/lib/WineTestBot/PatchUtils.pm
+++ b/testbot/lib/WineTestBot/PatchUtils.pm
@@ -32,7 +32,7 @@ the Wine builds.
use Exporter 'import';
our @EXPORT = qw(GetPatchImpacts LastPartSeparator UpdateWineData
- GetBuildTimeout);
+ GetBuildTimeout GetTestTimeout);
use List::Util qw(min max);
@@ -478,4 +478,19 @@ sub GetBuildTimeout($$)
return $ExeTimeout + $WineTimeout;
}
+sub GetTestTimeout($$)
+{
+ my ($Impacts, $Builds) = @_;
+
+ my $Timeout = $SuiteTimeout;
+ if ($Impacts)
+ {
+ my $UnitCount = $Impacts->{TestUnitCount};
+ my $TestsTimeout = min(2, $UnitCount) * $SingleTimeout +
+ max(0, $UnitCount - 2) * $SingleAvgTime;
+ $Timeout = min($SuiteTimeout, $TestsTimeout);
+ }
+ return scalar(keys %$Builds) * $Timeout;
+}
+
1;
diff --git a/testbot/lib/WineTestBot/Patches.pm b/testbot/lib/WineTestBot/Patches.pm
index 96e4a0dda..f685e86b3 100644
--- a/testbot/lib/WineTestBot/Patches.pm
+++ b/testbot/lib/WineTestBot/Patches.pm
@@ -245,7 +245,7 @@ sub Submit($$$)
my $NewStep = $NewJob->Steps->Add();
$NewStep->FileName("patch.diff");
$NewStep->FileType("patch");
- $NewStep->Type("build");
+ $NewStep->Type("single");
$NewStep->DebugLevel(0);
# And a task for each VM
@@ -258,7 +258,8 @@ sub Submit($$$)
$Task->VM($VM);
# Only verify that the win32 version compiles
my $Builds = { "win32" => 1 };
- $Task->Timeout(GetBuildTimeout($Impacts, $Builds));
+ $Task->Timeout(GetBuildTimeout($Impacts, $Builds) +
+ GetTestTimeout($Impacts, $Builds));
$Task->CmdLineArg(join(",", keys %$Builds));
}
}
diff --git a/testbot/web/Submit.pl b/testbot/web/Submit.pl
index 9ad8fd5e0..d0da7a249 100644
--- a/testbot/web/Submit.pl
+++ b/testbot/web/Submit.pl
@@ -276,10 +276,6 @@ sub GenerateFields($)
$Status = " [". $VM->Status ."]";
$Checked = undef;
}
- elsif ($VM->Type eq "wine")
- {
- $Checked = undef;
- }
if ($Checked and
($self->GetParam("Page") == 1 || $self->GetParam($FieldName)))
{
@@ -876,7 +872,7 @@ sub SubmitJob($$$)
my $WineStep = $Steps->Add();
$WineStep->FileName($BaseName);
$WineStep->FileType($FileType);
- $WineStep->Type("build");
+ $WineStep->Type("single");
$WineStep->DebugLevel($self->GetParam("DebugLevel"));
$WineStep->ReportSuccessfulTests(defined($self->GetParam("ReportSuccessfulTests")));
$Tasks = $WineStep->Tasks;
@@ -884,7 +880,8 @@ sub SubmitJob($$$)
if (!defined $Timeout)
{
my $Builds = { $Build => 1 };
- $Timeout = GetBuildTimeout($Impacts, $Builds);
+ $Timeout = GetBuildTimeout($Impacts, $Builds) +
+ GetTestTimeout($Impacts, $Builds);
}
# Then add a task for this VM
--
2.19.0
Sept. 25, 2018
[PATCH] crypt32: Fix NULL output buffer handling for CryptBinaryToString().
by Nikolay Sivov
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/crypt32/base64.c | 98 +++++++++++++++++--------------
dlls/crypt32/tests/base64.c | 111 ++++++++++++++++++++++++++----------
2 files changed, 136 insertions(+), 73 deletions(-)
diff --git a/dlls/crypt32/base64.c b/dlls/crypt32/base64.c
index bc30779098..e25e4c10ff 100644
--- a/dlls/crypt32/base64.c
+++ b/dlls/crypt32/base64.c
@@ -215,36 +215,41 @@ static BOOL BinaryToBase64A(const BYTE *pbBinary,
charsNeeded += strlen(header) + strlen(sep);
if (trailer)
charsNeeded += strlen(trailer) + strlen(sep);
- if (charsNeeded <= *pcchString)
- {
- LPSTR ptr = pszString;
- DWORD size = charsNeeded;
- if (header)
+ if (pszString)
+ {
+ if (charsNeeded <= *pcchString)
{
- strcpy(ptr, header);
- ptr += strlen(ptr);
- strcpy(ptr, sep);
- ptr += strlen(sep);
+ LPSTR ptr = pszString;
+ DWORD size = charsNeeded;
+
+ if (header)
+ {
+ strcpy(ptr, header);
+ ptr += strlen(ptr);
+ strcpy(ptr, sep);
+ ptr += strlen(sep);
+ }
+ encodeBase64A(pbBinary, cbBinary, sep, ptr, &size);
+ ptr += size - 1;
+ if (trailer)
+ {
+ strcpy(ptr, trailer);
+ ptr += strlen(ptr);
+ strcpy(ptr, sep);
+ }
+ *pcchString = charsNeeded - 1;
}
- encodeBase64A(pbBinary, cbBinary, sep, ptr, &size);
- ptr += size - 1;
- if (trailer)
+ else
{
- strcpy(ptr, trailer);
- ptr += strlen(ptr);
- strcpy(ptr, sep);
+ *pcchString = charsNeeded;
+ SetLastError(ERROR_INSUFFICIENT_BUFFER);
+ ret = FALSE;
}
- *pcchString = charsNeeded - 1;
- }
- else if (pszString)
- {
- *pcchString = charsNeeded;
- SetLastError(ERROR_INSUFFICIENT_BUFFER);
- ret = FALSE;
}
else
*pcchString = charsNeeded;
+
return ret;
}
@@ -409,36 +414,41 @@ static BOOL BinaryToBase64W(const BYTE *pbBinary,
charsNeeded += strlenW(header) + strlenW(sep);
if (trailer)
charsNeeded += strlenW(trailer) + strlenW(sep);
- if (charsNeeded <= *pcchString)
- {
- LPWSTR ptr = pszString;
- DWORD size = charsNeeded;
- if (header)
+ if (pszString)
+ {
+ if (charsNeeded <= *pcchString)
{
- strcpyW(ptr, header);
- ptr += strlenW(ptr);
- strcpyW(ptr, sep);
- ptr += strlenW(sep);
+ LPWSTR ptr = pszString;
+ DWORD size = charsNeeded;
+
+ if (header)
+ {
+ strcpyW(ptr, header);
+ ptr += strlenW(ptr);
+ strcpyW(ptr, sep);
+ ptr += strlenW(sep);
+ }
+ encodeBase64W(pbBinary, cbBinary, sep, ptr, &size);
+ ptr += size - 1;
+ if (trailer)
+ {
+ strcpyW(ptr, trailer);
+ ptr += strlenW(ptr);
+ strcpyW(ptr, sep);
+ }
+ *pcchString = charsNeeded - 1;
}
- encodeBase64W(pbBinary, cbBinary, sep, ptr, &size);
- ptr += size - 1;
- if (trailer)
+ else
{
- strcpyW(ptr, trailer);
- ptr += strlenW(ptr);
- strcpyW(ptr, sep);
+ *pcchString = charsNeeded;
+ SetLastError(ERROR_INSUFFICIENT_BUFFER);
+ ret = FALSE;
}
- *pcchString = charsNeeded - 1;
- }
- else if (pszString)
- {
- *pcchString = charsNeeded;
- SetLastError(ERROR_INSUFFICIENT_BUFFER);
- ret = FALSE;
}
else
*pcchString = charsNeeded;
+
return ret;
}
diff --git a/dlls/crypt32/tests/base64.c b/dlls/crypt32/tests/base64.c
index 7bc1ec7d0e..2249e1bf5a 100644
--- a/dlls/crypt32/tests/base64.c
+++ b/dlls/crypt32/tests/base64.c
@@ -96,60 +96,113 @@ static WCHAR *strdupAtoW(const char *str)
static void encodeAndCompareBase64_A(const BYTE *toEncode, DWORD toEncodeLen,
DWORD format, const char *expected, const char *header, const char *trailer)
{
- DWORD strLen = 0;
+ DWORD strLen, strLen2;
+ const char *ptr;
LPSTR str = NULL;
BOOL ret;
+ strLen = 0;
ret = CryptBinaryToStringA(toEncode, toEncodeLen, format, NULL, &strLen);
ok(ret, "CryptBinaryToStringA failed: %d\n", GetLastError());
- str = HeapAlloc(GetProcessHeap(), 0, strLen);
- if (str)
- {
- DWORD strLen2 = strLen;
- LPCSTR ptr = str;
+ ok(strLen > 0, "Unexpected required length.\n");
- ret = CryptBinaryToStringA(toEncode, toEncodeLen, format, str,
- &strLen2);
- ok(ret, "CryptBinaryToStringA failed: %d\n", GetLastError());
- ok(strLen2 == strLen - 1, "Expected length %d, got %d\n",
- strLen - 1, strLen);
- if (header)
- {
- ok(!strncmp(header, ptr, strlen(header)),
- "Expected header %s, got %s\n", header, ptr);
- ptr += strlen(header);
- }
- ok(!strncmp(expected, ptr, strlen(expected)),
- "Expected %s, got %s\n", expected, ptr);
- ptr += strlen(expected);
- if (trailer)
- ok(!strncmp(trailer, ptr, strlen(trailer)),
- "Expected trailer %s, got %s\n", trailer, ptr);
- HeapFree(GetProcessHeap(), 0, str);
+ strLen2 = strLen;
+ ret = CryptBinaryToStringA(toEncode, toEncodeLen, format, NULL, &strLen2);
+ ok(ret, "CryptBinaryToStringA failed: %d\n", GetLastError());
+ ok(strLen == strLen2, "Unexpected required length.\n");
+
+ strLen2 = strLen - 1;
+ ret = CryptBinaryToStringA(toEncode, toEncodeLen, format, NULL, &strLen2);
+ ok(ret, "CryptBinaryToStringA failed: %d\n", GetLastError());
+ ok(strLen == strLen2, "Unexpected required length.\n");
+
+ str = heap_alloc(strLen);
+
+ /* Partially filled output buffer. */
+ strLen2 = strLen - 1;
+ str[0] = 0x12;
+ ret = CryptBinaryToStringA(toEncode, toEncodeLen, format, str, &strLen2);
+todo_wine
+ ok((!ret && GetLastError() == ERROR_MORE_DATA) || broken(ret) /* XP */, "CryptBinaryToStringA failed %d, error %d.\n",
+ ret, GetLastError());
+ ok(strLen2 == strLen || broken(strLen2 == strLen - 1), "Expected length %d, got %d\n", strLen - 1, strLen);
+todo_wine {
+ if (header)
+ ok(str[0] == header[0], "Unexpected buffer contents %#x.\n", str[0]);
+ else
+ ok(str[0] == expected[0], "Unexpected buffer contents %#x.\n", str[0]);
+}
+ strLen2 = strLen;
+ ret = CryptBinaryToStringA(toEncode, toEncodeLen, format, str, &strLen2);
+ ok(ret, "CryptBinaryToStringA failed: %d\n", GetLastError());
+ ok(strLen2 == strLen - 1, "Expected length %d, got %d\n", strLen - 1, strLen);
+
+ ptr = str;
+ if (header)
+ {
+ ok(!strncmp(header, ptr, strlen(header)), "Expected header %s, got %s\n", header, ptr);
+ ptr += strlen(header);
}
+ ok(!strncmp(expected, ptr, strlen(expected)), "Expected %s, got %s\n", expected, ptr);
+ ptr += strlen(expected);
+ if (trailer)
+ ok(!strncmp(trailer, ptr, strlen(trailer)), "Expected trailer %s, got %s\n", trailer, ptr);
+
+ heap_free(str);
}
static void encode_compare_base64_W(const BYTE *toEncode, DWORD toEncodeLen, DWORD format,
const WCHAR *expected, const char *header, const char *trailer)
{
WCHAR *headerW, *trailerW;
- DWORD strLen = 0, strLen2;
+ DWORD strLen, strLen2;
+ WCHAR *strW = NULL;
const WCHAR *ptr;
- WCHAR *strW;
BOOL ret;
+ strLen = 0;
ret = CryptBinaryToStringW(toEncode, toEncodeLen, format, NULL, &strLen);
ok(ret, "CryptBinaryToStringW failed: %d\n", GetLastError());
+ ok(strLen > 0, "Unexpected required length.\n");
+ /* Same call with non-zero length value. */
strLen2 = strLen;
- strW = heap_alloc(strLen * sizeof(WCHAR));
- ret = CryptBinaryToStringW(toEncode, toEncodeLen, format, strW, &strLen2);
+ ret = CryptBinaryToStringW(toEncode, toEncodeLen, format, NULL, &strLen2);
ok(ret, "CryptBinaryToStringW failed: %d\n", GetLastError());
- ok(strLen2 == strLen - 1, "Expected length %d, got %d\n", strLen - 1, strLen);
+ ok(strLen == strLen2, "Unexpected required length.\n");
+
+ strLen2 = strLen - 1;
+ ret = CryptBinaryToStringW(toEncode, toEncodeLen, format, NULL, &strLen2);
+ ok(ret, "CryptBinaryToStringW failed: %d\n", GetLastError());
+ ok(strLen == strLen2, "Unexpected required length.\n");
+
+ strLen2 = strLen - 1;
+ ret = CryptBinaryToStringW(toEncode, toEncodeLen, format, NULL, &strLen2);
+ ok(ret, "CryptBinaryToStringW failed: %d\n", GetLastError());
+ ok(strLen == strLen2, "Unexpected required length.\n");
+
+ strW = heap_alloc(strLen * sizeof(WCHAR));
headerW = strdupAtoW(header);
trailerW = strdupAtoW(trailer);
+ strLen2 = strLen - 1;
+ strW[0] = 0x1234;
+ ret = CryptBinaryToStringW(toEncode, toEncodeLen, format, strW, &strLen2);
+todo_wine
+ ok((!ret && GetLastError() == ERROR_MORE_DATA) || broken(ret) /* XP */, "CryptBinaryToStringW failed, %d, error %d\n",
+ ret, GetLastError());
+ if (headerW)
+ ok(strW[0] == 0x1234, "Unexpected buffer contents %#x.\n", strW[0]);
+ else
+ ok(strW[0] == 0x1234 || broken(strW[0] != 0x1234) /* XP */, "Unexpected buffer contents %#x.\n", strW[0]);
+
+ strLen2 = strLen;
+ ret = CryptBinaryToStringW(toEncode, toEncodeLen, format, strW, &strLen2);
+ ok(ret, "CryptBinaryToStringW failed: %d\n", GetLastError());
+
+ ok(strLen2 == strLen - 1, "Expected length %d, got %d\n", strLen - 1, strLen);
+
ptr = strW;
if (headerW)
{
--
2.19.0
Sept. 25, 2018
[PATCH 5/5] ddraw: Do not request 3D-usages for DDRAW_NO3D surfaces.
by Henri Verbeet
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
---
dlls/ddraw/surface.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c
index c51db7661ab..fc120e390eb 100644
--- a/dlls/ddraw/surface.c
+++ b/dlls/ddraw/surface.c
@@ -6152,12 +6152,15 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_
}
else
{
- if (desc->ddsCaps.dwCaps & DDSCAPS_TEXTURE)
- wined3d_desc.usage |= WINED3DUSAGE_TEXTURE;
- if (desc->ddsCaps.dwCaps & DDSCAPS_ZBUFFER)
- wined3d_desc.usage |= WINED3DUSAGE_DEPTHSTENCIL;
- else if (desc->ddsCaps.dwCaps & DDSCAPS_3DDEVICE)
- wined3d_desc.usage |= WINED3DUSAGE_RENDERTARGET;
+ if (!(ddraw->flags & DDRAW_NO3D))
+ {
+ if (desc->ddsCaps.dwCaps & DDSCAPS_TEXTURE)
+ wined3d_desc.usage |= WINED3DUSAGE_TEXTURE;
+ if (desc->ddsCaps.dwCaps & DDSCAPS_ZBUFFER)
+ wined3d_desc.usage |= WINED3DUSAGE_DEPTHSTENCIL;
+ else if (desc->ddsCaps.dwCaps & DDSCAPS_3DDEVICE)
+ wined3d_desc.usage |= WINED3DUSAGE_RENDERTARGET;
+ }
if (desc->ddsCaps.dwCaps2 & (DDSCAPS2_TEXTUREMANAGE | DDSCAPS2_D3DTEXTUREMANAGE))
{
--
2.11.0
Sept. 25, 2018
[PATCH 4/5] wined3d: Move "texture_size" from struct wined3d_gl_limits to struct wined3d_d3d_limits.
by Henri Verbeet
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
---
dlls/wined3d/adapter_gl.c | 6 +++---
dlls/wined3d/directx.c | 6 +++---
dlls/wined3d/texture.c | 2 +-
dlls/wined3d/wined3d_private.h | 2 +-
4 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/dlls/wined3d/adapter_gl.c b/dlls/wined3d/adapter_gl.c
index ba6c457d150..87418e1e44e 100644
--- a/dlls/wined3d/adapter_gl.c
+++ b/dlls/wined3d/adapter_gl.c
@@ -2853,7 +2853,7 @@ static void wined3d_adapter_init_limits(struct wined3d_gl_info *gl_info, struct
}
gl_info->gl_ops.gl.p_glGetIntegerv(GL_MAX_TEXTURE_SIZE, &gl_max);
- gl_info->limits.texture_size = gl_max;
+ d3d_info->limits.texture_size = gl_max;
TRACE("Maximum texture size support - max texture size %d.\n", gl_max);
gl_info->gl_ops.gl.p_glGetFloatv(gl_info->supported[WINED3D_GL_LEGACY_CONTEXT]
@@ -3143,8 +3143,8 @@ static void wined3d_adapter_init_limits(struct wined3d_gl_info *gl_info, struct
}
else
{
- gl_info->limits.framebuffer_width = gl_info->limits.texture_size;
- gl_info->limits.framebuffer_height = gl_info->limits.texture_size;
+ gl_info->limits.framebuffer_width = d3d_info->limits.texture_size;
+ gl_info->limits.framebuffer_height = d3d_info->limits.texture_size;
}
gl_info->limits.samplers[WINED3D_SHADER_TYPE_PIXEL] =
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index 2d1368a8553..a6184862d1d 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -2136,8 +2136,8 @@ HRESULT CDECL wined3d_get_device_caps(const struct wined3d *wined3d, UINT adapte
* idea how generating the smoothing alpha values works; the result is different
*/
- caps->MaxTextureWidth = gl_info->limits.texture_size;
- caps->MaxTextureHeight = gl_info->limits.texture_size;
+ caps->MaxTextureWidth = d3d_info->limits.texture_size;
+ caps->MaxTextureHeight = d3d_info->limits.texture_size;
if (gl_info->supported[EXT_TEXTURE3D])
caps->MaxVolumeExtent = gl_info->limits.texture3d_size;
@@ -2145,7 +2145,7 @@ HRESULT CDECL wined3d_get_device_caps(const struct wined3d *wined3d, UINT adapte
caps->MaxVolumeExtent = 0;
caps->MaxTextureRepeat = 32768;
- caps->MaxTextureAspectRatio = gl_info->limits.texture_size;
+ caps->MaxTextureAspectRatio = d3d_info->limits.texture_size;
caps->MaxVertexW = 1.0f;
caps->GuardBandLeft = 0.0f;
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index fdf26512b91..c0bdddcaa09 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -2687,7 +2687,7 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc
texture->pow2_width = pow2_width;
texture->pow2_height = pow2_height;
- if ((pow2_width > gl_info->limits.texture_size || pow2_height > gl_info->limits.texture_size)
+ if ((pow2_width > d3d_info->limits.texture_size || pow2_height > d3d_info->limits.texture_size)
&& (desc->usage & WINED3DUSAGE_TEXTURE))
{
/* One of four options:
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 46b47ddbf15..941bfa68fad 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -166,6 +166,7 @@ struct wined3d_d3d_limits
unsigned int max_rt_count;
unsigned int max_clip_distances;
+ unsigned int texture_size;
float pointsize_max;
};
@@ -2540,7 +2541,6 @@ struct wined3d_gl_limits
unsigned int combined_samplers;
UINT general_combiners;
UINT user_clip_distances;
- UINT texture_size;
UINT texture3d_size;
UINT anisotropy;
float shininess;
--
2.11.0
Sept. 25, 2018
[PATCH 3/5] wined3d: Get rid of the "pointsize_min" and "pointsize_max" fields from struct wined3d_gl_limits.
by Henri Verbeet
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
---
dlls/wined3d/adapter_gl.c | 8 +++-----
dlls/wined3d/wined3d_private.h | 2 --
2 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/dlls/wined3d/adapter_gl.c b/dlls/wined3d/adapter_gl.c
index 1722438a5a1..ba6c457d150 100644
--- a/dlls/wined3d/adapter_gl.c
+++ b/dlls/wined3d/adapter_gl.c
@@ -2811,7 +2811,7 @@ static void load_gl_funcs(struct wined3d_gl_info *gl_info)
#undef MAP_GL_FUNCTION_CAST
}
-static void wined3d_adapter_init_limits(struct wined3d_gl_info *gl_info)
+static void wined3d_adapter_init_limits(struct wined3d_gl_info *gl_info, struct wined3d_d3d_info *d3d_info)
{
unsigned int i, sampler_count;
GLfloat gl_floatv[2];
@@ -2858,8 +2858,7 @@ static void wined3d_adapter_init_limits(struct wined3d_gl_info *gl_info)
gl_info->gl_ops.gl.p_glGetFloatv(gl_info->supported[WINED3D_GL_LEGACY_CONTEXT]
? GL_ALIASED_POINT_SIZE_RANGE : GL_POINT_SIZE_RANGE, gl_floatv);
- gl_info->limits.pointsize_min = gl_floatv[0];
- gl_info->limits.pointsize_max = gl_floatv[1];
+ d3d_info->limits.pointsize_max = gl_floatv[1];
TRACE("Maximum point size support - max point size %f.\n", gl_floatv[1]);
if (gl_info->supported[ARB_MAP_BUFFER_ALIGNMENT])
@@ -3630,7 +3629,7 @@ static BOOL wined3d_adapter_init_gl_caps(struct wined3d_adapter *adapter,
gl_info->supported[ARB_TEXTURE_MULTISAMPLE] = FALSE;
}
- wined3d_adapter_init_limits(gl_info);
+ wined3d_adapter_init_limits(gl_info, d3d_info);
if (gl_info->supported[ARB_VERTEX_PROGRAM] && test_arb_vs_offset_limit(gl_info))
gl_info->quirks |= WINED3D_QUIRK_ARB_VS_OFFSET_LIMIT;
@@ -3657,7 +3656,6 @@ static BOOL wined3d_adapter_init_gl_caps(struct wined3d_adapter *adapter,
d3d_info->limits.max_rt_count = gl_info->limits.buffers;
d3d_info->limits.max_clip_distances = gl_info->limits.user_clip_distances;
- d3d_info->limits.pointsize_max = gl_info->limits.pointsize_max;
adapter->shader_backend->shader_get_caps(gl_info, &shader_caps);
d3d_info->vs_clipping = shader_caps.wined3d_caps & WINED3D_SHADER_CAP_VS_CLIPPING;
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 40a27ffcf26..46b47ddbf15 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2542,8 +2542,6 @@ struct wined3d_gl_limits
UINT user_clip_distances;
UINT texture_size;
UINT texture3d_size;
- float pointsize_max;
- float pointsize_min;
UINT anisotropy;
float shininess;
UINT samples;
--
2.11.0
Sept. 25, 2018
[PATCH 2/5] wined3d: Set a feature level for NO3D adapters.
by Henri Verbeet
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
---
dlls/wined3d/directx.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index c25d84747eb..2d1368a8553 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -2465,6 +2465,7 @@ static void wined3d_adapter_no3d_init_d3d_info(struct wined3d_adapter *adapter,
d3d_info->wined3d_creation_flags = wined3d_creation_flags;
d3d_info->texture_npot = TRUE;
+ d3d_info->feature_level = WINED3D_FEATURE_LEVEL_5;
}
static BOOL wined3d_adapter_no3d_init(struct wined3d_adapter *adapter, DWORD wined3d_creation_flags)
--
2.11.0
Sept. 25, 2018
[PATCH 1/5] wined3d: Support NPOT textures on NO3D adapters.
by Henri Verbeet
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
---
dlls/wined3d/directx.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index 97037b6f97d..c25d84747eb 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -2464,6 +2464,7 @@ static void wined3d_adapter_no3d_init_d3d_info(struct wined3d_adapter *adapter,
struct wined3d_d3d_info *d3d_info = &adapter->d3d_info;
d3d_info->wined3d_creation_flags = wined3d_creation_flags;
+ d3d_info->texture_npot = TRUE;
}
static BOOL wined3d_adapter_no3d_init(struct wined3d_adapter *adapter, DWORD wined3d_creation_flags)
--
2.11.0
Sept. 25, 2018
[PATCH] iphlpapi: add GetIpNetTable2 stub
by Austin English
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45036
Signed-off-by: Austin English <austinenglish(a)gmail.com>
---
dlls/iphlpapi/iphlpapi.spec | 2 +-
dlls/iphlpapi/iphlpapi_main.c | 11 +++++++++++
include/netioapi.h | 27 +++++++++++++++++++++++++++
include/nldef.h | 11 +++++++++++
4 files changed, 50 insertions(+), 1 deletion(-)
diff --git a/dlls/iphlpapi/iphlpapi.spec b/dlls/iphlpapi/iphlpapi.spec
index fd00cc093a..30d9ed7efe 100644
--- a/dlls/iphlpapi/iphlpapi.spec
+++ b/dlls/iphlpapi/iphlpapi.spec
@@ -108,7 +108,7 @@
#@ stub GetIpInterfaceTable
#@ stub GetIpNetEntry2
@ stdcall GetIpNetTable( ptr ptr long )
-#@ stub GetIpNetTable2
+@ stdcall GetIpNetTable2( long ptr )
@ stub GetIpNetTableFromStack
#@ stub GetIpPathEntry
#@ stub GetIpPathTable
diff --git a/dlls/iphlpapi/iphlpapi_main.c b/dlls/iphlpapi/iphlpapi_main.c
index c7140cd974..6273949147 100644
--- a/dlls/iphlpapi/iphlpapi_main.c
+++ b/dlls/iphlpapi/iphlpapi_main.c
@@ -3293,3 +3293,14 @@ DWORD WINAPI GetIpForwardTable2(ADDRESS_FAMILY family, PMIB_IPFORWARD_TABLE2 *ta
if (!once++) FIXME("(%u %p): stub\n", family, table);
return ERROR_NOT_SUPPORTED;
}
+
+/******************************************************************
+ * GetIpNetTable2 (IPHLPAPI.@)
+ */
+DWORD WINAPI GetIpNetTable2(ADDRESS_FAMILY family, PMIB_IPNET_TABLE2 *table)
+{
+ static int once;
+
+ if (!once++) FIXME("(%u %p): stub\n", family, table);
+ return ERROR_NOT_SUPPORTED;
+}
diff --git a/include/netioapi.h b/include/netioapi.h
index f15a80fdc8..6e5c2e2e25 100644
--- a/include/netioapi.h
+++ b/include/netioapi.h
@@ -193,6 +193,33 @@ typedef struct _MIB_IPFORWARD_TABLE2
MIB_IPFORWARD_ROW2 Table[ANY_SIZE];
} MIB_IPFORWARD_TABLE2, *PMIB_IPFORWARD_TABLE2;
+typedef struct _MIB_IPNET_ROW2 {
+ SOCKADDR_INET Address;
+ NET_IFINDEX InterfaceIndex;
+ NET_LUID InterfaceLuid;
+ UCHAR PhysicalAddress[IF_MAX_PHYS_ADDRESS_LENGTH];
+ ULONG PhysicalAddressLength;
+ NL_NEIGHBOR_STATE State;
+
+ union {
+ struct {
+ BOOLEAN IsRouter : 1;
+ BOOLEAN IsUnreachable : 1;
+ };
+ UCHAR Flags;
+ };
+
+ union {
+ ULONG LastReachable;
+ ULONG LastUnreachable;
+ } ReachabilityTime;
+} MIB_IPNET_ROW2, *PMIB_IPNET_ROW2;
+
+typedef struct _MIB_IPNET_TABLE2 {
+ ULONG NumEntries;
+ MIB_IPNET_ROW2 Table[ANY_SIZE];
+} MIB_IPNET_TABLE2, *PMIB_IPNET_TABLE2;
+
typedef VOID (WINAPI *PIPINTERFACE_CHANGE_CALLBACK)(PVOID, PMIB_IPINTERFACE_ROW,
MIB_NOTIFICATION_TYPE);
typedef VOID (WINAPI *PUNICAST_IPADDRESS_CHANGE_CALLBACK)(PVOID, PMIB_UNICASTIPADDRESS_ROW,
diff --git a/include/nldef.h b/include/nldef.h
index 983b96c552..776c61c922 100644
--- a/include/nldef.h
+++ b/include/nldef.h
@@ -111,4 +111,15 @@ typedef struct _NL_INTERFACE_OFFLOAD_ROD
BOOLEAN TlGiantSendOffloadSupported : 1;
} NL_INTERFACE_OFFLOAD_ROD, *PNL_INTERFACE_OFFLOAD_ROD;
+typedef enum _NL_NEIGHBOR_STATE {
+ NlnsUnreachable,
+ NlnsIncomplete,
+ NlnsProbe,
+ NlnsDelay,
+ NlnsStale,
+ NlnsReachable,
+ NlnsPermanent,
+ NlnsMaximum,
+} NL_NEIGHBOR_STATE, *PNL_NEIGHBOR_STATE;
+
#endif /* __WINE_NLDEF_H */
--
2.16.4
Sept. 25, 2018
[PATCH] winscard: add SCardCancel stub
by Austin English
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45880
Signed-off-by: Austin English <austinenglish(a)gmail.com>
---
dlls/winscard/winscard.c | 7 +++++++
dlls/winscard/winscard.spec | 2 +-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/dlls/winscard/winscard.c b/dlls/winscard/winscard.c
index a8a1735c2b..91fdfd378a 100644
--- a/dlls/winscard/winscard.c
+++ b/dlls/winscard/winscard.c
@@ -141,3 +141,10 @@ LONG WINAPI SCardListReadersW(SCARDCONTEXT context, const WCHAR *groups, WCHAR *
FIXME("(%lx, %s, %p, %p) stub\n", context, debugstr_w(groups), readers, buflen);
return SCARD_E_NO_READERS_AVAILABLE;
}
+
+LONG WINAPI SCardCancel(SCARDCONTEXT context)
+{
+ FIXME("(%lx) stub\n", context);
+ SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+ return SCARD_F_INTERNAL_ERROR;
+}
diff --git a/dlls/winscard/winscard.spec b/dlls/winscard/winscard.spec
index d2ae62a4a7..037d3bef90 100644
--- a/dlls/winscard/winscard.spec
+++ b/dlls/winscard/winscard.spec
@@ -6,7 +6,7 @@
@ stdcall SCardAddReaderToGroupA(long str str)
@ stdcall SCardAddReaderToGroupW(long wstr wstr)
@ stub SCardBeginTransaction
-@ stub SCardCancel
+@ stdcall SCardCancel(long)
@ stub SCardConnectA
@ stub SCardConnectW
@ stub SCardControl
--
2.16.4
Sept. 25, 2018
[PATCH v2 2/2] hidclass.sys: use IoRegisterDeviceInterface
by Aric Stewart
Signed-off-by: Aric Stewart <aric(a)codeweavers.com>
---
dlls/hidclass.sys/device.c | 60 ++++++++++++++++------------------------------
dlls/hidclass.sys/hid.h | 2 +-
dlls/hidclass.sys/pnp.c | 4 +---
3 files changed, 22 insertions(+), 44 deletions(-)
Sept. 25, 2018