Module: vkd3d
Branch: master
Commit: 2a92fc1676269d9e2d251dd42f49992b562185d1
URL: https://source.winehq.org/git/vkd3d.git/?a=commit;h=2a92fc1676269d9e2d251dd…
Author: Giovanni Mascellani <gmascellani(a)codeweavers.com>
Date: Thu Feb 24 09:20:14 2022 +0100
include: Clarify docs for PFN_vkd3d_shader_close_include.
Clarify the contract about memory management of the code parameter
and reference callbacks by their name as fields of struct
vkd3d_shader_preprocess_info rather than by their type (like it
is already done above).
Signed-off-by: Giovanni Mascellani <gmascellani(a)codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
include/vkd3d_shader.h | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/include/vkd3d_shader.h b/include/vkd3d_shader.h
index 1eae0bb..5a60b37 100644
--- a/include/vkd3d_shader.h
+++ b/include/vkd3d_shader.h
@@ -787,8 +787,7 @@ typedef int (*PFN_vkd3d_shader_open_include)(const char *filename, bool local,
* vkd3d_shader_preprocess_info.
*
* \param code Contents of the included file, which were allocated by the
- * \ref PFN_vkd3d_shader_open_include callback. The source code was allocated by
- * the user and thus need not be freed by vkd3d_shader_free_shader_code().
+ * \ref pfn_open_include callback. The user must free them.
*
* \param context The user-defined pointer passed to struct
* vkd3d_shader_preprocess_info.
Module: tools
Branch: master
Commit: 712ba348088535efc69b0e7c28642eba1cd16c3b
URL: https://source.winehq.org/git/tools.git/?a=commit;h=712ba348088535efc69b0e7…
Author: Francois Gouget <fgouget(a)codeweavers.com>
Date: Thu Feb 24 19:02:08 2022 +0100
testbot/LibvirtTool: Add support for creating adm snapshots.
This adds a task to run TestAgentd without elevated privileges and
modifies the original task so it does not interfere.
Note that schtasks.exe asks for a password so use the Powershell APIs
instead.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
testbot/bin/LibvirtTool.pl | 19 ++++++-
testbot/bin/LibvirtTool.ps1 | 119 ++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 137 insertions(+), 1 deletion(-)
diff --git a/testbot/bin/LibvirtTool.pl b/testbot/bin/LibvirtTool.pl
index ff834ef..bd676f0 100755
--- a/testbot/bin/LibvirtTool.pl
+++ b/testbot/bin/LibvirtTool.pl
@@ -610,7 +610,7 @@ sub GetSnapshotConfig($)
{
$Config->{locale} ||= $1; # take only the last match
}
- elsif ($Config->{base} =~ s/-(live|off|tsign|u8)$//)
+ elsif ($Config->{base} =~ s/-(adm|live|off|tsign|u8)$//)
{
$Config->{$1} = 1;
}
@@ -693,6 +693,23 @@ sub CreateSnapshot($$$$)
}
}
+ if ($Config->{adm})
+ {
+ # Takes effect after the next reboot
+ my $PS1 = "$0.ps1";
+ $PS1 =~ s/\.pl//;
+ if (!$TA->SendFile($PS1, "$Name0.ps1", 0))
+ {
+ FatalError("Could not send '$Name0.ps1'\n");
+ }
+ if (RunAndWait($PTA, ["powershell.exe", "-ExecutionPolicy", "ByPass",
+ "-File", "$Name0.ps1", "admin", $AgentPort]))
+ {
+ FatalError("Could not set up the TestAgentd tasks on $VMKey\n");
+ }
+ $PTA->Rm("$Name0.ps1");
+ }
+
$Reboot = 1;
}
diff --git a/testbot/bin/LibvirtTool.ps1 b/testbot/bin/LibvirtTool.ps1
new file mode 100644
index 0000000..e2b2d12
--- /dev/null
+++ b/testbot/bin/LibvirtTool.ps1
@@ -0,0 +1,119 @@
+# Shows or sets up the TestAgentd tasks
+#
+# Copyright 2022 Francois Gouget
+#
+# 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
+
+$Name0 = (Get-Item $MyInvocation.InvocationName).Basename
+
+
+#
+# Show the existing tasks
+#
+
+function ShowTask($Name)
+{
+ $Task = Get-ScheduledTask -TaskName $Name -ErrorAction SilentlyContinue
+ if ($Task -ne $null)
+ {
+ Write-Output "$Name.User=$($Task.Principal.UserId)"
+ Write-Output "$Name.RunLevel=$($Task.Principal.RunLevel)"
+ Write-Output "$Name.Execute=$($Task.Actions.Execute)"
+ Write-Output "$Name.Arguments=$($Task.Actions.Arguments)"
+ Write-Output "$Name.WorkingDirectory=$($Task.Actions.WorkingDirectory)"
+ Write-Output "$Name.NotOnBatteries=$($Task.Settings.DisallowStartIfOnBatteries)"
+ }
+ else
+ {
+ Write-Output "$Name=<no such task>"
+ }
+}
+
+function ShowTasks()
+{
+ ShowTask "TestAgentd"
+ ShowTask "TestAgentdAdm"
+ exit 0
+}
+
+
+#
+# Sets up split tasks
+#
+
+function SetupAdminTasks($Argv)
+{
+ $Port = [int]$Argv[1]
+ $Task = Get-ScheduledTask -TaskName TestAgentd -ErrorAction SilentlyContinue
+ if ($Task -eq $null)
+ {
+ echo "$Name0:error: the TestAgentd task does not exist!"
+ exit 1
+ }
+ $WorkDir = $Task.Actions.WorkingDirectory
+ if ($WorkDir -eq $null)
+ {
+ $WorkDir = Split-Path $Task.Actions.Execute
+ }
+
+ # Modify the 'elevated privileges' server to start on the alternate port
+ $HighPort = $Port + 1
+ $Action = New-ScheduledTaskAction -Execute $Task.Actions.Execute -Argument "--detach --set-time-only $HighPort" -WorkingDirectory $WorkDir
+ Set-ScheduledTask -TaskName TestAgentd -Action $Action
+
+ # Add a 'regular privileges' server on the regular port
+ $Action = New-ScheduledTaskAction -Execute $Task.Actions.Execute -Argument "--detach --show-restarts $Port" -WorkingDirectory $WorkDir
+ $AdmTask = Get-ScheduledTask -TaskName TestAgentdAdm -ErrorAction SilentlyContinue
+ if ($AdmTask -eq $null)
+ {
+ Register-ScheduledTask -TaskName TestAgentdAdm -Action $Action -Trigger $Task.Triggers -Settings $Task.Settings
+ }
+ else
+ {
+ Set-ScheduledTask -TaskName TestAgentdAdm -Action $Action
+ }
+ exit 0
+}
+
+
+#
+# Main
+#
+
+function ShowUsage()
+{
+ Write-Output "Usage: $Name0 show"
+ Write-Output "or $Name0 admin PORT"
+ Write-Output ""
+ Write-Output "Shows or modifies the Windows locales."
+ Write-Output ""
+ Write-Output "Where:"
+ Write-Output " show Shows the existing TestAgentd tasks."
+ Write-Output " admin Sets up a separate not-elevated-privileges task."
+ Write-Output " PORT Specifies the port TestAgentd should listen on."
+ Write-Output " -? Shows this help message."
+}
+
+$Action = $args[0]
+if ($Action -eq "show") { ShowTasks }
+if ($Action -eq "admin") { SetupAdminTasks $args }
+$Rc = 0
+if ($Action -and $Action -ne "-?" -and $Action -ne "-h" -and $Action -ne "help")
+{
+ echo "$Name0:error: unknown action $Action"
+ $Rc = 2
+}
+ShowUsage
+exit $Rc
Module: tools
Branch: master
Commit: ca643751c642a636e5b2755de6ee92cab74937df
URL: https://source.winehq.org/git/tools.git/?a=commit;h=ca643751c642a636e5b2755…
Author: Francois Gouget <fgouget(a)codeweavers.com>
Date: Thu Feb 24 19:01:03 2022 +0100
testbot/LibvirtTool: Fix detecting the 'high privileges' TestAgentd.
The SetTime() leeway should be 0 otherwise it may skip actually setting
the time and thus not fail if privileges are insufficient.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
testbot/bin/LibvirtTool.pl | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/testbot/bin/LibvirtTool.pl b/testbot/bin/LibvirtTool.pl
index 5e3e7af..ff834ef 100755
--- a/testbot/bin/LibvirtTool.pl
+++ b/testbot/bin/LibvirtTool.pl
@@ -278,7 +278,7 @@ sub GetPrivilegedTA($)
my ($TA) = @_;
# Use SetTime() to detect if privileged operations are allowed.
- return $TA->SetTime() ? $TA : $VM->GetAgent(1);
+ return $TA->SetTime(0) ? $TA : $VM->GetAgent(1);
}
sub RunAndWait($$)
@@ -582,7 +582,7 @@ sub PrepareVM($)
# during the build some ccache versions will return a compilation error).
my $PTA = GetPrivilegedTA($TA);
FatalError("$VMKey has no privileged TestAgent server\n") if (!$PTA);
- if (!$PTA->SetTime())
+ if (!$PTA->SetTime(0))
{
FatalError("Setting the $VMKey system time failed: ". $PTA->GetLastError() ."\n");
}