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
June 2018
- 68 participants
- 1149 messages
Re: [PATCH] d3dx9/tests: Add initial tests for ID3DXFont::DrawText().
by Alexandre Julliard
Matteo Bruni <mbruni(a)codeweavers.com> writes:
> From: Kieran Duggan <kieranduggan15(a)gmail.com>
>
> Signed-off-by: Kieran Duggan <kieranduggan15(a)gmail.com>
> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com>
> ---
> dlls/d3dx9_36/tests/core.c | 81 +++++++++++++++++++++++++++++++++++-----------
> 1 file changed, 62 insertions(+), 19 deletions(-)
The tests fail:
../../../tools/runtest -q -P wine -T ../../.. -M d3dx9_36.dll -p d3dx9_36_test.exe.so core && touch core.ok
core.c:612: Test failed: Got unexpected height 1.
core.c:614: Test failed: Got unexpected height 1.
core.c:616: Test failed: Got unexpected height 1.
core.c:619: Test failed: Got unexpected height 1.
core.c:624: Test failed: Got unexpected height 1.
core.c:627: Test failed: Got unexpected rect right 0.
core.c:628: Test failed: Got unexpected rect bottom 0.
core.c:612: Test failed: Got unexpected height 1.
core.c:614: Test failed: Got unexpected height 1.
core.c:616: Test failed: Got unexpected height 1.
core.c:619: Test failed: Got unexpected height 1.
core.c:624: Test failed: Got unexpected height 1.
core.c:627: Test failed: Got unexpected rect right 0.
core.c:628: Test failed: Got unexpected rect bottom 0.
core.c:612: Test failed: Got unexpected height 1.
core.c:614: Test failed: Got unexpected height 1.
core.c:616: Test failed: Got unexpected height 1.
core.c:619: Test failed: Got unexpected height 1.
core.c:624: Test failed: Got unexpected height 1.
core.c:627: Test failed: Got unexpected rect right 0.
core.c:628: Test failed: Got unexpected rect bottom 0.
core.c:612: Test failed: Got unexpected height 1.
core.c:614: Test failed: Got unexpected height 1.
core.c:616: Test failed: Got unexpected height 1.
core.c:619: Test failed: Got unexpected height 1.
core.c:624: Test failed: Got unexpected height 1.
core.c:627: Test failed: Got unexpected rect right 0.
core.c:628: Test failed: Got unexpected rect bottom 0.
core.c:612: Test failed: Got unexpected height 1.
core.c:614: Test failed: Got unexpected height 1.
core.c:616: Test failed: Got unexpected height 1.
core.c:619: Test failed: Got unexpected height 1.
core.c:624: Test failed: Got unexpected height 1.
core.c:627: Test failed: Got unexpected rect right 0.
core.c:628: Test failed: Got unexpected rect bottom 0.
Makefile:234: recipe for target 'core.ok' failed
make[1]: *** [core.ok] Error 35
--
Alexandre Julliard
julliard(a)winehq.org
June 15, 2018
[PATCH] po: Update Russian translation.
by Nikolay Sivov
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
po/ru.po | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/po/ru.po b/po/ru.po
index b973cae0f5..3fb6927e7b 100644
--- a/po/ru.po
+++ b/po/ru.po
@@ -5,14 +5,14 @@ msgstr ""
"Project-Id-Version: Wine\n"
"Report-Msgid-Bugs-To: https://bugs.winehq.org\n"
"POT-Creation-Date: N/A\n"
-"PO-Revision-Date: 2018-05-10 08:12+0300\n"
+"PO-Revision-Date: 2018-06-15 13:16+0300\n"
"Last-Translator: Nikolay Sivov <nsivov(a)codeweavers.com>\n"
"Language-Team: Russian\n"
"Language: ru\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Generator: Poedit 2.0.7\n"
+"X-Generator: Poedit 2.0.8\n"
#: appwiz.rc:58
msgid "Install/Uninstall"
@@ -3697,19 +3697,19 @@ msgstr "Ожидается объект типа «Array»"
msgid ""
"'writable' attribute on the property descriptor cannot be set to 'true' on "
"this object"
-msgstr ""
+msgstr "Невозможно установить атрибут «writable» в «true» для этого объекта"
#: jscript.rc:70
msgid "Cannot redefine non-configurable property '|'"
-msgstr ""
+msgstr "Невозможно переопределить ненастраиваемое свойство «|»"
#: jscript.rc:71
msgid "Cannot modify non-writable property '|'"
-msgstr ""
+msgstr "Невозможно изменить свойство «|»"
#: jscript.rc:72
msgid "Property cannot have both accessors and a value"
-msgstr ""
+msgstr "Свойство не может одновременно иметь методы для доступа и значение"
#: ../../include/wine/wine_common_ver.rc:129
msgid "Wine kernel DLL"
@@ -12801,10 +12801,8 @@ msgid "Confirm Value Delete"
msgstr "Подтверждение удаления значения"
#: regedit.rc:210
-#, fuzzy
-#| msgid "Are you sure you want to delete the registry value '%1'?"
msgid "Are you sure you want to delete the selected registry value?"
-msgstr "Вы точно хотите удалить параметр реестра «%1»?"
+msgstr "Вы точно хотите удалить выбранный параметр реестра?"
#: regedit.rc:216
msgid "Search complete. The string '%1' was not found."
--
2.17.1
June 15, 2018
[PATCH] testbot/WineRunTask: Rename a TakeScreenshot() parameter.
by Francois Gouget
It had the same name as a global variable which made the code a bit
confusing.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
---
testbot/bin/WineRunTask.pl | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/testbot/bin/WineRunTask.pl b/testbot/bin/WineRunTask.pl
index 8f5cb268c..90008f035 100755
--- a/testbot/bin/WineRunTask.pl
+++ b/testbot/bin/WineRunTask.pl
@@ -71,14 +71,14 @@ sub Error(@)
sub TakeScreenshot($$)
{
- my ($VM, $FullScreenshotFileName) = @_;
+ my ($VM, $FileName) = @_;
my $Domain = $VM->GetDomain();
my ($ErrMessage, $ImageSize, $ImageBytes) = $Domain->CaptureScreenImage();
if (!defined $ErrMessage)
{
my $OldUMask = umask(002);
- if (open(my $Screenshot, ">", $FullScreenshotFileName))
+ if (open(my $Screenshot, ">", $FileName))
{
print $Screenshot $ImageBytes;
close($Screenshot);
--
2.17.1
June 15, 2018
[PATCH] testbot/web: Remove the live screenshot code.
by Francois Gouget
When 'live snapshots' are supported again it will likely
be in a different form so remove the cruft.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
---
testbot/web/JobDetails.pl | 24 +-----------------------
1 file changed, 1 insertion(+), 23 deletions(-)
diff --git a/testbot/web/JobDetails.pl b/testbot/web/JobDetails.pl
index 3e638f717..70d8b5983 100644
--- a/testbot/web/JobDetails.pl
+++ b/testbot/web/JobDetails.pl
@@ -257,30 +257,8 @@ sub GenerateBody($)
my $Screenshot = $self->GetParam($ScreenshotParamName);
$Screenshot = "" if ($Screenshot ne "1");
-
print "<div class='TaskMoreInfoLinks'>\n";
- # FIXME: Disable live screenshots for now
- if (0 && $StepTask->Status eq "running" &&
- ($StepTask->Type eq "single" || $StepTask->Type eq "suite"))
- {
- if ($Screenshot)
- {
- my $URI = "/Screenshot.pl?VMName=" . uri_escape($VM->Name);
- print "<div class='Screenshot'><img src='" .
- $self->CGI->escapeHTML($URI) . "' alt='Screenshot' /></div>\n";
- }
- else
- {
- my $URI = $ENV{"SCRIPT_NAME"} . "?Key=" . uri_escape($self->{JobId}) .
- "&$ScreenshotParamName=1";
- $URI .= "#k" . uri_escape($Key);
- print "<div class='TaskMoreInfoLink'><a href='" .
- $self->CGI->escapeHTML($URI) .
- "'>Show live screenshot</a></div>";
- print "\n";
- }
- }
- elsif (-r "$TaskDir/screenshot.png")
+ if (-r "$TaskDir/screenshot.png")
{
if ($Screenshot)
{
--
2.17.1
June 15, 2018
[PATCH] testbot/bin: Remove some global variables.
by Francois Gouget
The variable names are longer than the values they replace and
make the code less readable due to the extra indirection.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
---
testbot/bin/WineRunBuild.pl | 15 ++++++---------
testbot/bin/WineRunReconfig.pl | 15 ++++++---------
testbot/bin/WineRunTask.pl | 26 +++++++++++---------------
3 files changed, 23 insertions(+), 33 deletions(-)
diff --git a/testbot/bin/WineRunBuild.pl b/testbot/bin/WineRunBuild.pl
index 96d9321b8..eab33bc08 100755
--- a/testbot/bin/WineRunBuild.pl
+++ b/testbot/bin/WineRunBuild.pl
@@ -162,15 +162,12 @@ if (!defined $Task)
Error "Step $StepNo task $TaskNo of job $JobId does not exist\n";
exit 1;
}
-
my $OldUMask = umask(002);
my $TaskDir = $Task->CreateDir();
umask($OldUMask);
-my $FullLogFileName = "$TaskDir/log";
-my $FullErrFileName = "$TaskDir/err";
-
my $VM = $Task->VM;
+
my $Start = Time();
LogMsg "Task $JobId/$StepNo/$TaskNo started\n";
@@ -185,14 +182,14 @@ sub LogTaskError($)
Debug("$Name0:error: ", $ErrMessage);
my $OldUMask = umask(002);
- if (open(my $ErrFile, ">>", $FullErrFileName))
+ if (open(my $ErrFile, ">>", "$TaskDir/err"))
{
print $ErrFile $ErrMessage;
close($ErrFile);
}
else
{
- Error "Unable to open '$FullErrFileName' for writing: $!\n";
+ Error "Unable to open 'err' for writing: $!\n";
}
umask($OldUMask);
}
@@ -391,10 +388,10 @@ if (!defined $TA->Wait($Pid, $Task->Timeout, 60))
}
}
-Debug(Elapsed($Start), " Retrieving the build log to '$FullLogFileName'\n");
-if ($TA->GetFile("Build.log", $FullLogFileName))
+Debug(Elapsed($Start), " Retrieving 'Build.log'\n");
+if ($TA->GetFile("Build.log", "$TaskDir/log"))
{
- if (open(my $LogFile, "<", $FullLogFileName))
+ if (open(my $LogFile, "<", "$TaskDir/log"))
{
# Collect and analyze the 'Build:' status line(s)
$ErrMessage ||= "";
diff --git a/testbot/bin/WineRunReconfig.pl b/testbot/bin/WineRunReconfig.pl
index 4fb34a07d..e7b447e92 100755
--- a/testbot/bin/WineRunReconfig.pl
+++ b/testbot/bin/WineRunReconfig.pl
@@ -161,14 +161,11 @@ if (!defined $Task)
Error "Step $StepNo task $TaskNo of job $JobId does not exist\n";
exit 1;
}
-
my $OldUMask = umask(002);
my $TaskDir = $Task->CreateDir();
umask($OldUMask);
-
my $VM = $Task->VM;
-my $FullLogFileName = "$TaskDir/log";
-my $FullErrFileName = "$TaskDir/err";
+
my $Start = Time();
LogMsg "Task $JobId/$StepNo/$TaskNo started\n";
@@ -184,14 +181,14 @@ sub LogTaskError($)
Debug("$Name0:error: ", $ErrMessage);
my $OldUMask = umask(002);
- if (open(my $ErrFile, ">>", $FullErrFileName))
+ if (open(my $ErrFile, ">>", "$TaskDir/err"))
{
print $ErrFile $ErrMessage;
close($ErrFile);
}
else
{
- Error "Unable to open '$FullErrFileName' for writing: $!\n";
+ Error "Unable to open 'err' for writing: $!\n";
}
umask($OldUMask);
}
@@ -373,10 +370,10 @@ if (!defined $TA->Wait($Pid, $Task->Timeout, 60))
}
}
-Debug(Elapsed($Start), " Retrieving the reconfig log to '$FullLogFileName'\n");
-if ($TA->GetFile("Reconfig.log", $FullLogFileName))
+Debug(Elapsed($Start), " Retrieving 'Reconfig.log'\n");
+if ($TA->GetFile("Reconfig.log", "$TaskDir/log"))
{
- if (open(my $LogFile, "<", $FullLogFileName))
+ if (open(my $LogFile, "<", "$TaskDir/log"))
{
# Collect and analyze the 'Reconfig:' status line(s).
my $LogErrors;
diff --git a/testbot/bin/WineRunTask.pl b/testbot/bin/WineRunTask.pl
index 90008f035..15f8752fb 100755
--- a/testbot/bin/WineRunTask.pl
+++ b/testbot/bin/WineRunTask.pl
@@ -191,17 +191,13 @@ if (!defined $Task)
Error "Step $StepNo task $TaskNo of job $JobId does not exist\n";
exit 1;
}
-
my $OldUMask = umask(002);
my $TaskDir = $Task->CreateDir();
umask($OldUMask);
-my $FullLogFileName = "$TaskDir/log";
-my $FullErrFileName = "$TaskDir/err";
-my $FullScreenshotFileName = "$TaskDir/screenshot.png";
-
my $VM = $Task->VM;
my $RptFileName = $VM->Name . ".rpt";
+
my $Start = Time();
LogMsg "Task $JobId/$StepNo/$TaskNo started\n";
@@ -216,14 +212,14 @@ sub LogTaskError($)
Debug("$Name0:error: ", $ErrMessage);
my $OldUMask = umask(002);
- if (open(my $ErrFile, ">>", $FullErrFileName))
+ if (open(my $ErrFile, ">>", "$TaskDir/err"))
{
print $ErrFile $ErrMessage;
close($ErrFile);
}
else
{
- Error "Unable to open '$FullErrFileName' for writing: $!\n";
+ Error "Unable to open 'err' for writing: $!\n";
}
umask($OldUMask);
}
@@ -237,7 +233,7 @@ sub WrapUpAndExit($;$$$)
$Timeout ? "timeout" : "";
Debug(Elapsed($Start), " Taking a screenshot\n");
- TakeScreenshot($VM, $FullScreenshotFileName);
+ TakeScreenshot($VM, "$TaskDir/screenshot.png");
my $Tries = $Task->TestFailures || 0;
if ($Retry)
@@ -299,9 +295,9 @@ sub WrapUpAndExit($;$$$)
my $LatestBaseName = join("", "$DataDir/latest/", $Task->VM->Name, "_",
$Step->FileType eq "exe64" ? "64" : "32");
unlink("$LatestBaseName.log");
- link($FullLogFileName, "$LatestBaseName.log") if (-f $FullLogFileName);
+ link("$TaskDir/log", "$LatestBaseName.log") if (-f "$TaskDir/log");
unlink("$LatestBaseName.err");
- link($FullErrFileName, "$LatestBaseName.err") if (-f $FullErrFileName);
+ link("$TaskDir/err", "$LatestBaseName.err") if (-f "$TaskDir/err");
}
my $Result = $VM->Name .": ". $VM->Status ." Status: $Status Failures: ". (defined $TestFailures ? $TestFailures : "unset");
@@ -516,11 +512,11 @@ if (!defined $TA->Wait($Pid, $Timeout, $Keepalive))
}
my $TimedOut;
-Debug(Elapsed($Start), " Retrieving the report file to '$FullLogFileName'\n");
-if ($TA->GetFile($RptFileName, $FullLogFileName))
+Debug(Elapsed($Start), " Retrieving the report file to 'log'\n");
+if ($TA->GetFile($RptFileName, "$TaskDir/log"))
{
- chmod 0664, $FullLogFileName;
- if (open(my $LogFile, "<", $FullLogFileName))
+ chmod 0664, "$TaskDir/log";
+ if (open(my $LogFile, "<", "$TaskDir/log"))
{
# There is more than one test unit when running the full test suite so keep
# track of the current one. Note that for the TestBot we don't count or
@@ -786,7 +782,7 @@ if ($TA->GetFile($RptFileName, $FullLogFileName))
else
{
$NewStatus = 'boterror';
- Error "Unable to open '$FullLogFileName' for reading: $!\n";
+ Error "Unable to open 'log' for reading: $!\n";
LogTaskError("Unable to open the log file for reading: $!\n");
}
}
--
2.17.1
June 15, 2018
[PATCH] testbot: Simplify passing the Job URL to WineTest.
by Francois Gouget
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
---
testbot/bin/WineRunTask.pl | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/testbot/bin/WineRunTask.pl b/testbot/bin/WineRunTask.pl
index 15f8752fb..3b0ccbc4a 100755
--- a/testbot/bin/WineRunTask.pl
+++ b/testbot/bin/WineRunTask.pl
@@ -448,8 +448,7 @@ elsif ($Step->Type eq "suite")
if (defined($WebHostName))
{
my $StepTask = 100 * $StepNo + $TaskNo;
- $Script .= '-u "http://' . $WebHostName . "/JobDetails.pl?Key=" .
- $JobId . "&scrshot_" . $StepTask . "=1#k" . $StepTask . '" ';
+ $Script .= "-u \"http://$WebHostName/JobDetails.pl?Key=$JobId&scrshot_$StepTask=1#k$StepTask\"";
}
my $Info = $VM->Description ? $VM->Description : "";
if ($VM->Details)
--
2.17.1
June 15, 2018
[PATCH] gdiplus: Check return value of SelectClipPath in brush_fill_path().
by Zhiyi Zhang
For Crossover bug 16126.
When GraphicPath is empty, filling path with gdi32 will
result in a DC with empty path. When SelectClipPath() is
called with such a DC, it will fail because it requires
a closed path in DC. Thus further operation should be canceled.
Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com>
---
dlls/gdiplus/graphics.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c
index 76aabe74bf..2a95d686fa 100644
--- a/dlls/gdiplus/graphics.c
+++ b/dlls/gdiplus/graphics.c
@@ -1052,6 +1052,7 @@ static BOOL brush_can_fill_path(GpBrush *brush, BOOL is_fill)
static void brush_fill_path(GpGraphics *graphics, GpBrush* brush)
{
+ BOOL success;
switch (brush->bt)
{
case BrushTypeSolidColor:
@@ -1064,8 +1065,8 @@ static void brush_fill_path(GpGraphics *graphics, GpBrush* brush)
RECT rc;
/* partially transparent fill */
- SelectClipPath(graphics->hdc, RGN_AND);
- if (GetClipBox(graphics->hdc, &rc) != NULLREGION)
+ success = SelectClipPath(graphics->hdc, RGN_AND);
+ if (success && GetClipBox(graphics->hdc, &rc) != NULLREGION)
{
HDC hdc = CreateCompatibleDC(NULL);
--
2.17.1
June 15, 2018
Re: [PATCH v5 4/8] ntdll: Return BIOS info from NtQuerySystemInformation on Linux
by Huw Davies
On Fri, Jun 15, 2018 at 12:59:10AM -0600, Alex Henrie wrote:
> Signed-off-by: Alex Henrie <alexhenrie24(a)gmail.com>
> ---
> dlls/ntdll/nt.c | 174 ++++++++++++++++++++++++++++++++++++++++
> dlls/ntdll/tests/info.c | 14 ++--
> 2 files changed, 182 insertions(+), 6 deletions(-)
>
> diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c
> index dc0ce04f42..658970b051 100644
> --- a/dlls/ntdll/nt.c
> +++ b/dlls/ntdll/nt.c
> @@ -66,6 +66,35 @@
>
> WINE_DEFAULT_DEBUG_CHANNEL(ntdll);
>
> +#include "pshpack1.h"
> +
> +struct smbios_prologue {
> + BYTE calling_method;
> + BYTE major_version;
> + BYTE minor_version;
> + BYTE revision;
> + DWORD length;
> +};
> +
> +struct smbios_bios {
> + BYTE type;
> + BYTE length;
> + WORD handle;
> + BYTE vendor;
> + BYTE version;
> + WORD start;
> + BYTE date;
> + BYTE size;
> + UINT64 characteristics;
> +};
> +
> +#include "poppack.h"
> +
> +/* Firmware table providers */
> +#define ACPI 0x41435049
> +#define FIRM 0x4649524D
> +#define RSMB 0x52534D42
> +
> /*
> * Token
> */
> @@ -1850,6 +1879,129 @@ static NTSTATUS create_logical_proc_info(SYSTEM_LOGICAL_PROCESSOR_INFORMATION **
> }
> #endif
>
> +static inline void copy_smbios_string(char **buffer, char *string, size_t string_size)
> +{
> + if (!string) return;
> + strcpy(*buffer, string);
> + *buffer += string_size;
> +}
> +
> +#ifdef linux
> +
> +static char* get_smbios_string(const char *path, size_t *string_size)
> +{
> + FILE *file = fopen(path, "r");
> + char *ret = NULL;
> + *string_size = 0;
> + if (file)
> + {
> + *string_size = getline(&ret, string_size, file) + 1;
I'm not sure we want to use malloc based functions here.
fgets() using a fixed-size buffer with a sensibly chosen size should
be fine.
> + fclose(file);
> + if (*string_size >= 2 && ret[*string_size - 2] == '\n')
> + {
> + ret[*string_size - 2] = 0;
> + (*string_size)--;
> + }
> + if (*string_size == 1)
> + {
> + free(ret);
> + ret = NULL;
> + *string_size = 0;
> + }
> + }
> + return ret;
> +}
> +
> +static inline NTSTATUS get_firmware_info(SYSTEM_FIRMWARE_TABLE_INFORMATION *sfti,
> + ULONG available_len, ULONG *required_len)
> +{
> + switch (sfti->ProviderSignature)
> + {
> + case RSMB:
> + {
> + char *bios_vendor, *bios_version, *bios_date;
> + size_t bios_vendor_size, bios_version_size, bios_date_size;
> + char *buffer = (char*)sfti->TableBuffer;
> + BYTE string_count;
> + struct smbios_prologue *prologue;
> + struct smbios_bios *bios;
> +
> + bios_vendor = get_smbios_string("/sys/class/dmi/id/bios_vendor", &bios_vendor_size);
> + bios_version = get_smbios_string("/sys/class/dmi/id/bios_version", &bios_version_size);
> + bios_date = get_smbios_string("/sys/class/dmi/id/bios_date", &bios_date_size);
> +
> + *required_len = FIELD_OFFSET(SYSTEM_FIRMWARE_TABLE_INFORMATION, TableBuffer);
> +
> + *required_len += sizeof(struct smbios_prologue);
> +
> + *required_len += sizeof(struct smbios_bios);
> + *required_len += max(bios_vendor_size + bios_version_size + bios_date_size + 1, 2);
> +
> + if (available_len < *required_len)
> + {
> + return STATUS_BUFFER_TOO_SMALL;
> + }
> +
> + sfti->TableBufferLength = *required_len - FIELD_OFFSET(SYSTEM_FIRMWARE_TABLE_INFORMATION, TableBuffer);
> +
> + prologue = (struct smbios_prologue*)buffer;
> + prologue->calling_method = 0;
> + prologue->major_version = 2;
> + prologue->minor_version = 0;
> + prologue->revision = 0;
> + prologue->length = sfti->TableBufferLength - sizeof(struct smbios_prologue);
> + buffer += sizeof(struct smbios_prologue);
> +
> + string_count = 0;
> + bios = (struct smbios_bios*)buffer;
> + bios->type = 0;
> + bios->length = sizeof(struct smbios_bios);
> + bios->handle = 0;
> + bios->vendor = bios_vendor ? ++string_count : 0;
> + bios->version = bios_version ? ++string_count : 0;
> + bios->start = 0;
> + bios->date = bios_date ? ++string_count : 0;
> + bios->size = 0;
> + bios->characteristics = 0x4; /* not supported */
> + buffer += sizeof(struct smbios_bios);
> +
> + if (string_count)
> + {
> + copy_smbios_string(&buffer, bios_vendor, bios_vendor_size);
> + copy_smbios_string(&buffer, bios_version, bios_version_size);
> + copy_smbios_string(&buffer, bios_date, bios_date_size);
> + memset(buffer, 0, 1);
> + }
> + else
> + {
> + memset(buffer, 0, 2);
> + }
> +
> + free(bios_vendor);
> + free(bios_version);
> + free(bios_date);
> +
> + return STATUS_SUCCESS;
> + }
> + default:
> + {
> + return STATUS_NOT_IMPLEMENTED;
> + FIXME("info_class SYSTEM_FIRMWARE_TABLE_INFORMATION\n");
> + }
> + }
> +}
> +
> +#else
> +
> +static inline NTSTATUS get_firmware_info(SYSTEM_FIRMWARE_TABLE_INFORMATION *sfti,
> + ULONG available_len, ULONG *required_len)
> +{
> + return STATUS_NOT_IMPLEMENTED;
> + FIXME("info_class SYSTEM_FIRMWARE_TABLE_INFORMATION\n");
> +}
> +
> +#endif
> +
> /******************************************************************************
> * NtQuerySystemInformation [NTDLL.@]
> * ZwQuerySystemInformation [NTDLL.@]
> @@ -2359,6 +2511,28 @@ NTSTATUS WINAPI NtQuerySystemInformation(
> else ret = STATUS_INFO_LENGTH_MISMATCH;
> }
> break;
> + case SystemFirmwareTableInformation:
> + {
> + SYSTEM_FIRMWARE_TABLE_INFORMATION *sfti = (SYSTEM_FIRMWARE_TABLE_INFORMATION*)SystemInformation;
> + len = FIELD_OFFSET(SYSTEM_FIRMWARE_TABLE_INFORMATION, TableBuffer);
> + if (Length < len)
> + {
> + ret = STATUS_INFO_LENGTH_MISMATCH;
> + break;
> + }
> +
> + switch (sfti->Action)
> + {
> + case SystemFirmwareTable_Get:
> + ret = get_firmware_info(sfti, Length, &len);
> + break;
> + default:
> + len = 0;
> + ret = STATUS_NOT_IMPLEMENTED;
> + FIXME("info_class SYSTEM_FIRMWARE_TABLE_INFORMATION\n");
> + }
> + }
> + break;
> default:
> FIXME("(0x%08x,%p,0x%08x,%p) stub\n",
> SystemInformationClass,SystemInformation,Length,ResultLength);
> diff --git a/dlls/ntdll/tests/info.c b/dlls/ntdll/tests/info.c
> index cdb91e1b73..b8feebd474 100644
> --- a/dlls/ntdll/tests/info.c
> +++ b/dlls/ntdll/tests/info.c
> @@ -59,6 +59,12 @@ static DWORD one_before_last_pid = 0;
> #define FIRM 0x4649524D
> #define RSMB 0x52534D42
>
> +#ifdef linux
> +static const int firmware_todo = 0;
> +#else
> +static const int firmware_todo = 1;
> +#endif
> +
> static BOOL InitFunctionPtrs(void)
> {
> /* All needed functions are NT based, so using GetModuleHandle is a good check */
> @@ -840,13 +846,10 @@ static void test_query_firmware(void)
> ok(!!sfti, "Failed to allocate memory\n");
>
> status = pNtQuerySystemInformation(SystemFirmwareTableInformation, sfti, 15, &len1);
> -todo_wine
> ok(status == STATUS_INFO_LENGTH_MISMATCH, "Expected STATUS_INFO_LENGTH_MISMATCH, got %08x\n", status);
> -todo_wine
> ok(len1 == 16, "Expected length 16, got %u\n", len1);
>
> status = pNtQuerySystemInformation(SystemFirmwareTableInformation, sfti, 16, &len1);
> -todo_wine
> ok(status == STATUS_NOT_IMPLEMENTED, "Expected STATUS_NOT_IMPLEMENTED, got %08x\n", status);
> ok(len1 == 0, "Expected length 0, got %u\n", len1);
>
> @@ -854,16 +857,15 @@ todo_wine
> sfti->Action = SystemFirmwareTable_Get;
>
> status = pNtQuerySystemInformation(SystemFirmwareTableInformation, sfti, 16, &len1);
> -todo_wine
> +todo_wine_if(firmware_todo)
> ok(status == STATUS_BUFFER_TOO_SMALL, "Expected STATUS_BUFFER_TOO_SMALL, got %08x\n", status);
> -todo_wine
> ok(len1 >= 16, "Expected length >= 16, got %u\n", len1);
>
> sfti = HeapReAlloc(GetProcessHeap(), 0, sfti, len1);
> ok(!!sfti, "Failed to allocate memory\n");
>
> status = pNtQuerySystemInformation(SystemFirmwareTableInformation, sfti, len1, &len2);
> -todo_wine
> +todo_wine_if(firmware_todo)
> ok(status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status);
> ok(len2 == len1, "Expected length %u, got %u\n", len1, len2);
>
> --
> 2.17.1
>
>
>
June 15, 2018
Re: [PATCH v5 3/8] kernel32/tests: Add GetSystemFirmwareTable tests
by Huw Davies
On Fri, Jun 15, 2018 at 12:59:09AM -0600, Alex Henrie wrote:
> Signed-off-by: Alex Henrie <alexhenrie24(a)gmail.com>
> ---
> dlls/kernel32/tests/version.c | 42 +++++++++++++++++++++++++++++++++++
> 1 file changed, 42 insertions(+)
>
> diff --git a/dlls/kernel32/tests/version.c b/dlls/kernel32/tests/version.c
> index eb78a383d2..6ca45f0b2e 100644
> --- a/dlls/kernel32/tests/version.c
> +++ b/dlls/kernel32/tests/version.c
> @@ -26,11 +26,17 @@
> #include "winternl.h"
>
> static BOOL (WINAPI * pGetProductInfo)(DWORD, DWORD, DWORD, DWORD, DWORD *);
> +static NTSTATUS (WINAPI * pNtQuerySystemInformation)(SYSTEM_INFORMATION_CLASS, void *, ULONG, ULONG *);
> static NTSTATUS (WINAPI * pRtlGetVersion)(RTL_OSVERSIONINFOEXW *);
>
> #define GET_PROC(func) \
> p##func = (void *)GetProcAddress(hmod, #func);
>
> +/* Firmware table providers */
> +#define ACPI 0x41435049
> +#define FIRM 0x4649524D
> +#define RSMB 0x52534D42
> +
> static void init_function_pointers(void)
> {
> HMODULE hmod;
> @@ -41,6 +47,7 @@ static void init_function_pointers(void)
>
> hmod = GetModuleHandleA("ntdll.dll");
>
> + GET_PROC(NtQuerySystemInformation);
> GET_PROC(RtlGetVersion);
> }
>
> @@ -697,6 +704,40 @@ static void test_VerifyVersionInfo(void)
> ok(ret, "VerifyVersionInfoA failed with error %d\n", GetLastError());
> }
>
> +void test_GetSystemFirmwareTable(void)
> +{
> + ULONG expected_len, i;
> + UINT len;
> + SYSTEM_FIRMWARE_TABLE_INFORMATION *sfti = HeapAlloc(GetProcessHeap(), 0, 16);
> + UCHAR *smbios_table = NULL;
> +
> + ok(!!sfti, "Failed to allocate memory\n");
> + sfti->ProviderSignature = RSMB;
> + sfti->Action = SystemFirmwareTable_Get;
You need to initialize TableID.
> + pNtQuerySystemInformation(SystemFirmwareTableInformation, sfti, 16, &expected_len);
> + sfti = HeapReAlloc(GetProcessHeap(), 0, sfti, expected_len);
> + ok(!!sfti, "Failed to allocate memory\n");
> + pNtQuerySystemInformation(SystemFirmwareTableInformation, sfti, expected_len, &expected_len);
> +
> + expected_len -= 16;
> + len = GetSystemFirmwareTable(RSMB, 0, smbios_table, 0);
> +todo_wine
> + ok(len == expected_len, "Expected length %u, got %u\n", expected_len, len);
> +
> + smbios_table = HeapAlloc(GetProcessHeap(), 0, len);
> + len = GetSystemFirmwareTable(RSMB, 0, smbios_table, len);
> +todo_wine
> + ok(len == expected_len, "Expected length %u, got %u\n", expected_len, len);
> + for (i = 0; i < len; i++)
> + {
> + ok(smbios_table[i] == sfti->TableBuffer[i],
> + "Offset %u: Expected %02x, got %02x\n", i, sfti->TableBuffer[i], smbios_table[i]);
> + }
> +
> + HeapFree(GetProcessHeap(), 0, sfti);
> + HeapFree(GetProcessHeap(), 0, smbios_table);
> +}
> +
> START_TEST(version)
> {
> init_function_pointers();
> @@ -704,4 +745,5 @@ START_TEST(version)
> test_GetProductInfo();
> test_GetVersionEx();
> test_VerifyVersionInfo();
> + test_GetSystemFirmwareTable();
> }
> --
> 2.17.1
>
>
>
June 15, 2018
Re: [PATCH v5 2/8] ntdll/tests: Add SystemFirmwareTableInformation tests
by Huw Davies
On Fri, Jun 15, 2018 at 12:59:08AM -0600, Alex Henrie wrote:
> Signed-off-by: Alex Henrie <alexhenrie24(a)gmail.com>
> ---
> dlls/ntdll/tests/info.c | 48 +++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 48 insertions(+)
>
> diff --git a/dlls/ntdll/tests/info.c b/dlls/ntdll/tests/info.c
> index 6c93c3cd58..cdb91e1b73 100644
> --- a/dlls/ntdll/tests/info.c
> +++ b/dlls/ntdll/tests/info.c
> @@ -54,6 +54,11 @@ static DWORD one_before_last_pid = 0;
> } \
> } while(0)
>
> +/* Firmware table providers */
> +#define ACPI 0x41435049
> +#define FIRM 0x4649524D
> +#define RSMB 0x52534D42
> +
> static BOOL InitFunctionPtrs(void)
> {
> /* All needed functions are NT based, so using GetModuleHandle is a good check */
> @@ -826,6 +831,45 @@ static void test_query_logicalprocex(void)
> }
> }
>
> +static void test_query_firmware(void)
> +{
> + ULONG len1, len2;
> + NTSTATUS status;
> + SYSTEM_FIRMWARE_TABLE_INFORMATION *sfti = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, 16);
> +
> + ok(!!sfti, "Failed to allocate memory\n");
> +
> + status = pNtQuerySystemInformation(SystemFirmwareTableInformation, sfti, 15, &len1);
> +todo_wine
> + ok(status == STATUS_INFO_LENGTH_MISMATCH, "Expected STATUS_INFO_LENGTH_MISMATCH, got %08x\n", status);
> +todo_wine
> + ok(len1 == 16, "Expected length 16, got %u\n", len1);
> +
> + status = pNtQuerySystemInformation(SystemFirmwareTableInformation, sfti, 16, &len1);
> +todo_wine
> + ok(status == STATUS_NOT_IMPLEMENTED, "Expected STATUS_NOT_IMPLEMENTED, got %08x\n", status);
> + ok(len1 == 0, "Expected length 0, got %u\n", len1);
> +
> + sfti->ProviderSignature = RSMB;
> + sfti->Action = SystemFirmwareTable_Get;
> +
> + status = pNtQuerySystemInformation(SystemFirmwareTableInformation, sfti, 16, &len1);
> +todo_wine
> + ok(status == STATUS_BUFFER_TOO_SMALL, "Expected STATUS_BUFFER_TOO_SMALL, got %08x\n", status);
> +todo_wine
> + ok(len1 >= 16, "Expected length >= 16, got %u\n", len1);
testing TableBufferLength == len1 - 16 would be useful here.
> +
> + sfti = HeapReAlloc(GetProcessHeap(), 0, sfti, len1);
> + ok(!!sfti, "Failed to allocate memory\n");
> +
> + status = pNtQuerySystemInformation(SystemFirmwareTableInformation, sfti, len1, &len2);
> +todo_wine
> + ok(status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status);
> + ok(len2 == len1, "Expected length %u, got %u\n", len1, len2);
and here.
> +
> + HeapFree(GetProcessHeap(), 0, sfti);
> +}
> +
> static void test_query_processor_power_info(void)
> {
> NTSTATUS status;
> @@ -2267,6 +2311,10 @@ START_TEST(info)
> trace("Starting test_process_debug_flags()\n");
> test_query_process_debug_flags(argc, argv);
>
> + /* 0x4C SystemFirmwareTableInformation */
> + trace("Starting test_query_firmware()\n");
> + test_query_firmware();
> +
> /* belongs to its own file */
> trace("Starting test_readvirtualmemory()\n");
> test_readvirtualmemory();
> --
> 2.17.1
>
>
>
June 15, 2018