Wine-devel
Threads by month
- ----- 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
January 2022
- 86 participants
- 717 discussions
03 Jan '22
---
testbot/bin/SetWinLocale | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/testbot/bin/SetWinLocale b/testbot/bin/SetWinLocale
index 8360c76840..e8aff6c9d1 100755
--- a/testbot/bin/SetWinLocale
+++ b/testbot/bin/SetWinLocale
@@ -551,7 +551,9 @@ sub GetWinSettings($)
}
if (($OptKeyboard || $OptDefault) or $All)
{
- $Settings->{InputMethod} = RegGetValue($HKCU_USER_PROFILE, "InputMethodOverride");
+ my $Values = RegGetValues($HKCU_USER_PROFILE, "*");
+ $Settings->{InputMethod} = $Values->{InputMethodOverride};
+ $Settings->{Languages} = $Values->{Languages};
}
if ($OptMUI or $All)
{
@@ -582,6 +584,7 @@ sub ShowWinSettings($)
print "Geo:Nation (--country) = ", Value2Str($Settings->{Country}), "\n";
print "Geo:Name (--country) = ", Value2Str($Settings->{CountryName}), "\n";
print "InputMethod (--keyboard) = ", Value2Str($Settings->{InputMethod}), "\n";
+ print "Languages = ", Value2Str($Settings->{Languages}), "\n";
print "PreferredUILanguages (--mui) = ", Value2Str($Settings->{PreferredUILanguages}), "\n";
print " ...Pending (--mui) = ", Value2Str($Settings->{PreferredUILanguagesPending}), "\n";
print " Previous... (--mui) = ", Value2Str($Settings->{PreviousPreferredUILanguages}), "\n";
--
2.30.2
1
0
Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com>
---
po/fr.po | 160 ++++++++++++++++++++++----------------------------------------
1 file changed, 57 insertions(+), 103 deletions(-)
diff --git a/po/fr.po b/po/fr.po
index 4a1badfad6a..ebc433cbce5 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -5,7 +5,7 @@ msgstr ""
"Project-Id-Version: Wine\n"
"Report-Msgid-Bugs-To: https://bugs.winehq.org\n"
"POT-Creation-Date: N/A\n"
-"PO-Revision-Date: 2022-01-02 15:45+0100\n"
+"PO-Revision-Date: 2022-01-03 13:08+0100\n"
"Last-Translator: Eric Pouech <eric.pouech(a)gmail.com>\n"
"Language-Team: French\n"
"Language: fr\n"
@@ -3134,7 +3134,7 @@ msgstr "Note : la clé privée de ce certificat n'est pas exportable."
#: dlls/cryptui/cryptui.rc:177
msgid "Intended Use"
-msgstr "Utilisation prévue :"
+msgstr "Utilisation prévue"
#: dlls/cryptui/cryptui.rc:178 dlls/shell32/shell32.rc:150
msgid "Location"
@@ -3671,7 +3671,7 @@ msgstr "Utiliser un script Proxy Auto-Config (PAC)"
#: dlls/inetcpl.cpl/inetcpl.rc:128 dlls/inetcpl.cpl/inetcpl.rc:132
msgid "Address:"
-msgstr "Adresse: "
+msgstr "Adresse :"
#: dlls/inetcpl.cpl/inetcpl.rc:130
msgid "Proxy server"
@@ -3683,7 +3683,7 @@ msgstr "Utiliser un serveur mandataire"
#: dlls/inetcpl.cpl/inetcpl.rc:134
msgid "Port:"
-msgstr "Port: "
+msgstr "Port :"
#: dlls/inetcpl.cpl/inetcpl.rc:31
msgid "Internet Settings"
@@ -3809,7 +3809,7 @@ msgstr "Indice hors limites"
#: dlls/jscript/jscript.rc:31
msgid "Out of stack space"
-msgstr "Dépassement de capacité de pile ; "
+msgstr "Dépassement de capacité de pile :"
#: dlls/jscript/jscript.rc:32
msgid "Object required"
@@ -7537,10 +7537,8 @@ msgid "Begin request has already been made.\n"
msgstr ""
#: dlls/mferror/mferror.mc:599
-#, fuzzy
-#| msgid "Object UUID not found.\n"
msgid "Sink has not been finalized.\n"
-msgstr "UUID d'objet introuvable.\n"
+msgstr "Le récepteur n'a pas été finalisé.\n"
#: dlls/mferror/mferror.mc:732
msgid "Clock was stopped\n"
@@ -7582,7 +7580,7 @@ msgstr "Représentation non prise en charge.\n"
#: dlls/mferror/mferror.mc:88
msgid "No more types in the list of suggested media types.\n"
-msgstr ""
+msgstr "Il n'y a plus de types dans la liste de type de médias suggérés.\n"
#: dlls/mferror/mferror.mc:95
msgid "Unsupported service.\n"
@@ -7609,10 +7607,8 @@ msgid "Unsupported scheme.\n"
msgstr "Schéma non pris en charge.\n"
#: dlls/mferror/mferror.mc:151
-#, fuzzy
-#| msgid "Unsupported type.\n"
msgid "Unsupported bytestream type.\n"
-msgstr "Type non pris en charge.\n"
+msgstr "Type de flux d'octets non pris en charge.\n"
#: dlls/mferror/mferror.mc:158
msgid "Unsupported time format.\n"
@@ -7787,10 +7783,8 @@ msgid "Invalid work queue index.\n"
msgstr "Index invalide.\n"
#: dlls/mferror/mferror.mc:438
-#, fuzzy
-#| msgid "No logon servers available.\n"
msgid "No events available.\n"
-msgstr "Aucun serveur de connexion disponible.\n"
+msgstr "Aucun événement disponible.\n"
#: dlls/mferror/mferror.mc:445
#, fuzzy
@@ -7843,18 +7837,16 @@ msgid "No media streams were selected.\n"
msgstr "Aucun flux de données médis n'a été détecté.\n"
#: dlls/mferror/mferror.mc:529
-#, fuzzy
-#| msgid "Unsupported type.\n"
msgid "Unsupported media source characteristics.\n"
-msgstr "Type non pris en charge.\n"
+msgstr "Caractéristiques du média source non prises en charge.\n"
#: dlls/mferror/mferror.mc:536
msgid "Stream sink was removed.\n"
-msgstr ""
+msgstr "Le récepteur de flux a été enlevé.\n"
#: dlls/mferror/mferror.mc:543
msgid "Stream sinks are out of sync.\n"
-msgstr ""
+msgstr "Les récepteurs de flux sont désynchronisés.\n"
#: dlls/mferror/mferror.mc:550
#, fuzzy
@@ -7863,38 +7855,28 @@ msgid "Media sink stream sinks set is fixed.\n"
msgstr "Le registre a été restauré.\n"
#: dlls/mferror/mferror.mc:557
-#, fuzzy
-#| msgid "Domain already exists.\n"
msgid "Stream sink already exists.\n"
-msgstr "Le domaine existe déjà.\n"
+msgstr "Le récepteur de flux existe déjà.\n"
#: dlls/mferror/mferror.mc:564
-#, fuzzy
-#| msgid "Operation canceled by user.\n"
msgid "Sample allocation was canceled.\n"
-msgstr "Opération annulée par l'utilisateur.\n"
+msgstr "L'allocation d'échantillons a été annulée.\n"
#: dlls/mferror/mferror.mc:571
-#, fuzzy
-#| msgid "Directory is not empty.\n"
msgid "Sample allocator is empty.\n"
-msgstr "Le répertoire n'est pas vide.\n"
+msgstr "L'allocateur d'échantillons est vide.\n"
#: dlls/mferror/mferror.mc:578
-#, fuzzy
-#| msgid "Class already exists.\n"
msgid "Sink was already stopped.\n"
-msgstr "La classe existe déjà.\n"
+msgstr "Le récepteur a déjà été arrếté.\n"
#: dlls/mferror/mferror.mc:585
msgid "Bitrate was unknown for ASF file sink.\n"
msgstr ""
#: dlls/mferror/mferror.mc:592
-#, fuzzy
-#| msgid "No data detected.\n"
msgid "No streams were selected for the sink.\n"
-msgstr "Aucune donnée détectée.\n"
+msgstr "Aucun flux n'a été sélectionné pour le récepteur.\n"
#: dlls/mferror/mferror.mc:606
msgid "Metadata was too long.\n"
@@ -7902,21 +7884,19 @@ msgstr "Métadonnées trop longues.\n"
#: dlls/mferror/mferror.mc:613
msgid "No samples were processed by the sink.\n"
-msgstr ""
+msgstr "Aucun échantillon n'a été traité par le récepteur.\n"
#: dlls/mferror/mferror.mc:620
msgid "Sink was not provided with required headers.\n"
-msgstr ""
+msgstr "Le récepteur n'a pas reçu les en-têtes attendues.\n"
#: dlls/mferror/mferror.mc:627
msgid "Optional node is invalid.\n"
msgstr "Le noeud optionnel n'est pas valide.\n"
#: dlls/mferror/mferror.mc:634
-#, fuzzy
-#| msgid "Cannot find the printer."
msgid "Cannot find decryptor.\n"
-msgstr "Impossible de trouver l'imprimante."
+msgstr "Impossible de trouver le décrypteur.\n"
#: dlls/mferror/mferror.mc:641
msgid "Codec was not found.\n"
@@ -8060,7 +8040,7 @@ msgstr ""
#: dlls/msi/msi.rc:32
msgid "path %s not found"
-msgstr "Le chemin %s est introuvable"
+msgstr "le chemin %s est introuvable"
#: dlls/msi/msi.rc:33
msgid "insert disk %s"
@@ -8155,7 +8135,7 @@ msgstr "Nouveau dossier"
#: dlls/msi/msi.rc:91
msgid "Allocating registry space"
-msgstr "Allocation d'espace pour le registre."
+msgstr "Allocation d'espace pour le registre"
#: dlls/msi/msi.rc:92
msgid "Searching for installed applications"
@@ -8212,10 +8192,8 @@ msgid "Installing new services"
msgstr "Installation des nouveaux services"
#: dlls/msi/msi.rc:107
-#, fuzzy
-#| msgid "Install/Uninstall"
msgid "Installing system catalog"
-msgstr "Installation/Désinstallation"
+msgstr "Installation du catalogue système"
#: dlls/msi/msi.rc:108
msgid "Validating install"
@@ -8319,7 +8297,7 @@ msgstr "Suppression des dossiers"
#: dlls/msi/msi.rc:133
msgid "Removing INI files entries"
-msgstr ""
+msgstr "Suppression des entrées dans les fichiers INI"
#: dlls/msi/msi.rc:134
msgid "Removing ODBC components"
@@ -8395,7 +8373,7 @@ msgstr "Suppression de l'enregistrement des bibliothèques de types"
#: dlls/msi/msi.rc:154
msgid "Writing INI files values"
-msgstr ""
+msgstr "Écriture des entrées dans les fichiers INI"
#: dlls/msi/msi.rc:155
msgid "Writing system registry values"
@@ -8483,7 +8461,7 @@ msgstr "Police : [1]"
#: dlls/msi/msi.rc:184 dlls/msi/msi.rc:205
msgid "MIME Content Type: [1], Extension: [2]"
-msgstr ""
+msgstr "Type de contenu MIME : [1], Extension : [2]"
#: dlls/msi/msi.rc:185 dlls/msi/msi.rc:206
msgid "ProgId: [1]"
@@ -8507,11 +8485,11 @@ msgstr "Application : [1], Ligne de commande : [2]"
#: dlls/msi/msi.rc:192 dlls/msi/msi.rc:209
msgid "File: [1], Section: [2], Key: [3], Value: [4]"
-msgstr ""
+msgstr "Fichier : [1], Section : [2], Clé : [3], Valeur : [4]"
#: dlls/msi/msi.rc:193
msgid "Key: [1], Name: [2]"
-msgstr ""
+msgstr "Clé : [1], Nom : [2]"
#: dlls/msi/msi.rc:195 dlls/msi/msi.rc:196
msgid "File: [1], Folder: [2]"
@@ -8523,7 +8501,7 @@ msgstr ""
#: dlls/msi/msi.rc:210
msgid "Key: [1], Name: [2], Value: [3]"
-msgstr ""
+msgstr "Clé : [1], Nom : [2], Valeur : [3]"
#: dlls/msi/msi.rc:72
msgid "{{Fatal error: }}"
@@ -8535,7 +8513,7 @@ msgstr "{{Erreur [1]. }}"
#: dlls/msi/msi.rc:74
msgid "Warning [1]."
-msgstr ""
+msgstr "Alerte : [1]."
#: dlls/msi/msi.rc:75
msgid "Info [1]."
@@ -8915,11 +8893,9 @@ msgid "selected"
msgstr "sélectionné"
#: dlls/oleacc/oleacc.rc:100
-#, fuzzy
-#| msgid "Paused"
msgctxt "object state"
msgid "focused"
-msgstr "En pause"
+msgstr "avec focus"
#: dlls/oleacc/oleacc.rc:101
msgctxt "object state"
@@ -8942,11 +8918,9 @@ msgid "read only"
msgstr "lecture seule"
#: dlls/oleacc/oleacc.rc:105
-#, fuzzy
-#| msgid "Hot Tracked Item"
msgctxt "object state"
msgid "hot tracked"
-msgstr "Élément actif"
+msgstr "actif"
#: dlls/oleacc/oleacc.rc:106
msgctxt "object state"
@@ -8994,10 +8968,9 @@ msgid "offscreen"
msgstr "hors écran"
#: dlls/oleacc/oleacc.rc:115
-#, fuzzy
msgctxt "object state"
msgid "sizeable"
-msgstr "&activer"
+msgstr "dimensionnable"
#: dlls/oleacc/oleacc.rc:116
msgctxt "object state"
@@ -9032,18 +9005,14 @@ msgid "traversed"
msgstr ""
#: dlls/oleacc/oleacc.rc:122
-#, fuzzy
-#| msgid "table"
msgctxt "object state"
msgid "multi selectable"
-msgstr "table"
+msgstr "avec sélection multiple"
#: dlls/oleacc/oleacc.rc:123
-#, fuzzy
-#| msgid "Please select a file."
msgctxt "object state"
msgid "extended selectable"
-msgstr "Sélectionnez un fichier."
+msgstr "avec sélection étendue"
#: dlls/oleacc/oleacc.rc:124
msgctxt "object state"
@@ -9066,7 +9035,6 @@ msgid "protected"
msgstr "protégé"
#: dlls/oleacc/oleacc.rc:128
-#, fuzzy
msgctxt "object state"
msgid "has popup"
msgstr "avec popup"
@@ -9118,7 +9086,7 @@ msgstr "Utiliser une chaîne de connexion"
#: dlls/oledb32/version.rc:75
msgid "&Connection string:"
-msgstr "&Chaîne de connexion"
+msgstr "&Chaîne de connexion :"
#: dlls/oledb32/version.rc:77
msgid "B&uild..."
@@ -9166,11 +9134,11 @@ msgstr "Niveau de protection :"
#: dlls/oledb32/version.rc:101
msgid "Connect:"
-msgstr "Connecté"
+msgstr "Connecté :"
#: dlls/oledb32/version.rc:103
msgid "seconds."
-msgstr "secondes"
+msgstr "secondes."
#: dlls/oledb32/version.rc:104
msgid "A&ccess:"
@@ -9186,17 +9154,15 @@ msgid ""
"value, select a property, then choose Edit Value below."
msgstr ""
"Voici les propriétés à initialiser pour ce type de données. Pour ce faire, "
-"sélectionnez une propriété, et appuyez sur « Modifier valeur... »"
+"sélectionnez une propriété, et appuyez sur « Modifier valeur... »."
#: dlls/oledb32/version.rc:115
msgid "&Edit Value..."
msgstr "&Modifier valeur..."
#: dlls/oledb32/version.rc:49
-#, fuzzy
-#| msgid "Properties"
msgid "Data Link Error"
-msgstr "Propriétés"
+msgstr "Erreur du lien vers les données"
#: dlls/oledb32/version.rc:50
msgid "Please select a provider."
@@ -9953,7 +9919,7 @@ msgstr "Wine est une réalisation de :"
#: dlls/shell32/shell32.rc:332
msgid "Run"
-msgstr "E&xécuter..."
+msgstr "E&xécuter"
#: dlls/shell32/shell32.rc:336
msgid ""
@@ -11196,32 +11162,24 @@ msgid "(UTC-05:00) Eastern Time (US & Canada)"
msgstr ""
#: dlls/tzres/tzres.rc:372
-#, fuzzy
-#| msgid "Date and time"
msgid "Transbaikal Standard Time"
-msgstr "Date et heure"
+msgstr "Heure du Transbaïkal"
#: dlls/tzres/tzres.rc:373
-#, fuzzy
-#| msgid "Date and time"
msgid "Transbaikal Daylight Time"
-msgstr "Date et heure"
+msgstr "Heure d'été du Transbaïkal"
#: dlls/tzres/tzres.rc:374
msgid "(UTC+09:00) Chita"
msgstr ""
#: dlls/tzres/tzres.rc:141
-#, fuzzy
-#| msgid "Central European"
msgid "E. Europe Standard Time"
-msgstr "Européen central"
+msgstr "Heure d'Europe de l'Est"
#: dlls/tzres/tzres.rc:142
-#, fuzzy
-#| msgid "Central European"
msgid "E. Europe Daylight Time"
-msgstr "Européen central"
+msgstr "Heure d'été d'Europe de l'Est"
#: dlls/tzres/tzres.rc:143
msgid "(UTC+02:00) Chisinau"
@@ -11684,14 +11642,12 @@ msgid "(UTC-04:00) Asuncion"
msgstr ""
#: dlls/tzres/tzres.rc:132
-#, fuzzy
-#| msgid "Date and time"
msgid "Dateline Standard Time"
-msgstr "Date et heure"
+msgstr "Heure de la ligne de changement de date"
#: dlls/tzres/tzres.rc:133
msgid "Dateline Daylight Time"
-msgstr ""
+msgstr "Heure d'été de la ligne de changement de date"
#: dlls/tzres/tzres.rc:134
msgid "(UTC-12:00) International Date Line West"
@@ -12221,7 +12177,7 @@ msgstr "Accès refusé"
#: dlls/vbscript/vbscript.rc:41
msgid "Path/File access error"
-msgstr ""
+msgstr "Erreur d'accès au chemin / fichier"
#: dlls/vbscript/vbscript.rc:42
msgid "Path not found"
@@ -12428,7 +12384,7 @@ msgstr "L'URL est invalide.\n"
#: dlls/wininet/winineterror.mc:41
msgid "The URL scheme could not be recognized or is not supported.\n"
-msgstr ""
+msgstr "Le schéma d'URL n'a été reconnu ou n'est pas pris en charge.\n"
#: dlls/wininet/winineterror.mc:46
msgid "The server name could not be resolved.\n"
@@ -12460,11 +12416,11 @@ msgstr ""
msgid ""
"SSL certificate date that was received from the server is bad. The "
"certificate is expired.\n"
-msgstr ""
+msgstr "La date du certificat SSL reçu du serveur est incorrecte : le certificat n'est plus valide.\n"
#: dlls/wininet/winineterror.mc:81
msgid "SSL certificate common name (host name field) is incorrect.\n"
-msgstr ""
+msgstr "Le nom commun (champ host name) du certificat SSL est incorrect.\n"
#: dlls/winmm/winmm.rc:32
msgid "The specified command was carried out."
@@ -13172,10 +13128,8 @@ msgid "Confidentiality Required"
msgstr "Confidentialité requise"
#: dlls/wldap32/wldap32.rc:46
-#, fuzzy
-#| msgid "Shutdown in progress.\n"
msgid "SASL Bind in Progress"
-msgstr "Arrêt du système en cours.\n"
+msgstr "Liaison SASL en cours"
#: dlls/wldap32/wldap32.rc:48
msgid "No Such Attribute"
@@ -14488,7 +14442,7 @@ msgid ""
"the window."
msgstr ""
"La taille du tampon écran doit être plus grande ou égale à celle du tampon "
-"de la fenêtre"
+"de la fenêtre."
#: programs/conhost/conhost.rc:41
msgid "Each character is %1!u! pixels wide and %2!u! pixels high"
@@ -15793,7 +15747,7 @@ msgid ""
msgstr ""
"REG ADD <key> [/v value_name | /ve] [/t type] [/s separator] [/d data] [/f]\n"
"\n"
-" Ajoute un clé au registre ou ajoute une nouvelle valeur à une clé de\n"
+" Ajoute une clé au registre ou ajoute une nouvelle valeur à une clé de\n"
" registre donnée.\n"
"\n"
" <key>\n"
@@ -16491,7 +16445,7 @@ msgstr "Impossible de modifier la clé de registre sélectionnée."
#: programs/regedit/regedit.rc:248
msgid "Unable to create a new registry key."
-msgstr "Impossible de créer un nouvelle clé de registre."
+msgstr "Impossible de créer une nouvelle clé de registre."
#: programs/regedit/regedit.rc:249
msgid "Unable to create a new registry value."
@@ -18145,11 +18099,11 @@ msgstr "&native (Windows)"
#: programs/winecfg/winecfg.rc:210
msgid "Buil&tin then Native"
-msgstr "i&ntégrée puis native"
+msgstr "I&ntégrée puis Native."
#: programs/winecfg/winecfg.rc:211
msgid "Nati&ve then Builtin"
-msgstr "n&ative puis intégrée"
+msgstr "N&ative puis Intégrée"
#: programs/winecfg/winecfg.rc:219
msgid "Select Drive Letter"
1
0
[PATCH] ddraw/tests: Port tests for fullscreen window size reset from d3d9.
by Paul Gofman 03 Jan '22
by Paul Gofman 03 Jan '22
03 Jan '22
Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com>
---
This is a follow up for commit 78533e9e94d4fcae06dd44d29dbed4755d4ac1f4
porting the same test for ddraw. Altough the test result is different,
ddraw doesn't seem to do the same.
What I think is going on in d3d9 (deserves a separate test which I don't have
yet ready) is that d3d9 window hook sends WM_ACTIVATEAPP
whenever it receives WM_SIZE event (dumping messages in flush_events() show
that). Then, WM_ACTIVATEAPP is already processed the way it restores the window
size in Wine but it probably should also remeber the "activated" state and then
the second resize also won't have an effect.
dlls/ddraw/tests/ddraw1.c | 40 ++++++++++++++++++++++++++++++++++++++-
dlls/ddraw/tests/ddraw2.c | 40 ++++++++++++++++++++++++++++++++++++++-
dlls/ddraw/tests/ddraw4.c | 40 ++++++++++++++++++++++++++++++++++++++-
dlls/ddraw/tests/ddraw7.c | 40 ++++++++++++++++++++++++++++++++++++++-
4 files changed, 156 insertions(+), 4 deletions(-)
diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c
index c9f2aead75c..11c14777122 100644
--- a/dlls/ddraw/tests/ddraw1.c
+++ b/dlls/ddraw/tests/ddraw1.c
@@ -14191,7 +14191,7 @@ static void test_vtbl_protection(void)
static BOOL CALLBACK test_window_position_cb(HMONITOR monitor, HDC hdc, RECT *monitor_rect,
LPARAM lparam)
{
- RECT primary_rect, window_rect;
+ RECT primary_rect, window_rect, new_rect;
IDirectDraw *ddraw;
HWND window;
HRESULT hr;
@@ -14214,6 +14214,44 @@ static BOOL CALLBACK test_window_position_cb(HMONITOR monitor, HDC hdc, RECT *mo
ok(EqualRect(&window_rect, &primary_rect), "Expect window rect %s, got %s.\n",
wine_dbgstr_rect(&primary_rect), wine_dbgstr_rect(&window_rect));
+ new_rect = window_rect;
+ --new_rect.right;
+ --new_rect.bottom;
+
+ ret = MoveWindow(window, new_rect.left, new_rect.top, new_rect.right - new_rect.left,
+ new_rect.bottom - new_rect.top, TRUE);
+ ok(ret, "Got unexpected ret %#x, error %#x.\n", ret, GetLastError());
+ ret = GetWindowRect(window, &window_rect);
+ ok(ret, "Got unexpected ret %#x, error %#x.\n", ret, GetLastError());
+ ok(EqualRect(&window_rect, &new_rect),
+ "Expected window rect %s, got %s.\n",
+ wine_dbgstr_rect(monitor_rect), wine_dbgstr_rect(&window_rect));
+ /* After processing window events window rectangle gets restored. But only once, the size set
+ * on the second resize remains. */
+ flush_events();
+ ret = GetWindowRect(window, &window_rect);
+ ok(ret, "Got unexpected ret %#x, error %#x.\n", ret, GetLastError());
+ /* Both Windows and Wine change the size of the window. On Windows it is exactly the new size but in Wine
+ * it may get adjusted depending on window manager. */
+ ok(window_rect.right != monitor_rect->right && window_rect.bottom != monitor_rect->bottom,
+ "Expected window rect %s, got %s.\n",
+ wine_dbgstr_rect(monitor_rect), wine_dbgstr_rect(&window_rect));
+
+ ret = MoveWindow(window, new_rect.left, new_rect.top, new_rect.right - new_rect.left,
+ new_rect.bottom - new_rect.top, TRUE);
+ ok(ret, "Got unexpected ret %#x, error %#x.\n", ret, GetLastError());
+ ret = GetWindowRect(window, &window_rect);
+ ok(ret, "Got unexpected ret %#x, error %#x.\n", ret, GetLastError());
+ ok(EqualRect(&window_rect, &new_rect),
+ "Expected window rect %s, got %s.\n",
+ wine_dbgstr_rect(monitor_rect), wine_dbgstr_rect(&window_rect));
+ flush_events();
+ ret = GetWindowRect(window, &window_rect);
+ ok(ret, "Got unexpected ret %#x, error %#x.\n", ret, GetLastError());
+ ok(window_rect.right != monitor_rect->right && window_rect.bottom != monitor_rect->bottom,
+ "Expected window rect %s, got %s.\n",
+ wine_dbgstr_rect(monitor_rect), wine_dbgstr_rect(&window_rect));
+
/* Window activation should restore the window to fit the whole primary monitor */
ret = SetWindowPos(window, 0, monitor_rect->left, monitor_rect->top, 0, 0,
SWP_NOZORDER | SWP_NOSIZE);
diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c
index 7285c1c3a88..33ad957b644 100644
--- a/dlls/ddraw/tests/ddraw2.c
+++ b/dlls/ddraw/tests/ddraw2.c
@@ -15115,7 +15115,7 @@ done:
static BOOL CALLBACK test_window_position_cb(HMONITOR monitor, HDC hdc, RECT *monitor_rect,
LPARAM lparam)
{
- RECT primary_rect, window_rect;
+ RECT primary_rect, window_rect, new_rect;
IDirectDraw2 *ddraw;
HWND window;
HRESULT hr;
@@ -15138,6 +15138,44 @@ static BOOL CALLBACK test_window_position_cb(HMONITOR monitor, HDC hdc, RECT *mo
ok(EqualRect(&window_rect, &primary_rect), "Expect window rect %s, got %s.\n",
wine_dbgstr_rect(&primary_rect), wine_dbgstr_rect(&window_rect));
+ new_rect = window_rect;
+ --new_rect.right;
+ --new_rect.bottom;
+
+ ret = MoveWindow(window, new_rect.left, new_rect.top, new_rect.right - new_rect.left,
+ new_rect.bottom - new_rect.top, TRUE);
+ ok(ret, "Got unexpected ret %#x, error %#x.\n", ret, GetLastError());
+ ret = GetWindowRect(window, &window_rect);
+ ok(ret, "Got unexpected ret %#x, error %#x.\n", ret, GetLastError());
+ ok(EqualRect(&window_rect, &new_rect),
+ "Expected window rect %s, got %s.\n",
+ wine_dbgstr_rect(monitor_rect), wine_dbgstr_rect(&window_rect));
+ /* After processing window events window rectangle gets restored. But only once, the size set
+ * on the second resize remains. */
+ flush_events();
+ ret = GetWindowRect(window, &window_rect);
+ ok(ret, "Got unexpected ret %#x, error %#x.\n", ret, GetLastError());
+ /* Both Windows and Wine change the size of the window. On Windows it is exactly the new size but in Wine
+ * it may get adjusted depending on window manager. */
+ ok(window_rect.right != monitor_rect->right && window_rect.bottom != monitor_rect->bottom,
+ "Expected window rect %s, got %s.\n",
+ wine_dbgstr_rect(monitor_rect), wine_dbgstr_rect(&window_rect));
+
+ ret = MoveWindow(window, new_rect.left, new_rect.top, new_rect.right - new_rect.left,
+ new_rect.bottom - new_rect.top, TRUE);
+ ok(ret, "Got unexpected ret %#x, error %#x.\n", ret, GetLastError());
+ ret = GetWindowRect(window, &window_rect);
+ ok(ret, "Got unexpected ret %#x, error %#x.\n", ret, GetLastError());
+ ok(EqualRect(&window_rect, &new_rect),
+ "Expected window rect %s, got %s.\n",
+ wine_dbgstr_rect(monitor_rect), wine_dbgstr_rect(&window_rect));
+ flush_events();
+ ret = GetWindowRect(window, &window_rect);
+ ok(ret, "Got unexpected ret %#x, error %#x.\n", ret, GetLastError());
+ ok(window_rect.right != monitor_rect->right && window_rect.bottom != monitor_rect->bottom,
+ "Expected window rect %s, got %s.\n",
+ wine_dbgstr_rect(monitor_rect), wine_dbgstr_rect(&window_rect));
+
/* Window activation should restore the window to fit the whole primary monitor */
ret = SetWindowPos(window, 0, monitor_rect->left, monitor_rect->top, 0, 0,
SWP_NOZORDER | SWP_NOSIZE);
diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c
index 07afc44e519..61828430331 100644
--- a/dlls/ddraw/tests/ddraw4.c
+++ b/dlls/ddraw/tests/ddraw4.c
@@ -18152,7 +18152,7 @@ done:
static BOOL CALLBACK test_window_position_cb(HMONITOR monitor, HDC hdc, RECT *monitor_rect,
LPARAM lparam)
{
- RECT primary_rect, window_rect;
+ RECT primary_rect, window_rect, new_rect;
IDirectDraw4 *ddraw;
HWND window;
HRESULT hr;
@@ -18175,6 +18175,44 @@ static BOOL CALLBACK test_window_position_cb(HMONITOR monitor, HDC hdc, RECT *mo
ok(EqualRect(&window_rect, &primary_rect), "Expect window rect %s, got %s.\n",
wine_dbgstr_rect(&primary_rect), wine_dbgstr_rect(&window_rect));
+ new_rect = window_rect;
+ --new_rect.right;
+ --new_rect.bottom;
+
+ ret = MoveWindow(window, new_rect.left, new_rect.top, new_rect.right - new_rect.left,
+ new_rect.bottom - new_rect.top, TRUE);
+ ok(ret, "Got unexpected ret %#x, error %#x.\n", ret, GetLastError());
+ ret = GetWindowRect(window, &window_rect);
+ ok(ret, "Got unexpected ret %#x, error %#x.\n", ret, GetLastError());
+ ok(EqualRect(&window_rect, &new_rect),
+ "Expected window rect %s, got %s.\n",
+ wine_dbgstr_rect(monitor_rect), wine_dbgstr_rect(&window_rect));
+ /* After processing window events window rectangle gets restored. But only once, the size set
+ * on the second resize remains. */
+ flush_events();
+ ret = GetWindowRect(window, &window_rect);
+ ok(ret, "Got unexpected ret %#x, error %#x.\n", ret, GetLastError());
+ /* Both Windows and Wine change the size of the window. On Windows it is exactly the new size but in Wine
+ * it may get adjusted depending on window manager. */
+ ok(window_rect.right != monitor_rect->right && window_rect.bottom != monitor_rect->bottom,
+ "Expected window rect %s, got %s.\n",
+ wine_dbgstr_rect(monitor_rect), wine_dbgstr_rect(&window_rect));
+
+ ret = MoveWindow(window, new_rect.left, new_rect.top, new_rect.right - new_rect.left,
+ new_rect.bottom - new_rect.top, TRUE);
+ ok(ret, "Got unexpected ret %#x, error %#x.\n", ret, GetLastError());
+ ret = GetWindowRect(window, &window_rect);
+ ok(ret, "Got unexpected ret %#x, error %#x.\n", ret, GetLastError());
+ ok(EqualRect(&window_rect, &new_rect),
+ "Expected window rect %s, got %s.\n",
+ wine_dbgstr_rect(monitor_rect), wine_dbgstr_rect(&window_rect));
+ flush_events();
+ ret = GetWindowRect(window, &window_rect);
+ ok(ret, "Got unexpected ret %#x, error %#x.\n", ret, GetLastError());
+ ok(window_rect.right != monitor_rect->right && window_rect.bottom != monitor_rect->bottom,
+ "Expected window rect %s, got %s.\n",
+ wine_dbgstr_rect(monitor_rect), wine_dbgstr_rect(&window_rect));
+
/* Window activation should restore the window to fit the whole primary monitor */
ret = SetWindowPos(window, 0, monitor_rect->left, monitor_rect->top, 0, 0,
SWP_NOZORDER | SWP_NOSIZE);
diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c
index 29fa3434d4b..fc0f854e125 100644
--- a/dlls/ddraw/tests/ddraw7.c
+++ b/dlls/ddraw/tests/ddraw7.c
@@ -18419,7 +18419,7 @@ done:
static BOOL CALLBACK test_window_position_cb(HMONITOR monitor, HDC hdc, RECT *monitor_rect,
LPARAM lparam)
{
- RECT primary_rect, window_rect;
+ RECT primary_rect, window_rect, new_rect;
IDirectDraw7 *ddraw;
HWND window;
HRESULT hr;
@@ -18442,6 +18442,44 @@ static BOOL CALLBACK test_window_position_cb(HMONITOR monitor, HDC hdc, RECT *mo
ok(EqualRect(&window_rect, &primary_rect), "Expect window rect %s, got %s.\n",
wine_dbgstr_rect(&primary_rect), wine_dbgstr_rect(&window_rect));
+ new_rect = window_rect;
+ --new_rect.right;
+ --new_rect.bottom;
+
+ ret = MoveWindow(window, new_rect.left, new_rect.top, new_rect.right - new_rect.left,
+ new_rect.bottom - new_rect.top, TRUE);
+ ok(ret, "Got unexpected ret %#x, error %#x.\n", ret, GetLastError());
+ ret = GetWindowRect(window, &window_rect);
+ ok(ret, "Got unexpected ret %#x, error %#x.\n", ret, GetLastError());
+ ok(EqualRect(&window_rect, &new_rect),
+ "Expected window rect %s, got %s.\n",
+ wine_dbgstr_rect(monitor_rect), wine_dbgstr_rect(&window_rect));
+ /* After processing window events window rectangle gets restored. But only once, the size set
+ * on the second resize remains. */
+ flush_events();
+ ret = GetWindowRect(window, &window_rect);
+ ok(ret, "Got unexpected ret %#x, error %#x.\n", ret, GetLastError());
+ /* Both Windows and Wine change the size of the window. On Windows it is exactly the new size but in Wine
+ * it may get adjusted depending on window manager. */
+ ok(window_rect.right != monitor_rect->right && window_rect.bottom != monitor_rect->bottom,
+ "Expected window rect %s, got %s.\n",
+ wine_dbgstr_rect(monitor_rect), wine_dbgstr_rect(&window_rect));
+
+ ret = MoveWindow(window, new_rect.left, new_rect.top, new_rect.right - new_rect.left,
+ new_rect.bottom - new_rect.top, TRUE);
+ ok(ret, "Got unexpected ret %#x, error %#x.\n", ret, GetLastError());
+ ret = GetWindowRect(window, &window_rect);
+ ok(ret, "Got unexpected ret %#x, error %#x.\n", ret, GetLastError());
+ ok(EqualRect(&window_rect, &new_rect),
+ "Expected window rect %s, got %s.\n",
+ wine_dbgstr_rect(monitor_rect), wine_dbgstr_rect(&window_rect));
+ flush_events();
+ ret = GetWindowRect(window, &window_rect);
+ ok(ret, "Got unexpected ret %#x, error %#x.\n", ret, GetLastError());
+ ok(window_rect.right != monitor_rect->right && window_rect.bottom != monitor_rect->bottom,
+ "Expected window rect %s, got %s.\n",
+ wine_dbgstr_rect(monitor_rect), wine_dbgstr_rect(&window_rect));
+
/* Window activation should restore the window to fit the whole primary monitor */
ret = SetWindowPos(window, 0, monitor_rect->left, monitor_rect->top, 0, 0,
SWP_NOZORDER | SWP_NOSIZE);
--
2.33.1
3
2
[PATCH] wined3d: Fix memory leak on error path in wined3d_buffer_vk_create_buffer_object (Coverity)
by Alex Henrie 03 Jan '22
by Alex Henrie 03 Jan '22
03 Jan '22
Signed-off-by: Alex Henrie <alexhenrie24(a)gmail.com>
---
dlls/wined3d/buffer.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
index c078ba7e634..b42c7bd919a 100644
--- a/dlls/wined3d/buffer.c
+++ b/dlls/wined3d/buffer.c
@@ -1498,6 +1498,7 @@ static BOOL wined3d_buffer_vk_create_buffer_object(struct wined3d_buffer_vk *buf
vk_memory_type_from_access_flags(resource->access, resource->usage), bo_vk)))
{
WARN("Failed to create Vulkan buffer.\n");
+ heap_free(bo_vk);
return FALSE;
}
--
2.34.1
2
1
[PATCH] dbghelp: don't use .debug_frame section if non present when unwinding
by Eric Pouech 03 Jan '22
by Eric Pouech 03 Jan '22
03 Jan '22
fixes: https://bugs.winehq.org/show_bug.cgi?id=52295
Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com>
---
dlls/dbghelp/dwarf.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/dlls/dbghelp/dwarf.c b/dlls/dbghelp/dwarf.c
index 70613317966..ea70fd915b4 100644
--- a/dlls/dbghelp/dwarf.c
+++ b/dlls/dbghelp/dwarf.c
@@ -3795,7 +3795,8 @@ static BOOL dwarf2_fetch_frame_info(struct module* module, struct cpu* cpu, LONG
fde_ctx.data = modfmt->u.dwarf2_info->debug_frame.address;
fde_ctx.end_data = fde_ctx.data + modfmt->u.dwarf2_info->debug_frame.size;
delta = module->reloc_delta;
- if (!dwarf2_get_cie(ip, module, delta, &fde_ctx, &cie_ctx, info, FALSE))
+ if (modfmt->u.dwarf2_info->debug_frame.address == IMAGE_NO_MAP ||
+ !dwarf2_get_cie(ip, module, delta, &fde_ctx, &cie_ctx, info, FALSE))
{
TRACE("Couldn't find information for %lx\n", ip);
return FALSE;
1
0
[PATCH 1/4] dinput8/tests: Test simple joystick with older dinput versions.
by Rémi Bernon 03 Jan '22
by Rémi Bernon 03 Jan '22
03 Jan '22
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
---
This will overflow the test output limit on Wine, and I'm not sure what
to do about it. I don't think there's an unusually large number of todos
but the number of tests in this file simply has grow very large.
I can split the tests into individual files, if that's better, but I
believe it will make some of the tests run less often if they aren't
touched, which may not be desirable.
dlls/dinput8/tests/hid.c | 464 ++++++++++++++++++++++++++++-----------
1 file changed, 335 insertions(+), 129 deletions(-)
diff --git a/dlls/dinput8/tests/hid.c b/dlls/dinput8/tests/hid.c
index 82657c2e235..17559c61a39 100644
--- a/dlls/dinput8/tests/hid.c
+++ b/dlls/dinput8/tests/hid.c
@@ -3350,8 +3350,11 @@ static BOOL CALLBACK find_test_device( const DIDEVICEINSTANCEW *devinst, void *c
struct check_objects_todos
{
BOOL type;
+ BOOL ofs;
BOOL guid;
+ BOOL flags;
BOOL usage;
+ BOOL usage_page;
BOOL name;
};
@@ -3388,16 +3391,18 @@ static BOOL CALLBACK check_objects( const DIDEVICEOBJECTINSTANCEW *obj, void *ar
check_member( *obj, *exp, "%u", dwSize );
todo_wine_if( todo->guid )
check_member_guid( *obj, *exp, guidType );
- todo_wine_if( params->version < 0x700 && (obj->dwType & DIDFT_BUTTON) )
+ todo_wine_if( todo->ofs )
check_member( *obj, *exp, "%#x", dwOfs );
todo_wine_if( todo->type )
check_member( *obj, *exp, "%#x", dwType );
+ todo_wine_if( todo->flags )
check_member( *obj, *exp, "%#x", dwFlags );
if (!localized) todo_wine_if( todo->name )check_member_wstr( *obj, *exp, tszName );
check_member( *obj, *exp, "%u", dwFFMaxForce );
check_member( *obj, *exp, "%u", dwFFForceResolution );
check_member( *obj, *exp, "%u", wCollectionNumber );
check_member( *obj, *exp, "%u", wDesignatorIndex );
+ todo_wine_if( todo->usage_page )
check_member( *obj, *exp, "%#04x", wUsagePage );
todo_wine_if( todo->usage )
check_member( *obj, *exp, "%#04x", wUsage );
@@ -3681,7 +3686,7 @@ static HRESULT create_dinput_device( DWORD version, DIDEVICEINSTANCEW *devinst,
return DI_OK;
}
-static void test_simple_joystick(void)
+static void test_simple_joystick( DWORD version )
{
#include "psh_hid_macros.h"
static const unsigned char report_desc[] =
@@ -3737,11 +3742,12 @@ static void test_simple_joystick(void)
{
.InputReportByteLength = 9,
};
- static const DIDEVCAPS expect_caps =
+ const DIDEVCAPS expect_caps =
{
.dwSize = sizeof(DIDEVCAPS),
.dwFlags = DIDC_ATTACHED | DIDC_EMULATED,
- .dwDevType = DIDEVTYPE_HID | (DI8DEVTYPEJOYSTICK_LIMITED << 8) | DI8DEVTYPE_JOYSTICK,
+ .dwDevType = version >= 0x800 ? DIDEVTYPE_HID | (DI8DEVTYPEJOYSTICK_LIMITED << 8) | DI8DEVTYPE_JOYSTICK
+ : DIDEVTYPE_HID | (DIDEVTYPEJOYSTICK_RUDDER << 8) | DIDEVTYPE_JOYSTICK,
.dwAxes = 6,
.dwPOVs = 1,
.dwButtons = 2,
@@ -3826,7 +3832,8 @@ static void test_simple_joystick(void)
.dwSize = sizeof(DIDEVICEINSTANCEW),
.guidInstance = expect_guid_product,
.guidProduct = expect_guid_product,
- .dwDevType = DIDEVTYPE_HID | (DI8DEVTYPEJOYSTICK_LIMITED << 8) | DI8DEVTYPE_JOYSTICK,
+ .dwDevType = version >= 0x800 ? DIDEVTYPE_HID | (DI8DEVTYPEJOYSTICK_LIMITED << 8) | DI8DEVTYPE_JOYSTICK
+ : DIDEVTYPE_HID | (DIDEVTYPEJOYSTICK_RUDDER << 8) | DIDEVTYPE_JOYSTICK,
.tszInstanceName = L"Wine test root driver",
.tszProductName = L"Wine test root driver",
.guidFFDriver = GUID_NULL,
@@ -3954,14 +3961,110 @@ static void test_simple_joystick(void)
.wUsage = HID_USAGE_GENERIC_JOYSTICK,
},
};
- const DIEFFECTINFOW expect_effects[] = {};
-
+ const DIDEVICEOBJECTINSTANCEW expect_objects_5[] =
+ {
+ {
+ .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW),
+ .guidType = GUID_XAxis,
+ .dwOfs = DIJOFS_X,
+ .dwType = DIDFT_ABSAXIS|DIDFT_MAKEINSTANCE(0),
+ .dwFlags = DIDOI_ASPECTPOSITION,
+ .tszName = L"X Axis",
+ .wCollectionNumber = 1,
+ .wUsagePage = HID_USAGE_PAGE_GENERIC,
+ .wUsage = HID_USAGE_GENERIC_X,
+ .wReportId = 1,
+ },
+ {
+ .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW),
+ .guidType = GUID_YAxis,
+ .dwOfs = DIJOFS_Y,
+ .dwType = DIDFT_ABSAXIS|DIDFT_MAKEINSTANCE(1),
+ .dwFlags = DIDOI_ASPECTPOSITION,
+ .tszName = L"Y Axis",
+ .wCollectionNumber = 1,
+ .wUsagePage = HID_USAGE_PAGE_GENERIC,
+ .wUsage = HID_USAGE_GENERIC_Y,
+ .wReportId = 1,
+ },
+ {
+ .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW),
+ .guidType = GUID_ZAxis,
+ .dwOfs = DIJOFS_Z,
+ .dwType = DIDFT_ABSAXIS|DIDFT_MAKEINSTANCE(2),
+ .dwFlags = DIDOI_ASPECTPOSITION,
+ .tszName = L"Wheel",
+ .wCollectionNumber = 1,
+ .wUsagePage = HID_USAGE_PAGE_GENERIC,
+ .wUsage = HID_USAGE_GENERIC_WHEEL,
+ .wReportId = 1,
+ },
+ {
+ .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW),
+ .guidType = GUID_RzAxis,
+ .dwOfs = DIJOFS_RZ,
+ .dwType = DIDFT_ABSAXIS|DIDFT_MAKEINSTANCE(5),
+ .dwFlags = DIDOI_ASPECTPOSITION,
+ .tszName = L"Rudder",
+ .wCollectionNumber = 1,
+ .wUsagePage = HID_USAGE_PAGE_SIMULATION,
+ .wUsage = HID_USAGE_SIMULATION_RUDDER,
+ .wReportId = 1,
+ },
+ {
+ .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW),
+ .guidType = GUID_POV,
+ .dwOfs = DIJOFS_POV(0),
+ .dwType = DIDFT_POV|DIDFT_MAKEINSTANCE(0),
+ .tszName = L"Hat Switch",
+ .wCollectionNumber = 1,
+ .wUsagePage = HID_USAGE_PAGE_GENERIC,
+ .wUsage = HID_USAGE_GENERIC_HATSWITCH,
+ .wReportId = 1,
+ },
+ {
+ .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW),
+ .guidType = GUID_Button,
+ .dwOfs = DIJOFS_BUTTON(0),
+ .dwType = DIDFT_PSHBUTTON|DIDFT_MAKEINSTANCE(0),
+ .tszName = L"Button 0",
+ .wCollectionNumber = 1,
+ .wUsagePage = HID_USAGE_PAGE_BUTTON,
+ .wUsage = 0x1,
+ .wReportId = 1,
+ },
+ {
+ .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW),
+ .guidType = GUID_Button,
+ .dwOfs = DIJOFS_BUTTON(1),
+ .dwType = DIDFT_PSHBUTTON|DIDFT_MAKEINSTANCE(1),
+ .tszName = L"Button 1",
+ .wCollectionNumber = 1,
+ .wUsagePage = HID_USAGE_PAGE_BUTTON,
+ .wUsage = 0x2,
+ .wReportId = 1,
+ },
+ };
+ struct check_objects_todos todo_objects_5[ARRAY_SIZE(expect_objects_5)] =
+ {
+ {.guid = TRUE, .type = TRUE, .flags = TRUE, .usage = TRUE, .usage_page = TRUE, .name = TRUE},
+ {.guid = TRUE, .type = TRUE, .flags = TRUE, .usage = TRUE, .usage_page = TRUE, .name = TRUE},
+ {.guid = TRUE, .type = TRUE, .usage = TRUE, .usage_page = TRUE, .name = TRUE},
+ {.guid = TRUE, .ofs = TRUE, .type = TRUE, .usage = TRUE, .usage_page = TRUE, .name = TRUE},
+ {.guid = TRUE, .ofs = TRUE, .type = TRUE, .flags = TRUE, .usage = TRUE, .name = TRUE},
+ {.guid = TRUE, .ofs = TRUE, .type = TRUE, .flags = TRUE, .usage = TRUE, .usage_page = TRUE, .name = TRUE},
+ {.guid = TRUE, .ofs = TRUE, .type = TRUE, .usage = TRUE, .usage_page = TRUE, .name = TRUE},
+ };
struct check_objects_params check_objects_params =
{
- .version = DIRECTINPUT_VERSION,
- .expect_count = ARRAY_SIZE(expect_objects),
- .expect_objs = expect_objects,
+ .version = version,
+ .expect_count = version < 0x700 ? ARRAY_SIZE(expect_objects_5) : ARRAY_SIZE(expect_objects),
+ .expect_objs = version < 0x700 ? expect_objects_5 : expect_objects,
+ .todo_objs = version < 0x700 ? todo_objects_5 : NULL,
+ .todo_extra = version < 0x700 ? TRUE : FALSE,
};
+
+ const DIEFFECTINFOW expect_effects[] = {};
struct check_effects_params check_effects_params =
{
.expect_count = ARRAY_SIZE(expect_effects),
@@ -4015,44 +4118,55 @@ static void test_simple_joystick(void)
WCHAR cwd[MAX_PATH], tempdir[MAX_PATH];
DIDEVICEOBJECTDATA objdata[32] = {{0}};
DIDEVICEOBJECTINSTANCEW objinst = {0};
+ DIDEVICEOBJECTINSTANCEW expect_obj;
DIDEVICEINSTANCEW devinst = {0};
DIEFFECTINFOW effectinfo = {0};
DIDATAFORMAT dataformat = {0};
IDirectInputDevice8W *device;
IDirectInputEffect *effect;
DIEFFESCAPE escape = {0};
+ ULONG i, size, res, ref;
DIDEVCAPS caps = {0};
HANDLE event, file;
char buffer[1024];
DIJOYSTATE2 state;
- ULONG i, res, ref;
HRESULT hr;
WCHAR *tmp;
GUID guid;
HWND hwnd;
+ winetest_push_context( "version %#x", version );
+
GetCurrentDirectoryW( ARRAY_SIZE(cwd), cwd );
GetTempPathW( ARRAY_SIZE(tempdir), tempdir );
SetCurrentDirectoryW( tempdir );
cleanup_registry_keys();
if (!dinput_driver_start( report_desc, sizeof(report_desc), &hid_caps, NULL, 0 )) goto done;
- if (FAILED(hr = create_dinput_device( DIRECTINPUT_VERSION, &devinst, &device ))) goto done;
+ if (FAILED(hr = create_dinput_device( version, &devinst, &device ))) goto done;
- hr = IDirectInputDevice8_Initialize( device, instance, 0x0700, &GUID_NULL );
- todo_wine
- ok( hr == DIERR_BETADIRECTINPUTVERSION, "Initialize returned %#x\n", hr );
- hr = IDirectInputDevice8_Initialize( device, instance, DIRECTINPUT_VERSION, NULL );
+ hr = IDirectInputDevice8_Initialize( device, instance, 0x800 - (version - 0x700), &GUID_NULL );
+ if (version == 0x800)
+ {
+ todo_wine
+ ok( hr == DIERR_BETADIRECTINPUTVERSION, "Initialize returned %#x\n", hr );
+ }
+ else
+ {
+ todo_wine
+ ok( hr == DIERR_OLDDIRECTINPUTVERSION, "Initialize returned %#x\n", hr );
+ }
+ hr = IDirectInputDevice8_Initialize( device, instance, version, NULL );
todo_wine
ok( hr == E_POINTER, "Initialize returned %#x\n", hr );
- hr = IDirectInputDevice8_Initialize( device, NULL, DIRECTINPUT_VERSION, &GUID_NULL );
+ hr = IDirectInputDevice8_Initialize( device, NULL, version, &GUID_NULL );
todo_wine
ok( hr == DIERR_INVALIDPARAM, "Initialize returned %#x\n", hr );
- hr = IDirectInputDevice8_Initialize( device, instance, DIRECTINPUT_VERSION, &GUID_NULL );
+ hr = IDirectInputDevice8_Initialize( device, instance, version, &GUID_NULL );
todo_wine
ok( hr == REGDB_E_CLASSNOTREG, "Initialize returned %#x\n", hr );
- hr = IDirectInputDevice8_Initialize( device, instance, DIRECTINPUT_VERSION, &devinst.guidInstance );
+ hr = IDirectInputDevice8_Initialize( device, instance, version, &devinst.guidInstance );
ok( hr == DI_OK, "Initialize returned %#x\n", hr );
guid = devinst.guidInstance;
memset( &devinst, 0, sizeof(devinst) );
@@ -4061,7 +4175,7 @@ static void test_simple_joystick(void)
ok( hr == DI_OK, "GetDeviceInfo returned %#x\n", hr );
ok( IsEqualGUID( &guid, &devinst.guidInstance ), "got %s expected %s\n", debugstr_guid( &guid ),
debugstr_guid( &devinst.guidInstance ) );
- hr = IDirectInputDevice8_Initialize( device, instance, DIRECTINPUT_VERSION, &devinst.guidProduct );
+ hr = IDirectInputDevice8_Initialize( device, instance, version, &devinst.guidProduct );
ok( hr == DI_OK, "Initialize returned %#x\n", hr );
hr = IDirectInputDevice8_GetDeviceInfo( device, NULL );
@@ -4076,6 +4190,7 @@ static void test_simple_joystick(void)
todo_wine
check_member_guid( devinst, expect_devinst, guidInstance );
check_member_guid( devinst, expect_devinst, guidProduct );
+ todo_wine_if( version < 0x0800 )
check_member( devinst, expect_devinst, "%#x", dwDevType );
todo_wine
check_member_wstr( devinst, expect_devinst, tszInstanceName );
@@ -4090,6 +4205,7 @@ static void test_simple_joystick(void)
todo_wine
check_member_guid( devinst, expect_devinst, guidInstance );
check_member_guid( devinst, expect_devinst, guidProduct );
+ todo_wine_if( version < 0x0800 )
check_member( devinst, expect_devinst, "%#x", dwDevType );
todo_wine
check_member_wstr( devinst, expect_devinst, tszInstanceName );
@@ -4108,6 +4224,7 @@ static void test_simple_joystick(void)
ok( hr == DI_OK, "GetCapabilities returned %#x\n", hr );
check_member( caps, expect_caps, "%d", dwSize );
check_member( caps, expect_caps, "%#x", dwFlags );
+ todo_wine_if( version < 0x0800 )
check_member( caps, expect_caps, "%#x", dwDevType );
check_member( caps, expect_caps, "%d", dwAxes );
check_member( caps, expect_caps, "%d", dwButtons );
@@ -4125,7 +4242,9 @@ static void test_simple_joystick(void)
hr = IDirectInputDevice8_GetProperty( device, DIPROP_VIDPID, NULL );
ok( hr == DIERR_INVALIDPARAM, "GetProperty returned %#x\n", hr );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_VIDPID, &prop_string.diph );
- ok( hr == DIERR_INVALIDPARAM, "GetProperty returned %#x\n", hr );
+ todo_wine_if( version < 0x0800 )
+ ok( hr == (version < 0x0800 ? DIERR_UNSUPPORTED : DIERR_INVALIDPARAM),
+ "GetProperty DIPROP_VIDPID returned %#x\n", hr );
prop_dword.diph.dwHeaderSize = sizeof(DIPROPHEADER) - 1;
hr = IDirectInputDevice8_GetProperty( device, DIPROP_VIDPID, &prop_dword.diph );
ok( hr == DIERR_INVALIDPARAM, "GetProperty returned %#x\n", hr );
@@ -4133,8 +4252,14 @@ static void test_simple_joystick(void)
prop_dword.dwData = 0xdeadbeef;
hr = IDirectInputDevice8_GetProperty( device, DIPROP_VIDPID, &prop_dword.diph );
- ok( hr == DI_OK, "GetProperty DIPROP_VIDPID returned %#x\n", hr );
- ok( prop_dword.dwData == EXPECT_VIDPID, "got %#x expected %#x\n", prop_dword.dwData, EXPECT_VIDPID );
+ todo_wine_if( version < 0x0800 )
+ ok( hr == (version < 0x0800 ? DIERR_UNSUPPORTED : DI_OK),
+ "GetProperty DIPROP_VIDPID returned %#x\n", hr );
+ if (hr == DI_OK)
+ {
+ ok( prop_dword.dwData == EXPECT_VIDPID, "got %#x expected %#x\n",
+ prop_dword.dwData, EXPECT_VIDPID );
+ }
hr = IDirectInputDevice8_GetProperty( device, DIPROP_GUIDANDPATH, &prop_guid_path.diph );
ok( hr == DI_OK, "GetProperty DIPROP_GUIDANDPATH returned %#x\n", hr );
@@ -4163,14 +4288,23 @@ static void test_simple_joystick(void)
ok( !wcscmp( prop_string.wsz, expect_devinst.tszProductName ), "got product %s\n",
debugstr_w(prop_string.wsz) );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_TYPENAME, &prop_string.diph );
- todo_wine
- ok( hr == DI_OK, "GetProperty DIPROP_TYPENAME returned %#x\n", hr );
- todo_wine
- ok( !wcscmp( prop_string.wsz, expect_vidpid_str ), "got type %s\n", debugstr_w(prop_string.wsz) );
+ todo_wine_if( version >= 0x0800 )
+ ok( hr == (version < 0x0800 ? DIERR_UNSUPPORTED : DI_OK),
+ "GetProperty DIPROP_TYPENAME returned %#x\n", hr );
+ if (hr == DI_OK)
+ {
+ todo_wine
+ ok( !wcscmp( prop_string.wsz, expect_vidpid_str ), "got type %s\n", debugstr_w(prop_string.wsz) );
+ }
hr = IDirectInputDevice8_GetProperty( device, DIPROP_USERNAME, &prop_string.diph );
- ok( hr == S_FALSE, "GetProperty DIPROP_USERNAME returned %#x\n", hr );
- todo_wine
- ok( !wcscmp( prop_string.wsz, L"" ), "got user %s\n", debugstr_w(prop_string.wsz) );
+ todo_wine_if( version < 0x0800 )
+ ok( hr == (version < 0x0800 ? DIERR_UNSUPPORTED : DI_NOEFFECT),
+ "GetProperty DIPROP_USERNAME returned %#x\n", hr );
+ if (hr == DI_NOEFFECT)
+ {
+ todo_wine
+ ok( !wcscmp( prop_string.wsz, L"" ), "got user %s\n", debugstr_w(prop_string.wsz) );
+ }
prop_dword.dwData = 0xdeadbeef;
hr = IDirectInputDevice8_GetProperty( device, DIPROP_JOYSTICKID, &prop_dword.diph );
@@ -4210,7 +4344,9 @@ static void test_simple_joystick(void)
hr = IDirectInputDevice8_GetProperty( device, DIPROP_RANGE, &prop_range.diph );
ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_RANGE returned %#x\n", hr );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_KEYNAME, &prop_string.diph );
- ok( hr == DIERR_INVALIDPARAM, "GetProperty DIPROP_KEYNAME returned %#x\n", hr );
+ todo_wine_if( version < 0x0800 )
+ ok( hr == (version < 0x0800 ? DIERR_UNSUPPORTED : DIERR_INVALIDPARAM),
+ "GetProperty DIPROP_KEYNAME returned %#x\n", hr );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_LOGICALRANGE, &prop_range.diph );
ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_LOGICALRANGE returned %#x\n", hr );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_PHYSICALRANGE, &prop_range.diph );
@@ -4238,9 +4374,14 @@ static void test_simple_joystick(void)
prop_string.diph.dwHow = DIPH_BYUSAGE;
prop_string.diph.dwObj = MAKELONG( HID_USAGE_GENERIC_X, HID_USAGE_PAGE_GENERIC );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_KEYNAME, &prop_string.diph );
- ok( hr == DI_OK, "GetProperty DIPROP_KEYNAME returned %#x\n", hr );
- ok( !wcscmp( prop_string.wsz, expect_objects[4].tszName ), "got DIPROP_KEYNAME %s\n",
- debugstr_w( prop_string.wsz ) );
+ todo_wine_if( version < 0x0800 )
+ ok( hr == (version < 0x0800 ? DIERR_UNSUPPORTED : DI_OK),
+ "GetProperty DIPROP_KEYNAME returned %#x\n", hr );
+ if (hr == DI_OK)
+ {
+ ok( !wcscmp( prop_string.wsz, expect_objects[4].tszName ), "got DIPROP_KEYNAME %s\n",
+ debugstr_w( prop_string.wsz ) );
+ }
prop_string.diph.dwObj = MAKELONG( 0x1, HID_USAGE_PAGE_BUTTON );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_KEYNAME, &prop_string.diph );
todo_wine
@@ -4255,7 +4396,9 @@ static void test_simple_joystick(void)
prop_range.lMin = 0xdeadbeef;
prop_range.lMax = 0xdeadbeef;
hr = IDirectInputDevice8_GetProperty( device, DIPROP_RANGE, &prop_range.diph );
- ok( hr == DIERR_NOTFOUND, "GetProperty DIPROP_RANGE returned %#x\n", hr );
+ todo_wine_if( version < 0x0800 )
+ ok( hr == (version < 0x0800 ? DI_OK : DIERR_NOTFOUND),
+ "GetProperty DIPROP_RANGE returned %#x\n", hr );
prop_range.diph.dwObj = MAKELONG( 0, HID_USAGE_PAGE_GENERIC );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_RANGE, &prop_range.diph );
ok( hr == DIERR_NOTFOUND, "GetProperty DIPROP_RANGE returned %#x\n", hr );
@@ -4270,19 +4413,33 @@ static void test_simple_joystick(void)
ok( prop_range.lMin == 0, "got %d expected %d\n", prop_range.lMin, 0 );
ok( prop_range.lMax == 65535, "got %d expected %d\n", prop_range.lMax, 65535 );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_LOGICALRANGE, &prop_range.diph );
- ok( hr == DI_OK, "GetProperty DIPROP_LOGICALRANGE returned %#x\n", hr );
- ok( prop_range.lMin == -25, "got %d expected %d\n", prop_range.lMin, -25 );
- ok( prop_range.lMax == 56, "got %d expected %d\n", prop_range.lMax, 56 );
+ todo_wine_if( version < 0x0800 )
+ ok( hr == (version < 0x0800 ? DIERR_UNSUPPORTED : DI_OK),
+ "GetProperty DIPROP_LOGICALRANGE returned %#x\n", hr );
+ if (hr == DI_OK)
+ {
+ ok( prop_range.lMin == -25, "got %d expected %d\n", prop_range.lMin, -25 );
+ ok( prop_range.lMax == 56, "got %d expected %d\n", prop_range.lMax, 56 );
+ }
hr = IDirectInputDevice8_GetProperty( device, DIPROP_PHYSICALRANGE, &prop_range.diph );
- ok( hr == DI_OK, "GetProperty DIPROP_PHYSICALRANGE returned %#x\n", hr );
- ok( prop_range.lMin == -25, "got %d expected %d\n", prop_range.lMin, -25 );
- ok( prop_range.lMax == 56, "got %d expected %d\n", prop_range.lMax, 56 );
+ todo_wine_if( version < 0x0800 )
+ ok( hr == (version < 0x0800 ? DIERR_UNSUPPORTED : DI_OK),
+ "GetProperty DIPROP_PHYSICALRANGE returned %#x\n", hr );
+ if (hr == DI_OK)
+ {
+ ok( prop_range.lMin == -25, "got %d expected %d\n", prop_range.lMin, -25 );
+ ok( prop_range.lMax == 56, "got %d expected %d\n", prop_range.lMax, 56 );
+ }
prop_pointer.diph.dwHow = DIPH_BYUSAGE;
prop_pointer.diph.dwObj = MAKELONG( HID_USAGE_GENERIC_X, HID_USAGE_PAGE_GENERIC );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_APPDATA, &prop_pointer.diph );
- todo_wine
- ok( hr == DIERR_NOTINITIALIZED, "GetProperty DIPROP_APPDATA returned %#x\n", hr );
+ if (version < 0x0800) ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_APPDATA returned %#x\n", hr );
+ else
+ {
+ todo_wine
+ ok( hr == DIERR_NOTINITIALIZED, "GetProperty DIPROP_APPDATA returned %#x\n", hr );
+ }
hr = IDirectInputDevice8_EnumObjects( device, NULL, NULL, DIDFT_ALL );
ok( hr == DIERR_INVALIDPARAM, "EnumObjects returned %#x\n", hr );
@@ -4291,7 +4448,8 @@ static void test_simple_joystick(void)
res = 0;
hr = IDirectInputDevice8_EnumObjects( device, check_object_count, &res, DIDFT_AXIS | DIDFT_PSHBUTTON );
ok( hr == DI_OK, "EnumObjects returned %#x\n", hr );
- ok( res == 8, "got %u expected %u\n", res, 8 );
+ todo_wine_if( version < 0x0700 )
+ ok( res == (version < 0x0700 ? 6 : 8), "got %u objects\n", res );
hr = IDirectInputDevice8_EnumObjects( device, check_objects, &check_objects_params, DIDFT_ALL );
ok( hr == DI_OK, "EnumObjects returned %#x\n", hr );
ok( check_objects_params.index >= check_objects_params.expect_count, "missing %u objects\n",
@@ -4307,26 +4465,30 @@ static void test_simple_joystick(void)
res = MAKELONG( HID_USAGE_GENERIC_Z, HID_USAGE_PAGE_GENERIC );
hr = IDirectInputDevice8_GetObjectInfo( device, &objinst, res, DIPH_BYUSAGE );
- ok( hr == DIERR_NOTFOUND, "GetObjectInfo returned: %#x\n", hr );
+ todo_wine_if( version < 0x0800 )
+ ok( hr == (version < 0x0800 ? DI_OK : DIERR_NOTFOUND), "GetObjectInfo returned: %#x\n", hr );
res = MAKELONG( HID_USAGE_GENERIC_X, HID_USAGE_PAGE_GENERIC );
hr = IDirectInputDevice8_GetObjectInfo( device, &objinst, res, DIPH_BYUSAGE );
ok( hr == DI_OK, "GetObjectInfo returned: %#x\n", hr );
- check_member( objinst, expect_objects[4], "%u", dwSize );
- check_member_guid( objinst, expect_objects[4], guidType );
- check_member( objinst, expect_objects[4], "%#x", dwOfs );
- check_member( objinst, expect_objects[4], "%#x", dwType );
- check_member( objinst, expect_objects[4], "%#x", dwFlags );
- if (!localized) check_member_wstr( objinst, expect_objects[4], tszName );
- check_member( objinst, expect_objects[4], "%u", dwFFMaxForce );
- check_member( objinst, expect_objects[4], "%u", dwFFForceResolution );
- check_member( objinst, expect_objects[4], "%u", wCollectionNumber );
- check_member( objinst, expect_objects[4], "%u", wDesignatorIndex );
- check_member( objinst, expect_objects[4], "%#04x", wUsagePage );
- check_member( objinst, expect_objects[4], "%#04x", wUsage );
- check_member( objinst, expect_objects[4], "%#04x", dwDimension );
- check_member( objinst, expect_objects[4], "%#04x", wExponent );
- check_member( objinst, expect_objects[4], "%u", wReportId );
+ if (version < 0x0700) expect_obj = expect_objects_5[0];
+ else expect_obj = expect_objects[4];
+ check_member( objinst, expect_obj, "%u", dwSize );
+ check_member_guid( objinst, expect_obj, guidType );
+ todo_wine_if( version < 0x0700 )
+ check_member( objinst, expect_obj, "%#x", dwOfs );
+ check_member( objinst, expect_obj, "%#x", dwType );
+ check_member( objinst, expect_obj, "%#x", dwFlags );
+ if (!localized) check_member_wstr( objinst, expect_obj, tszName );
+ check_member( objinst, expect_obj, "%u", dwFFMaxForce );
+ check_member( objinst, expect_obj, "%u", dwFFForceResolution );
+ check_member( objinst, expect_obj, "%u", wCollectionNumber );
+ check_member( objinst, expect_obj, "%u", wDesignatorIndex );
+ check_member( objinst, expect_obj, "%#04x", wUsagePage );
+ check_member( objinst, expect_obj, "%#04x", wUsage );
+ check_member( objinst, expect_obj, "%#04x", dwDimension );
+ check_member( objinst, expect_obj, "%#04x", wExponent );
+ check_member( objinst, expect_obj, "%u", wReportId );
hr = IDirectInputDevice8_GetObjectInfo( device, &objinst, 0x14, DIPH_BYOFFSET );
ok( hr == DIERR_NOTFOUND, "GetObjectInfo returned: %#x\n", hr );
@@ -4339,21 +4501,24 @@ static void test_simple_joystick(void)
hr = IDirectInputDevice8_GetObjectInfo( device, &objinst, res, DIPH_BYID );
ok( hr == DI_OK, "GetObjectInfo returned: %#x\n", hr );
- check_member( objinst, expect_objects[8], "%u", dwSize );
- check_member_guid( objinst, expect_objects[8], guidType );
- check_member( objinst, expect_objects[8], "%#x", dwOfs );
- check_member( objinst, expect_objects[8], "%#x", dwType );
- check_member( objinst, expect_objects[8], "%#x", dwFlags );
- if (!localized) check_member_wstr( objinst, expect_objects[8], tszName );
- check_member( objinst, expect_objects[8], "%u", dwFFMaxForce );
- check_member( objinst, expect_objects[8], "%u", dwFFForceResolution );
- check_member( objinst, expect_objects[8], "%u", wCollectionNumber );
- check_member( objinst, expect_objects[8], "%u", wDesignatorIndex );
- check_member( objinst, expect_objects[8], "%#04x", wUsagePage );
- check_member( objinst, expect_objects[8], "%#04x", wUsage );
- check_member( objinst, expect_objects[8], "%#04x", dwDimension );
- check_member( objinst, expect_objects[8], "%#04x", wExponent );
- check_member( objinst, expect_objects[8], "%u", wReportId );
+ if (version < 0x0700) expect_obj = expect_objects_5[6];
+ else expect_obj = expect_objects[8];
+ check_member( objinst, expect_obj, "%u", dwSize );
+ check_member_guid( objinst, expect_obj, guidType );
+ todo_wine_if( version < 0x0700 )
+ check_member( objinst, expect_obj, "%#x", dwOfs );
+ check_member( objinst, expect_obj, "%#x", dwType );
+ check_member( objinst, expect_obj, "%#x", dwFlags );
+ if (!localized) check_member_wstr( objinst, expect_obj, tszName );
+ check_member( objinst, expect_obj, "%u", dwFFMaxForce );
+ check_member( objinst, expect_obj, "%u", dwFFForceResolution );
+ check_member( objinst, expect_obj, "%u", wCollectionNumber );
+ check_member( objinst, expect_obj, "%u", wDesignatorIndex );
+ check_member( objinst, expect_obj, "%#04x", wUsagePage );
+ check_member( objinst, expect_obj, "%#04x", wUsage );
+ check_member( objinst, expect_obj, "%#04x", dwDimension );
+ check_member( objinst, expect_obj, "%#04x", wExponent );
+ check_member( objinst, expect_obj, "%u", wReportId );
hr = IDirectInputDevice8_EnumEffects( device, NULL, NULL, DIEFT_ALL );
ok( hr == DIERR_INVALIDPARAM, "EnumEffects returned %#x\n", hr );
@@ -4397,21 +4562,25 @@ static void test_simple_joystick(void)
hr = IDirectInputDevice8_GetObjectInfo( device, &objinst, DIJOFS_Y, DIPH_BYOFFSET );
ok( hr == DI_OK, "GetObjectInfo returned: %#x\n", hr );
- check_member( objinst, expect_objects[3], "%u", dwSize );
- check_member_guid( objinst, expect_objects[3], guidType );
- check_member( objinst, expect_objects[3], "%#x", dwOfs );
- check_member( objinst, expect_objects[3], "%#x", dwType );
- check_member( objinst, expect_objects[3], "%#x", dwFlags );
- if (!localized) check_member_wstr( objinst, expect_objects[3], tszName );
- check_member( objinst, expect_objects[3], "%u", dwFFMaxForce );
- check_member( objinst, expect_objects[3], "%u", dwFFForceResolution );
- check_member( objinst, expect_objects[3], "%u", wCollectionNumber );
- check_member( objinst, expect_objects[3], "%u", wDesignatorIndex );
- check_member( objinst, expect_objects[3], "%#04x", wUsagePage );
- check_member( objinst, expect_objects[3], "%#04x", wUsage );
- check_member( objinst, expect_objects[3], "%#04x", dwDimension );
- check_member( objinst, expect_objects[3], "%#04x", wExponent );
- check_member( objinst, expect_objects[3], "%u", wReportId );
+ if (version < 0x0700) expect_obj = expect_objects_5[1];
+ else expect_obj = expect_objects[3];
+ if (version < 0x0800) expect_obj.dwOfs = DIJOFS_Y;
+ check_member( objinst, expect_obj, "%u", dwSize );
+ check_member_guid( objinst, expect_obj, guidType );
+ todo_wine_if( version < 0x0800 )
+ check_member( objinst, expect_obj, "%#x", dwOfs );
+ check_member( objinst, expect_obj, "%#x", dwType );
+ check_member( objinst, expect_obj, "%#x", dwFlags );
+ if (!localized) check_member_wstr( objinst, expect_obj, tszName );
+ check_member( objinst, expect_obj, "%u", dwFFMaxForce );
+ check_member( objinst, expect_obj, "%u", dwFFForceResolution );
+ check_member( objinst, expect_obj, "%u", wCollectionNumber );
+ check_member( objinst, expect_obj, "%u", wDesignatorIndex );
+ check_member( objinst, expect_obj, "%#04x", wUsagePage );
+ check_member( objinst, expect_obj, "%#04x", wUsage );
+ check_member( objinst, expect_obj, "%#04x", dwDimension );
+ check_member( objinst, expect_obj, "%#04x", wExponent );
+ check_member( objinst, expect_obj, "%u", wReportId );
hr = IDirectInputDevice8_SetEventNotification( device, (HANDLE)0xdeadbeef );
todo_wine
@@ -4472,7 +4641,8 @@ static void test_simple_joystick(void)
ok( hr == DI_OK, "Acquire returned: %#x\n", hr );
hr = IDirectInputDevice8_Poll( device );
- ok( hr == DI_NOEFFECT, "Poll returned: %#x\n", hr );
+ todo_wine_if( version < 0x0700 )
+ ok( hr == (version < 0x0700 ? DI_OK : DI_NOEFFECT), "Poll returned: %#x\n", hr );
hr = IDirectInputDevice8_GetDeviceState( device, sizeof(DIJOYSTATE2) + 1, &state );
ok( hr == DIERR_INVALIDPARAM, "GetDeviceState returned: %#x\n", hr );
@@ -4516,11 +4686,16 @@ static void test_simple_joystick(void)
winetest_pop_context();
res = 1;
- hr = IDirectInputDevice8_GetDeviceData( device, sizeof(DIDEVICEOBJECTDATA) - 1, objdata, &res, DIGDD_PEEK );
- todo_wine
- ok( hr == DIERR_INVALIDPARAM, "GetDeviceData returned %#x\n", hr );
+ size = version < 0x0800 ? sizeof(DIDEVICEOBJECTDATA_DX3) : sizeof(DIDEVICEOBJECTDATA);
+ hr = IDirectInputDevice8_GetDeviceData( device, size - 1, objdata, &res, DIGDD_PEEK );
+ if (version < 0x0800) ok( hr == DI_OK, "GetDeviceData returned %#x\n", hr );
+ else
+ {
+ todo_wine
+ ok( hr == DIERR_INVALIDPARAM, "GetDeviceData returned %#x\n", hr );
+ }
res = 1;
- hr = IDirectInputDevice8_GetDeviceData( device, sizeof(DIDEVICEOBJECTDATA), objdata, &res, DIGDD_PEEK );
+ hr = IDirectInputDevice8_GetDeviceData( device, size, objdata, &res, DIGDD_PEEK );
ok( hr == DIERR_NOTBUFFERED, "GetDeviceData returned %#x\n", hr );
hr = IDirectInputDevice8_Unacquire( device );
@@ -4538,7 +4713,7 @@ static void test_simple_joystick(void)
ok( hr == DI_OK, "Unacquire returned: %#x\n", hr );
res = 1;
- hr = IDirectInputDevice8_GetDeviceData( device, sizeof(DIDEVICEOBJECTDATA), objdata, &res, DIGDD_PEEK );
+ hr = IDirectInputDevice8_GetDeviceData( device, size, objdata, &res, DIGDD_PEEK );
ok( hr == DI_OK, "GetDeviceData returned %#x\n", hr );
ok( res == 0, "got %u expected %u\n", res, 0 );
@@ -4548,12 +4723,13 @@ static void test_simple_joystick(void)
ResetEvent( event );
res = 1;
- hr = IDirectInputDevice8_GetDeviceData( device, sizeof(DIDEVICEOBJECTDATA), objdata, &res, DIGDD_PEEK );
+ hr = IDirectInputDevice8_GetDeviceData( device, size, objdata, &res, DIGDD_PEEK );
+ todo_wine_if( version < 0x0800 )
ok( hr == DI_BUFFEROVERFLOW, "GetDeviceData returned %#x\n", hr );
ok( res == 0, "got %u expected %u\n", res, 0 );
res = 1;
- hr = IDirectInputDevice8_GetDeviceData( device, sizeof(DIDEVICEOBJECTDATA), objdata, &res, 0 );
- todo_wine
+ hr = IDirectInputDevice8_GetDeviceData( device, size, objdata, &res, 0 );
+ todo_wine_if( version >= 0x0800 )
ok( hr == DI_OK, "GetDeviceData returned %#x\n", hr );
ok( res == 0, "got %u expected %u\n", res, 0 );
@@ -4573,22 +4749,23 @@ static void test_simple_joystick(void)
ResetEvent( event );
res = 1;
- hr = IDirectInputDevice8_GetDeviceData( device, sizeof(DIDEVICEOBJECTDATA), objdata, &res, DIGDD_PEEK );
+ hr = IDirectInputDevice8_GetDeviceData( device, size, objdata, &res, DIGDD_PEEK );
ok( hr == DI_OK, "GetDeviceData returned %#x\n", hr );
ok( res == 1, "got %u expected %u\n", res, 1 );
check_member( objdata[0], expect_objdata[0], "%#x", dwOfs );
check_member( objdata[0], expect_objdata[0], "%#x", dwData );
- ok( objdata[0].uAppData == -1, "got %p, expected %p\n", (void *)objdata[0].uAppData, (void *)-1 );
+ if (version >= 0x0800) ok( objdata[0].uAppData == -1, "got %p\n", (void *)objdata[0].uAppData );
res = 4;
- hr = IDirectInputDevice8_GetDeviceData( device, sizeof(DIDEVICEOBJECTDATA), objdata, &res, 0 );
+ hr = IDirectInputDevice8_GetDeviceData( device, size, objdata, &res, 0 );
ok( hr == DI_OK, "GetDeviceData returned %#x\n", hr );
ok( res == 4, "got %u expected %u\n", res, 4 );
for (i = 0; i < 4; ++i)
{
+ DIDEVICEOBJECTDATA *ptr = (DIDEVICEOBJECTDATA *)((char *)objdata + size * i);
winetest_push_context( "objdata[%d]", i );
- check_member( objdata[i], expect_objdata[1 + i], "%#x", dwOfs );
- check_member( objdata[i], expect_objdata[1 + i], "%#x", dwData );
- ok( objdata[i].uAppData == -1, "got %p, expected %p\n", (void *)objdata[i].uAppData, (void *)-1 );
+ check_member( *ptr, expect_objdata[1 + i], "%#x", dwOfs );
+ check_member( *ptr, expect_objdata[1 + i], "%#x", dwData );
+ if (version >= 0x0800) ok( ptr->uAppData == -1, "got %p\n", (void *)ptr->uAppData );
winetest_pop_context();
}
@@ -4602,26 +4779,28 @@ static void test_simple_joystick(void)
ResetEvent( event );
res = 1;
- hr = IDirectInputDevice8_GetDeviceData( device, sizeof(DIDEVICEOBJECTDATA), objdata, &res, 0 );
+ hr = IDirectInputDevice8_GetDeviceData( device, size, objdata, &res, 0 );
+ todo_wine_if( version < 0x0800 )
ok( hr == DI_BUFFEROVERFLOW, "GetDeviceData returned %#x\n", hr );
ok( res == 1, "got %u expected %u\n", res, 1 );
todo_wine
check_member( objdata[0], expect_objdata[5], "%#x", dwOfs );
todo_wine
check_member( objdata[0], expect_objdata[5], "%#x", dwData );
- ok( objdata[0].uAppData == -1, "got %p, expected %p\n", (void *)objdata[0].uAppData, (void *)-1 );
+ if (version >= 0x0800) ok( objdata[0].uAppData == -1, "got %p\n", (void *)objdata[0].uAppData );
res = ARRAY_SIZE(objdata);
- hr = IDirectInputDevice8_GetDeviceData( device, sizeof(DIDEVICEOBJECTDATA), objdata, &res, 0 );
+ hr = IDirectInputDevice8_GetDeviceData( device, size, objdata, &res, 0 );
ok( hr == DI_OK, "GetDeviceData returned %#x\n", hr );
ok( res == 8, "got %u expected %u\n", res, 8 );
for (i = 0; i < 8; ++i)
{
+ DIDEVICEOBJECTDATA *ptr = (DIDEVICEOBJECTDATA *)((char *)objdata + size * i);
winetest_push_context( "objdata[%d]", i );
todo_wine
- check_member( objdata[i], expect_objdata[6 + i], "%#x", dwOfs );
+ check_member( *ptr, expect_objdata[6 + i], "%#x", dwOfs );
todo_wine_if( i == 1 || i == 2 || i == 6 )
- check_member( objdata[i], expect_objdata[6 + i], "%#x", dwData );
- ok( objdata[i].uAppData == -1, "got %p, expected %p\n", (void *)objdata[i].uAppData, (void *)-1 );
+ check_member( *ptr, expect_objdata[6 + i], "%#x", dwData );
+ if (version >= 0x0800) ok( ptr->uAppData == -1, "got %p\n", (void *)ptr->uAppData );
winetest_pop_context();
}
@@ -4719,7 +4898,9 @@ static void test_simple_joystick(void)
ok( hr == DIERR_INVALIDPARAM, "SetDataFormat returned: %#x\n", hr );
objdataformat[1].dwType = DIDFT_AXIS|DIDFT_MAKEINSTANCE( 0xff );
hr = IDirectInputDevice8_SetDataFormat( device, &dataformat );
- ok( hr == DIERR_INVALIDPARAM, "SetDataFormat returned: %#x\n", hr );
+ todo_wine_if( version < 0x0700 )
+ ok( hr == (version < 0x0700 ? DI_OK : DIERR_INVALIDPARAM),
+ "SetDataFormat returned: %#x\n", hr );
objdataformat[1].dwType = DIDFT_AXIS|DIDFT_MAKEINSTANCE( 1 );
hr = IDirectInputDevice8_SetDataFormat( device, &dataformat );
ok( hr == DI_OK, "SetDataFormat returned: %#x\n", hr );
@@ -4821,9 +5002,13 @@ static void test_simple_joystick(void)
hr = IDirectInputDevice8_SetProperty( device, DIPROP_RANGE, &prop_range.diph );
ok( hr == DI_OK, "SetProperty DIPROP_RANGE returned %#x\n", hr );
hr = IDirectInputDevice8_SetProperty( device, DIPROP_LOGICALRANGE, &prop_range.diph );
- ok( hr == DIERR_ACQUIRED, "SetProperty DIPROP_LOGICALRANGE returned %#x\n", hr );
+ todo_wine_if( version < 0x0800 )
+ ok( hr == (version < 0x0800 ? DIERR_UNSUPPORTED : DIERR_ACQUIRED),
+ "SetProperty DIPROP_LOGICALRANGE returned %#x\n", hr );
hr = IDirectInputDevice8_SetProperty( device, DIPROP_PHYSICALRANGE, &prop_range.diph );
- ok( hr == DIERR_ACQUIRED, "SetProperty DIPROP_PHYSICALRANGE returned %#x\n", hr );
+ todo_wine_if( version < 0x0800 )
+ ok( hr == (version < 0x0800 ? DIERR_UNSUPPORTED : DIERR_ACQUIRED),
+ "SetProperty DIPROP_PHYSICALRANGE returned %#x\n", hr );
hr = IDirectInputDevice8_Unacquire( device );
ok( hr == DI_OK, "Unacquire returned: %#x\n", hr );
@@ -4876,13 +5061,17 @@ static void test_simple_joystick(void)
hr = IDirectInputDevice8_SetProperty( device, DIPROP_VIDPID, NULL );
ok( hr == DIERR_INVALIDPARAM, "SetProperty returned %#x\n", hr );
hr = IDirectInputDevice8_SetProperty( device, DIPROP_VIDPID, &prop_string.diph );
- ok( hr == DIERR_INVALIDPARAM, "SetProperty returned %#x\n", hr );
+ todo_wine_if( version < 0x0800 )
+ ok( hr == (version < 0x0800 ? DIERR_UNSUPPORTED : DIERR_INVALIDPARAM),
+ "SetProperty DIPROP_VIDPID returned %#x\n", hr );
prop_dword.diph.dwHow = DIPH_DEVICE;
prop_dword.diph.dwObj = 0;
prop_dword.dwData = 0xdeadbeef;
hr = IDirectInputDevice8_SetProperty( device, DIPROP_VIDPID, &prop_dword.diph );
- ok( hr == DIERR_READONLY, "SetProperty DIPROP_VIDPID returned %#x\n", hr );
+ todo_wine_if( version < 0x0800 )
+ ok( hr == (version < 0x0800 ? DIERR_UNSUPPORTED : DIERR_READONLY),
+ "SetProperty DIPROP_VIDPID returned %#x\n", hr );
hr = IDirectInputDevice8_SetProperty( device, DIPROP_GUIDANDPATH, &prop_guid_path.diph );
ok( hr == DIERR_READONLY, "SetProperty DIPROP_GUIDANDPATH returned %#x\n", hr );
@@ -4903,9 +5092,13 @@ static void test_simple_joystick(void)
debugstr_w(prop_string.wsz) );
hr = IDirectInputDevice8_SetProperty( device, DIPROP_TYPENAME, &prop_string.diph );
- ok( hr == DIERR_READONLY, "SetProperty DIPROP_TYPENAME returned %#x\n", hr );
+ todo_wine_if( version < 0x0800 )
+ ok( hr == (version < 0x0800 ? DIERR_UNSUPPORTED : DIERR_READONLY),
+ "SetProperty DIPROP_TYPENAME returned %#x\n", hr );
hr = IDirectInputDevice8_SetProperty( device, DIPROP_USERNAME, &prop_string.diph );
- ok( hr == DIERR_READONLY, "SetProperty DIPROP_USERNAME returned %#x\n", hr );
+ todo_wine_if( version < 0x0800 )
+ ok( hr == (version < 0x0800 ? DIERR_UNSUPPORTED : DIERR_READONLY),
+ "SetProperty DIPROP_USERNAME returned %#x\n", hr );
hr = IDirectInputDevice8_SetProperty( device, DIPROP_FFLOAD, &prop_dword.diph );
ok( hr == DIERR_READONLY, "SetProperty DIPROP_FFLOAD returned %#x\n", hr );
hr = IDirectInputDevice8_SetProperty( device, DIPROP_GRANULARITY, &prop_dword.diph );
@@ -4924,7 +5117,8 @@ static void test_simple_joystick(void)
prop_pointer.diph.dwObj = MAKELONG( HID_USAGE_GENERIC_X, HID_USAGE_PAGE_GENERIC );
hr = IDirectInputDevice8_SetProperty( device, DIPROP_APPDATA, &prop_pointer.diph );
todo_wine
- ok( hr == DIERR_ACQUIRED, "SetProperty DIPROP_APPDATA returned %#x\n", hr );
+ ok( hr == (version < 0x0800 ? DIERR_UNSUPPORTED : DIERR_ACQUIRED),
+ "SetProperty DIPROP_APPDATA returned %#x\n", hr );
prop_dword.diph.dwHow = DIPH_DEVICE;
prop_dword.diph.dwObj = 0;
@@ -5039,8 +5233,8 @@ static void test_simple_joystick(void)
hr = IDirectInputDevice8_GetDeviceState( device, sizeof(DIJOYSTATE2), &state );
ok( hr == DI_OK, "GetDeviceState returned: %#x\n", hr );
winetest_push_context( "state[%d]", i );
- todo_wine
- ok( state.lX == 15, "got lX %d, expected %d\n" , state.lX, 15 );
+ todo_wine_if( version >= 0x0700 )
+ ok( state.lX == (version < 0x0700 ? -9000 : 15), "got lX %d\n", state.lX );
check_member( state, expect_state_abs[0], "%d", lY );
check_member( state, expect_state_abs[0], "%d", lZ );
check_member( state, expect_state_abs[0], "%d", lRx );
@@ -5076,7 +5270,9 @@ static void test_simple_joystick(void)
prop_pointer.diph.dwObj = MAKELONG( HID_USAGE_GENERIC_X, HID_USAGE_PAGE_GENERIC );
prop_pointer.uData = 0xfeedcafe;
hr = IDirectInputDevice8_SetProperty( device, DIPROP_APPDATA, &prop_pointer.diph );
- ok( hr == DI_OK, "SetProperty DIPROP_APPDATA returned %#x\n", hr );
+ todo_wine_if( version < 0x0800 )
+ ok( hr == (version < 0x0800 ? DIERR_UNSUPPORTED : DI_OK),
+ "SetProperty DIPROP_APPDATA returned %#x\n", hr );
prop_dword.dwData = 0xdeadbeef;
hr = IDirectInputDevice8_SetProperty( device, DIPROP_AXISMODE, &prop_dword.diph );
@@ -5103,9 +5299,13 @@ static void test_simple_joystick(void)
prop_pointer.diph.dwHow = DIPH_BYUSAGE;
prop_pointer.diph.dwObj = MAKELONG( HID_USAGE_GENERIC_X, HID_USAGE_PAGE_GENERIC );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_APPDATA, &prop_pointer.diph );
- todo_wine
- ok( hr == DI_OK, "GetProperty DIPROP_APPDATA returned %#x\n", hr );
- ok( prop_pointer.uData == 0xfeedcafe, "got %p expected %p\n", (void *)prop_pointer.uData, (void *)0xfeedcafe );
+ if (version < 0x0800) ok( hr == DIERR_UNSUPPORTED, "GetProperty returned %#x\n", hr );
+ else
+ {
+ todo_wine
+ ok( hr == DI_OK, "GetProperty DIPROP_APPDATA returned %#x\n", hr );
+ ok( prop_pointer.uData == 0xfeedcafe, "got %p expected %p\n", (void *)prop_pointer.uData, (void *)0xfeedcafe );
+ }
prop_dword.diph.dwHow = DIPH_DEVICE;
prop_dword.diph.dwObj = 0;
@@ -5185,15 +5385,15 @@ static void test_simple_joystick(void)
objdata[0].dwOfs = 0xd;
objdata[0].dwData = 0x80;
res = 1;
- hr = IDirectInputDevice8_SendDeviceData( device, sizeof(DIDEVICEOBJECTDATA), objdata, &res, 0xdeadbeef );
+ hr = IDirectInputDevice8_SendDeviceData( device, size, objdata, &res, 0xdeadbeef );
todo_wine
ok( hr == DIERR_INVALIDPARAM, "SendDeviceData returned %#x\n", hr );
res = 1;
- hr = IDirectInputDevice8_SendDeviceData( device, sizeof(DIDEVICEOBJECTDATA), objdata, &res, 1 /*DISDD_CONTINUE*/ );
+ hr = IDirectInputDevice8_SendDeviceData( device, size, objdata, &res, 1 /*DISDD_CONTINUE*/ );
todo_wine
ok( hr == DIERR_INVALIDPARAM, "SendDeviceData returned %#x\n", hr );
res = 1;
- hr = IDirectInputDevice8_SendDeviceData( device, sizeof(DIDEVICEOBJECTDATA), objdata, &res, 0 );
+ hr = IDirectInputDevice8_SendDeviceData( device, size, objdata, &res, 0 );
todo_wine
ok( hr == DIERR_INVALIDPARAM, "SendDeviceData returned %#x\n", hr );
@@ -5249,6 +5449,7 @@ done:
pnp_driver_stop();
cleanup_registry_keys();
SetCurrentDirectoryW( cwd );
+ winetest_pop_context();
}
struct device_desc
@@ -8035,6 +8236,8 @@ static void test_force_feedback_joystick( DWORD version )
{.guid = TRUE, .type = TRUE, .usage = TRUE, .name = TRUE},
{0},
{.guid = TRUE, .type = TRUE, .usage = TRUE, .name = TRUE},
+ {.ofs = TRUE},
+ {.ofs = TRUE},
};
struct check_objects_params check_objects_params =
{
@@ -10014,7 +10217,10 @@ START_TEST( hid )
test_device_types( 0x500 );
test_device_types( 0x700 );
- test_simple_joystick();
+ test_simple_joystick( 0x500 );
+ test_simple_joystick( 0x700 );
+ test_simple_joystick( 0x800 );
+
test_force_feedback_joystick( 0x500 );
test_force_feedback_joystick( 0x700 );
test_force_feedback_joystick( 0x800 );
--
2.34.1
2
7
[PATCH v2 1/6] dinput: Simplify the internal thread and don't require loader lock.
by Rémi Bernon 03 Jan '22
by Rémi Bernon 03 Jan '22
03 Jan '22
When thread shuts down, instead of holding and releasing a module ref.
This keeps the thread alive until the module is unloaded, instead of
keeping track of live IDirectInput instances.
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
---
v2: winmm patches are identical to previous version, I just refactored
the dinput internal thread startup and shutdown instead. It's still
lazily started but simply keeps running until the module is unloaded
instead of holding a module reference.
dlls/dinput/dinput_main.c | 121 ++++++++++++-----------------------
dlls/dinput/dinput_private.h | 3 -
2 files changed, 42 insertions(+), 82 deletions(-)
diff --git a/dlls/dinput/dinput_main.c b/dlls/dinput/dinput_main.c
index 55d566afa4a..cab8886f9db 100644
--- a/dlls/dinput/dinput_main.c
+++ b/dlls/dinput/dinput_main.c
@@ -78,9 +78,18 @@ HINSTANCE DINPUT_instance;
static HWND di_em_win;
-static BOOL check_hook_thread(void);
+static HANDLE dinput_thread;
+static DWORD dinput_thread_id;
+
static CRITICAL_SECTION dinput_hook_crit;
-static struct list direct_input_list = LIST_INIT( direct_input_list );
+static CRITICAL_SECTION_DEBUG dinput_critsect_debug =
+{
+ 0, 0, &dinput_hook_crit,
+ { &dinput_critsect_debug.ProcessLocksList, &dinput_critsect_debug.ProcessLocksList },
+ 0, 0, { (DWORD_PTR)(__FILE__ ": dinput_hook_crit") }
+};
+static CRITICAL_SECTION dinput_hook_crit = { &dinput_critsect_debug, -1, 0, 0, 0, 0 };
+
static struct list acquired_mouse_list = LIST_INIT( acquired_mouse_list );
static struct list acquired_rawmouse_list = LIST_INIT( acquired_rawmouse_list );
static struct list acquired_keyboard_list = LIST_INIT( acquired_keyboard_list );
@@ -453,18 +462,7 @@ static HRESULT initialize_directinput_instance(IDirectInputImpl *This, DWORD dwV
list_init( &This->device_players );
- /* Add self to the list of the IDirectInputs */
- EnterCriticalSection( &dinput_hook_crit );
- list_add_head( &direct_input_list, &This->entry );
- LeaveCriticalSection( &dinput_hook_crit );
-
This->initialized = TRUE;
-
- if (!check_hook_thread())
- {
- uninitialize_directinput_instance( This );
- return DIERR_GENERIC;
- }
}
return DI_OK;
@@ -475,17 +473,11 @@ static void uninitialize_directinput_instance(IDirectInputImpl *This)
if (This->initialized)
{
struct DevicePlayer *device_player, *device_player2;
- /* Remove self from the list of the IDirectInputs */
- EnterCriticalSection( &dinput_hook_crit );
- list_remove( &This->entry );
- LeaveCriticalSection( &dinput_hook_crit );
LIST_FOR_EACH_ENTRY_SAFE( device_player, device_player2,
&This->device_players, struct DevicePlayer, entry )
free( device_player );
- check_hook_thread();
-
This->initialized = FALSE;
}
}
@@ -1262,13 +1254,13 @@ static LRESULT CALLBACK callwndproc_proc( int code, WPARAM wparam, LPARAM lparam
return CallNextHookEx( 0, code, wparam, lparam );
}
-static DWORD WINAPI hook_thread_proc(void *param)
+static DWORD WINAPI dinput_thread_proc( void *params )
{
+ HANDLE events[128], start_event = params;
static HHOOK kbd_hook, mouse_hook;
struct dinput_device *impl, *next;
SIZE_T events_count = 0;
HANDLE finished_event;
- HANDLE events[128];
HRESULT hr;
DWORD ret;
MSG msg;
@@ -1277,7 +1269,7 @@ static DWORD WINAPI hook_thread_proc(void *param)
/* Force creation of the message queue */
PeekMessageW( &msg, 0, 0, 0, PM_NOREMOVE );
- SetEvent(param);
+ SetEvent( start_event );
while ((ret = MsgWaitForMultipleObjectsEx( events_count, events, INFINITE, QS_ALLINPUT, 0 )) <= events_count)
{
@@ -1354,61 +1346,36 @@ static DWORD WINAPI hook_thread_proc(void *param)
done:
DestroyWindow( di_em_win );
di_em_win = NULL;
-
- FreeLibraryAndExitThread(DINPUT_instance, 0);
+ return 0;
}
-static DWORD hook_thread_id;
-static HANDLE hook_thread_event;
-
-static CRITICAL_SECTION_DEBUG dinput_critsect_debug =
+static BOOL WINAPI dinput_thread_start_once( INIT_ONCE *once, void *param, void **context )
{
- 0, 0, &dinput_hook_crit,
- { &dinput_critsect_debug.ProcessLocksList, &dinput_critsect_debug.ProcessLocksList },
- 0, 0, { (DWORD_PTR)(__FILE__ ": dinput_hook_crit") }
-};
-static CRITICAL_SECTION dinput_hook_crit = { &dinput_critsect_debug, -1, 0, 0, 0, 0 };
+ HANDLE start_event;
-static BOOL check_hook_thread(void)
+ start_event = CreateEventW( NULL, FALSE, FALSE, NULL );
+ if (!start_event) ERR( "failed to create start event, error %u\n", GetLastError() );
+
+ dinput_thread = CreateThread( NULL, 0, dinput_thread_proc, start_event, 0, &dinput_thread_id );
+ if (!dinput_thread) ERR( "failed to create internal thread, error %u\n", GetLastError() );
+
+ WaitForSingleObject( start_event, INFINITE );
+ CloseHandle( start_event );
+
+ return TRUE;
+}
+
+static void dinput_thread_start(void)
{
- static HANDLE hook_thread;
- HMODULE module;
- HANDLE wait_handle = NULL;
+ static INIT_ONCE init_once = INIT_ONCE_STATIC_INIT;
+ InitOnceExecuteOnce( &init_once, dinput_thread_start_once, NULL, NULL );
+}
- EnterCriticalSection(&dinput_hook_crit);
-
- TRACE("IDirectInputs left: %d\n", list_count(&direct_input_list));
- if (!list_empty(&direct_input_list) && !hook_thread)
- {
- GetModuleHandleExW(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, (const WCHAR*)DINPUT_instance, &module);
- hook_thread_event = CreateEventW(NULL, FALSE, FALSE, NULL);
- hook_thread = CreateThread(NULL, 0, hook_thread_proc, hook_thread_event, 0, &hook_thread_id);
- }
- else if (list_empty(&direct_input_list) && hook_thread)
- {
- DWORD tid = hook_thread_id;
-
- if (hook_thread_event) /* if thread is not started yet */
- {
- WaitForSingleObject(hook_thread_event, INFINITE);
- CloseHandle(hook_thread_event);
- hook_thread_event = NULL;
- }
-
- hook_thread_id = 0;
- PostThreadMessageW(tid, WM_USER+0x10, 0, 0);
- wait_handle = hook_thread;
- hook_thread = NULL;
- }
-
- LeaveCriticalSection(&dinput_hook_crit);
-
- if (wait_handle)
- {
- WaitForSingleObject(wait_handle, INFINITE);
- CloseHandle(wait_handle);
- }
- return hook_thread_id != 0;
+static void dinput_thread_stop(void)
+{
+ PostThreadMessageW( dinput_thread_id, WM_USER + 0x10, 0, 0 );
+ WaitForSingleObject( dinput_thread, INFINITE );
+ CloseHandle( dinput_thread );
}
void check_dinput_hooks( IDirectInputDevice8W *iface, BOOL acquired )
@@ -1418,6 +1385,8 @@ void check_dinput_hooks( IDirectInputDevice8W *iface, BOOL acquired )
struct dinput_device *impl = impl_from_IDirectInputDevice8W( iface );
HANDLE hook_change_finished_event = NULL;
+ dinput_thread_start();
+
EnterCriticalSection(&dinput_hook_crit);
if (impl->dwCoopLevel & DISCL_FOREGROUND)
@@ -1437,13 +1406,6 @@ void check_dinput_hooks( IDirectInputDevice8W *iface, BOOL acquired )
callwndproc_hook = NULL;
}
- if (hook_thread_event) /* if thread is not started yet */
- {
- WaitForSingleObject(hook_thread_event, INFINITE);
- CloseHandle(hook_thread_event);
- hook_thread_event = NULL;
- }
-
if (impl->use_raw_input)
{
if (acquired)
@@ -1470,7 +1432,7 @@ void check_dinput_hooks( IDirectInputDevice8W *iface, BOOL acquired )
}
hook_change_finished_event = CreateEventW( NULL, FALSE, FALSE, NULL );
- PostThreadMessageW( hook_thread_id, WM_USER+0x10, 1, (LPARAM)hook_change_finished_event );
+ PostThreadMessageW( dinput_thread_id, WM_USER + 0x10, 1, (LPARAM)hook_change_finished_event );
LeaveCriticalSection(&dinput_hook_crit);
@@ -1505,6 +1467,7 @@ BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved)
break;
case DLL_PROCESS_DETACH:
if (reserved) break;
+ dinput_thread_stop();
unregister_di_em_win_class();
DeleteCriticalSection(&dinput_hook_crit);
break;
diff --git a/dlls/dinput/dinput_private.h b/dlls/dinput/dinput_private.h
index c25fe6320ca..4b36a69c0e1 100644
--- a/dlls/dinput/dinput_private.h
+++ b/dlls/dinput/dinput_private.h
@@ -40,10 +40,7 @@ struct IDirectInputImpl
IDirectInputJoyConfig8 IDirectInputJoyConfig8_iface;
LONG ref;
-
BOOL initialized;
- struct list entry; /* entry into list of all IDirectInputs */
-
DWORD evsequence; /* unique sequence number for events */
DWORD dwVersion; /* direct input version number */
struct list device_players; /* device instance guid to player name */
--
2.34.0
2
7
Signed-off-by: Alex Henrie <alexhenrie24(a)gmail.com>
---
I noticed that this was missing while investigating a testbot failure.
---
include/ddk/wdm.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/ddk/wdm.h b/include/ddk/wdm.h
index b798d339561..d00acf5b782 100644
--- a/include/ddk/wdm.h
+++ b/include/ddk/wdm.h
@@ -961,6 +961,7 @@ typedef NTSTATUS (WINAPI *PIO_COMPLETION_ROUTINE)(
IN PVOID Context);
#define SL_PENDING_RETURNED 0x01
+#define SL_ERROR_RETURNED 0x02
#define SL_INVOKE_ON_CANCEL 0x20
#define SL_INVOKE_ON_SUCCESS 0x40
#define SL_INVOKE_ON_ERROR 0x80
--
2.34.1
1
0
This check isn't needed anymore either.
Signed-off-by: Alex Henrie <alexhenrie24(a)gmail.com>
---
dlls/faultrep/tests/faultrep.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/dlls/faultrep/tests/faultrep.c b/dlls/faultrep/tests/faultrep.c
index c71db80cdbb..41f03ee8870 100644
--- a/dlls/faultrep/tests/faultrep.c
+++ b/dlls/faultrep/tests/faultrep.c
@@ -72,11 +72,6 @@ static void test_AddERExcludedApplicationA(void)
/* clean state */
lres = RegCreateKeyA(HKEY_LOCAL_MACHINE, regpath_root, &hroot);
- if (lres == ERROR_ACCESS_DENIED)
- {
- skip("Not enough access rights\n");
- return;
- }
if (!lres)
lres = RegOpenKeyA(hroot, regpath_exclude, &hexclude);
--
2.34.1
1
0
Binary packages for various distributions will be available from:
https://www.winehq.org/download
Summary since last release
* Rebased to current wine 7.0-rc4 (552 patches are applied to wine vanilla)
Upstreamed (Either directly from staging or fixed with a similar patch).
* None
Added:
* None
Updated:
* None
Where can you help
* Run Steam/Battle.net/GOG/UPlay/Epic
* Test your favorite game.
* Test your favorite applications.
* Improve staging patches and get them accepted upstream.
As always, if you find a bug, please report it via
https://bugs.winehq.org
Best Regards
Alistair.
1
0