From 191b81dbd38065c01d19007fd150ce4d1beeb112 Mon Sep 17 00:00:00 2001 From: Hugh McMaster Date: Thu, 15 Jun 2017 12:01:47 +0000 Subject: [PATCH] regedit: Add data parsing operations to the state machine. Signed-off-by: Hugh McMaster Signed-off-by: Alexandre Julliard --- po/ar.po | 2 +- po/bg.po | 2 +- po/ca.po | 4 +- po/cs.po | 2 +- po/da.po | 2 +- po/de.po | 4 +- po/el.po | 2 +- po/en.po | 4 +- po/en_US.po | 4 +- po/eo.po | 2 +- po/es.po | 2 +- po/fa.po | 2 +- po/fi.po | 4 +- po/fr.po | 4 +- po/he.po | 2 +- po/hi.po | 2 +- po/hr.po | 2 +- po/hu.po | 2 +- po/it.po | 2 +- po/ja.po | 4 +- po/ko.po | 2 +- po/lt.po | 4 +- po/ml.po | 2 +- po/nb_NO.po | 4 +- po/nl.po | 2 +- po/or.po | 2 +- po/pa.po | 2 +- po/pl.po | 4 +- po/pt_BR.po | 4 +- po/pt_PT.po | 2 +- po/rm.po | 2 +- po/ro.po | 2 +- po/ru.po | 4 +- po/sk.po | 2 +- po/sl.po | 2 +- po/sr_RS@cyrillic.po | 2 +- po/sr_RS@latin.po | 2 +- po/sv.po | 2 +- po/te.po | 2 +- po/th.po | 2 +- po/tr.po | 4 +- po/uk.po | 4 +- po/wa.po | 2 +- po/wine.pot | 2 +- po/zh_CN.po | 4 +- po/zh_TW.po | 2 +- programs/regedit/regedit.rc | 2 +- programs/regedit/regproc.c | 331 +++++++++++++++++-------------- programs/regedit/tests/regedit.c | 16 +- 49 files changed, 268 insertions(+), 203 deletions(-) diff --git a/po/ar.po b/po/ar.po index df4c7be036..e23db5af34 100644 --- a/po/ar.po +++ b/po/ar.po @@ -12313,7 +12313,7 @@ msgstr "" #: regedit.rc:420 #, fuzzy #| msgid "Unsupported type.\n" -msgid "regedit: Unsupported registry data type [%1]\n" +msgid "regedit: Unsupported registry data type [0x%1!x!]\n" msgstr "النوع غير مدعوم.\n" #: regedit.rc:421 diff --git a/po/bg.po b/po/bg.po index c820a39eaa..294c1e9aaf 100644 --- a/po/bg.po +++ b/po/bg.po @@ -11920,7 +11920,7 @@ msgid "regedit: Unrecognized escape sequence [\\%1!c!]\n" msgstr "" #: regedit.rc:420 -msgid "regedit: Unsupported registry data type [%1]\n" +msgid "regedit: Unsupported registry data type [0x%1!x!]\n" msgstr "" #: regedit.rc:421 diff --git a/po/ca.po b/po/ca.po index 80c812f39a..8c2478996d 100644 --- a/po/ca.po +++ b/po/ca.po @@ -12188,7 +12188,9 @@ msgid "regedit: Unrecognized escape sequence [\\%1!c!]\n" msgstr "regedit: Seqüència d'escapada no reconeguda [\\%1!c!]\n" #: regedit.rc:420 -msgid "regedit: Unsupported registry data type [%1]\n" +#, fuzzy +#| msgid "regedit: Unsupported registry data type [%1]\n" +msgid "regedit: Unsupported registry data type [0x%1!x!]\n" msgstr "regedit: Tipus de dades de registre incompatible [%1]\n" #: regedit.rc:421 diff --git a/po/cs.po b/po/cs.po index 063f60d59a..14f77fd5c7 100644 --- a/po/cs.po +++ b/po/cs.po @@ -12002,7 +12002,7 @@ msgstr "" #: regedit.rc:420 #, fuzzy #| msgid "Unsupported type.\n" -msgid "regedit: Unsupported registry data type [%1]\n" +msgid "regedit: Unsupported registry data type [0x%1!x!]\n" msgstr "Nepodporovaný typ.\n" #: regedit.rc:421 diff --git a/po/da.po b/po/da.po index e71a574735..da3ccb566a 100644 --- a/po/da.po +++ b/po/da.po @@ -12270,7 +12270,7 @@ msgstr "" #: regedit.rc:420 #, fuzzy #| msgid "Unsupported type.\n" -msgid "regedit: Unsupported registry data type [%1]\n" +msgid "regedit: Unsupported registry data type [0x%1!x!]\n" msgstr "Ikke-understøttet type.\n" #: regedit.rc:421 diff --git a/po/de.po b/po/de.po index 9fa4c713a8..f9dc0dc316 100644 --- a/po/de.po +++ b/po/de.po @@ -12153,7 +12153,9 @@ msgid "regedit: Unrecognized escape sequence [\\%1!c!]\n" msgstr "regedit: Unbekannte Escape-Sequenz [\\%1!c!]\n" #: regedit.rc:420 -msgid "regedit: Unsupported registry data type [%1]\n" +#, fuzzy +#| msgid "regedit: Unsupported registry data type [%1]\n" +msgid "regedit: Unsupported registry data type [0x%1!x!]\n" msgstr "regedit: Nicht unterstützter Registrierungsdatentyp [%1]\n" #: regedit.rc:421 diff --git a/po/el.po b/po/el.po index bfa249b7d8..a3234b7a80 100644 --- a/po/el.po +++ b/po/el.po @@ -11687,7 +11687,7 @@ msgstr "" #: regedit.rc:420 #, fuzzy -msgid "regedit: Unsupported registry data type [%1]\n" +msgid "regedit: Unsupported registry data type [0x%1!x!]\n" msgstr "Επιλογές.\n" #: regedit.rc:421 diff --git a/po/en.po b/po/en.po index 60b3d7a4aa..b029758f7e 100644 --- a/po/en.po +++ b/po/en.po @@ -12065,8 +12065,8 @@ msgid "regedit: Unrecognized escape sequence [\\%1!c!]\n" msgstr "regedit: Unrecognized escape sequence [\\%1!c!]\n" #: regedit.rc:420 -msgid "regedit: Unsupported registry data type [%1]\n" -msgstr "regedit: Unsupported registry data type [%1]\n" +msgid "regedit: Unsupported registry data type [0x%1!x!]\n" +msgstr "regedit: Unsupported registry data type [0x%1!x!]\n" #: regedit.rc:421 msgid "regedit: Unexpected end of line in '%1'.\n" diff --git a/po/en_US.po b/po/en_US.po index fcfe1b1472..855c1e6f96 100644 --- a/po/en_US.po +++ b/po/en_US.po @@ -12065,8 +12065,8 @@ msgid "regedit: Unrecognized escape sequence [\\%1!c!]\n" msgstr "regedit: Unrecognized escape sequence [\\%1!c!]\n" #: regedit.rc:420 -msgid "regedit: Unsupported registry data type [%1]\n" -msgstr "regedit: Unsupported registry data type [%1]\n" +msgid "regedit: Unsupported registry data type [0x%1!x!]\n" +msgstr "regedit: Unsupported registry data type [0x%1!x!]\n" #: regedit.rc:421 msgid "regedit: Unexpected end of line in '%1'.\n" diff --git a/po/eo.po b/po/eo.po index d6018c06fb..253b18946b 100644 --- a/po/eo.po +++ b/po/eo.po @@ -11609,7 +11609,7 @@ msgid "regedit: Unrecognized escape sequence [\\%1!c!]\n" msgstr "" #: regedit.rc:420 -msgid "regedit: Unsupported registry data type [%1]\n" +msgid "regedit: Unsupported registry data type [0x%1!x!]\n" msgstr "" #: regedit.rc:421 diff --git a/po/es.po b/po/es.po index c6445edc07..11cfa1c152 100644 --- a/po/es.po +++ b/po/es.po @@ -12349,7 +12349,7 @@ msgstr "" #: regedit.rc:420 #, fuzzy #| msgid "Unsupported type.\n" -msgid "regedit: Unsupported registry data type [%1]\n" +msgid "regedit: Unsupported registry data type [0x%1!x!]\n" msgstr "Tipo no soportado.\n" #: regedit.rc:421 diff --git a/po/fa.po b/po/fa.po index b8be08766a..af02810349 100644 --- a/po/fa.po +++ b/po/fa.po @@ -11687,7 +11687,7 @@ msgid "regedit: Unrecognized escape sequence [\\%1!c!]\n" msgstr "" #: regedit.rc:420 -msgid "regedit: Unsupported registry data type [%1]\n" +msgid "regedit: Unsupported registry data type [0x%1!x!]\n" msgstr "" #: regedit.rc:421 diff --git a/po/fi.po b/po/fi.po index 718bdfe997..9d1fe71512 100644 --- a/po/fi.po +++ b/po/fi.po @@ -12041,7 +12041,9 @@ msgid "regedit: Unrecognized escape sequence [\\%1!c!]\n" msgstr "regedit: Tuntematon merkintä [\\%1!c!]\n" #: regedit.rc:420 -msgid "regedit: Unsupported registry data type [%1]\n" +#, fuzzy +#| msgid "regedit: Unsupported registry data type [%1]\n" +msgid "regedit: Unsupported registry data type [0x%1!x!]\n" msgstr "regedit: Rekisterin tietotyypille [%1] ei ole tukea\n" #: regedit.rc:421 diff --git a/po/fr.po b/po/fr.po index 45c303c575..dc5beb650c 100644 --- a/po/fr.po +++ b/po/fr.po @@ -12236,7 +12236,9 @@ msgid "regedit: Unrecognized escape sequence [\\%1!c!]\n" msgstr "regedit : séquence d'échappement non reconnue [\\%1!c!]\n" #: regedit.rc:420 -msgid "regedit: Unsupported registry data type [%1]\n" +#, fuzzy +#| msgid "regedit: Unsupported registry data type [%1]\n" +msgid "regedit: Unsupported registry data type [0x%1!x!]\n" msgstr "regedit : type de données de registre non pris en charge [%1]\n" #: regedit.rc:421 diff --git a/po/he.po b/po/he.po index 5eddd97671..ecea6e49d8 100644 --- a/po/he.po +++ b/po/he.po @@ -12084,7 +12084,7 @@ msgstr "" #: regedit.rc:420 #, fuzzy #| msgid "Error: Command line not supported\n" -msgid "regedit: Unsupported registry data type [%1]\n" +msgid "regedit: Unsupported registry data type [0x%1!x!]\n" msgstr "Error: Command line not supported\n" #: regedit.rc:421 diff --git a/po/hi.po b/po/hi.po index 4a222b49d0..465cbf875f 100644 --- a/po/hi.po +++ b/po/hi.po @@ -11478,7 +11478,7 @@ msgid "regedit: Unrecognized escape sequence [\\%1!c!]\n" msgstr "" #: regedit.rc:420 -msgid "regedit: Unsupported registry data type [%1]\n" +msgid "regedit: Unsupported registry data type [0x%1!x!]\n" msgstr "" #: regedit.rc:421 diff --git a/po/hr.po b/po/hr.po index 16429e91dd..37df6753fd 100644 --- a/po/hr.po +++ b/po/hr.po @@ -11816,7 +11816,7 @@ msgstr "" #: regedit.rc:420 #, fuzzy #| msgid "Unsupported type.\n" -msgid "regedit: Unsupported registry data type [%1]\n" +msgid "regedit: Unsupported registry data type [0x%1!x!]\n" msgstr "Nepodržan tip.\n" #: regedit.rc:421 diff --git a/po/hu.po b/po/hu.po index 8c7feb48fb..f38f3f8543 100644 --- a/po/hu.po +++ b/po/hu.po @@ -12266,7 +12266,7 @@ msgstr "" #: regedit.rc:420 #, fuzzy #| msgid "Unsupported type.\n" -msgid "regedit: Unsupported registry data type [%1]\n" +msgid "regedit: Unsupported registry data type [0x%1!x!]\n" msgstr "Nem támogatott típus.\n" #: regedit.rc:421 diff --git a/po/it.po b/po/it.po index b9ab948e3a..9aea071262 100644 --- a/po/it.po +++ b/po/it.po @@ -12350,7 +12350,7 @@ msgstr "" #: regedit.rc:420 #, fuzzy #| msgid "Unsupported type.\n" -msgid "regedit: Unsupported registry data type [%1]\n" +msgid "regedit: Unsupported registry data type [0x%1!x!]\n" msgstr "Tipo non supportato.\n" #: regedit.rc:421 diff --git a/po/ja.po b/po/ja.po index 65682bd68a..f5c12fff4b 100644 --- a/po/ja.po +++ b/po/ja.po @@ -12073,7 +12073,9 @@ msgid "regedit: Unrecognized escape sequence [\\%1!c!]\n" msgstr "regedit: 認識できないエスケープ シーケンスです [%1!c!]\n" #: regedit.rc:420 -msgid "regedit: Unsupported registry data type [%1]\n" +#, fuzzy +#| msgid "regedit: Unsupported registry data type [%1]\n" +msgid "regedit: Unsupported registry data type [0x%1!x!]\n" msgstr "regedit: サポートされていないレジストリ データ型 [%1]\n" #: regedit.rc:421 diff --git a/po/ko.po b/po/ko.po index c620d47e23..7ffb2a849a 100644 --- a/po/ko.po +++ b/po/ko.po @@ -12335,7 +12335,7 @@ msgstr "" #: regedit.rc:420 #, fuzzy #| msgid "Unsupported type.\n" -msgid "regedit: Unsupported registry data type [%1]\n" +msgid "regedit: Unsupported registry data type [0x%1!x!]\n" msgstr "지원하지 않는 형식.\n" #: regedit.rc:421 diff --git a/po/lt.po b/po/lt.po index 846f6944ef..e8dbdd2eab 100644 --- a/po/lt.po +++ b/po/lt.po @@ -12068,7 +12068,9 @@ msgid "regedit: Unrecognized escape sequence [\\%1!c!]\n" msgstr "regedit: Neatpažinta kaitos seka [\\%1!c!]\n" #: regedit.rc:420 -msgid "regedit: Unsupported registry data type [%1]\n" +#, fuzzy +#| msgid "regedit: Unsupported registry data type [%1]\n" +msgid "regedit: Unsupported registry data type [0x%1!x!]\n" msgstr "regedit: Nepalaikomas registro duomenų tipas [%1]\n" #: regedit.rc:421 diff --git a/po/ml.po b/po/ml.po index 34ec60a332..bdce0f620b 100644 --- a/po/ml.po +++ b/po/ml.po @@ -11478,7 +11478,7 @@ msgid "regedit: Unrecognized escape sequence [\\%1!c!]\n" msgstr "" #: regedit.rc:420 -msgid "regedit: Unsupported registry data type [%1]\n" +msgid "regedit: Unsupported registry data type [0x%1!x!]\n" msgstr "" #: regedit.rc:421 diff --git a/po/nb_NO.po b/po/nb_NO.po index 6da86286aa..b541c81d6f 100644 --- a/po/nb_NO.po +++ b/po/nb_NO.po @@ -12062,7 +12062,9 @@ msgid "regedit: Unrecognized escape sequence [\\%1!c!]\n" msgstr "regedit: Ukjent escape-sekvens [\\%1!c!]\n" #: regedit.rc:420 -msgid "regedit: Unsupported registry data type [%1]\n" +#, fuzzy +#| msgid "regedit: Unsupported registry data type [%1]\n" +msgid "regedit: Unsupported registry data type [0x%1!x!]\n" msgstr "regedit: Registerdatatypen [%1] støttes ikke\n" #: regedit.rc:421 diff --git a/po/nl.po b/po/nl.po index 862feee864..a5e7904ab3 100644 --- a/po/nl.po +++ b/po/nl.po @@ -12315,7 +12315,7 @@ msgstr "" #: regedit.rc:420 #, fuzzy #| msgid "Unsupported type.\n" -msgid "regedit: Unsupported registry data type [%1]\n" +msgid "regedit: Unsupported registry data type [0x%1!x!]\n" msgstr "Niet-ondersteund type.\n" #: regedit.rc:421 diff --git a/po/or.po b/po/or.po index 5d5a596b8e..cbd57f6618 100644 --- a/po/or.po +++ b/po/or.po @@ -11478,7 +11478,7 @@ msgid "regedit: Unrecognized escape sequence [\\%1!c!]\n" msgstr "" #: regedit.rc:420 -msgid "regedit: Unsupported registry data type [%1]\n" +msgid "regedit: Unsupported registry data type [0x%1!x!]\n" msgstr "" #: regedit.rc:421 diff --git a/po/pa.po b/po/pa.po index 34d8f3e281..2137bfd945 100644 --- a/po/pa.po +++ b/po/pa.po @@ -11478,7 +11478,7 @@ msgid "regedit: Unrecognized escape sequence [\\%1!c!]\n" msgstr "" #: regedit.rc:420 -msgid "regedit: Unsupported registry data type [%1]\n" +msgid "regedit: Unsupported registry data type [0x%1!x!]\n" msgstr "" #: regedit.rc:421 diff --git a/po/pl.po b/po/pl.po index 390db6e060..7a71c24c18 100644 --- a/po/pl.po +++ b/po/pl.po @@ -12111,7 +12111,9 @@ msgid "regedit: Unrecognized escape sequence [\\%1!c!]\n" msgstr "regedit: Nierozpoznana sekwencja wyjściowa [\\%1!c!]\n" #: regedit.rc:420 -msgid "regedit: Unsupported registry data type [%1]\n" +#, fuzzy +#| msgid "regedit: Unsupported registry data type [%1]\n" +msgid "regedit: Unsupported registry data type [0x%1!x!]\n" msgstr "regedit: Nieobsługiwany rodzaj wartości rejestru [%1]\n" #: regedit.rc:421 diff --git a/po/pt_BR.po b/po/pt_BR.po index 71b4ee366a..01bb3c8d1f 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -12150,7 +12150,9 @@ msgid "regedit: Unrecognized escape sequence [\\%1!c!]\n" msgstr "regedit: Sequência de escape não reconhecida [\\%1!c!]\n" #: regedit.rc:420 -msgid "regedit: Unsupported registry data type [%1]\n" +#, fuzzy +#| msgid "regedit: Unsupported registry data type [%1]\n" +msgid "regedit: Unsupported registry data type [0x%1!x!]\n" msgstr "regedit: Tipo de dado de registro não suportado [%1]\n" #: regedit.rc:421 diff --git a/po/pt_PT.po b/po/pt_PT.po index 64ee4c342e..8009b81633 100644 --- a/po/pt_PT.po +++ b/po/pt_PT.po @@ -12148,7 +12148,7 @@ msgstr "" #: regedit.rc:420 #, fuzzy #| msgid "Unsupported type.\n" -msgid "regedit: Unsupported registry data type [%1]\n" +msgid "regedit: Unsupported registry data type [0x%1!x!]\n" msgstr "Tipo não suportado.\n" #: regedit.rc:421 diff --git a/po/rm.po b/po/rm.po index 59157fd731..5d38507900 100644 --- a/po/rm.po +++ b/po/rm.po @@ -11572,7 +11572,7 @@ msgid "regedit: Unrecognized escape sequence [\\%1!c!]\n" msgstr "" #: regedit.rc:420 -msgid "regedit: Unsupported registry data type [%1]\n" +msgid "regedit: Unsupported registry data type [0x%1!x!]\n" msgstr "" #: regedit.rc:421 diff --git a/po/ro.po b/po/ro.po index bd480221f0..8950d5d619 100644 --- a/po/ro.po +++ b/po/ro.po @@ -12074,7 +12074,7 @@ msgstr "" #: regedit.rc:420 #, fuzzy #| msgid "Error: Command line not supported\n" -msgid "regedit: Unsupported registry data type [%1]\n" +msgid "regedit: Unsupported registry data type [0x%1!x!]\n" msgstr "Eroare: Linie de comandă nesuportată\n" #: regedit.rc:421 diff --git a/po/ru.po b/po/ru.po index 170d1b7329..101e9867ee 100644 --- a/po/ru.po +++ b/po/ru.po @@ -12064,7 +12064,9 @@ msgid "regedit: Unrecognized escape sequence [\\%1!c!]\n" msgstr "regedit: неизвестная управляющая последовательность [\\%1!c!]\n" #: regedit.rc:420 -msgid "regedit: Unsupported registry data type [%1]\n" +#, fuzzy +#| msgid "regedit: Unsupported registry data type [%1]\n" +msgid "regedit: Unsupported registry data type [0x%1!x!]\n" msgstr "regedit: тип данных [%1] не поддерживается\n" #: regedit.rc:421 diff --git a/po/sk.po b/po/sk.po index e0752dff36..a870ffaf99 100644 --- a/po/sk.po +++ b/po/sk.po @@ -11778,7 +11778,7 @@ msgstr "" #: regedit.rc:420 #, fuzzy #| msgid "Unsupported type.\n" -msgid "regedit: Unsupported registry data type [%1]\n" +msgid "regedit: Unsupported registry data type [0x%1!x!]\n" msgstr "Nepodporovaný typ.\n" #: regedit.rc:421 diff --git a/po/sl.po b/po/sl.po index e7c0c18633..6980d92f50 100644 --- a/po/sl.po +++ b/po/sl.po @@ -12289,7 +12289,7 @@ msgstr "" #: regedit.rc:420 #, fuzzy #| msgid "Unsupported type.\n" -msgid "regedit: Unsupported registry data type [%1]\n" +msgid "regedit: Unsupported registry data type [0x%1!x!]\n" msgstr "Nepodprta vrsta.\n" #: regedit.rc:421 diff --git a/po/sr_RS@cyrillic.po b/po/sr_RS@cyrillic.po index 3644cee384..25062e7307 100644 --- a/po/sr_RS@cyrillic.po +++ b/po/sr_RS@cyrillic.po @@ -12183,7 +12183,7 @@ msgstr "" #: regedit.rc:420 #, fuzzy #| msgid "Error: Invalid command line parameters\n" -msgid "regedit: Unsupported registry data type [%1]\n" +msgid "regedit: Unsupported registry data type [0x%1!x!]\n" msgstr "" "Грешка: унесени су непознати или неисправни параметри наредбене линије\n" diff --git a/po/sr_RS@latin.po b/po/sr_RS@latin.po index 81ba2b61ff..53815a739e 100644 --- a/po/sr_RS@latin.po +++ b/po/sr_RS@latin.po @@ -12334,7 +12334,7 @@ msgstr "" #: regedit.rc:420 #, fuzzy #| msgid "Error: Invalid command line parameters\n" -msgid "regedit: Unsupported registry data type [%1]\n" +msgid "regedit: Unsupported registry data type [0x%1!x!]\n" msgstr "" "Greška: uneseni su nepoznati ili neispravni parametri naredbene linije\n" diff --git a/po/sv.po b/po/sv.po index 07eaf8a483..3e02b0cc44 100644 --- a/po/sv.po +++ b/po/sv.po @@ -11963,7 +11963,7 @@ msgstr "" #: regedit.rc:420 #, fuzzy #| msgid "reg: Unsupported registry data type [%1]\n" -msgid "regedit: Unsupported registry data type [%1]\n" +msgid "regedit: Unsupported registry data type [0x%1!x!]\n" msgstr "reg: Ej stödd typ [%1] i registret\n" #: regedit.rc:421 diff --git a/po/te.po b/po/te.po index 9dc00f1f40..496dff00f1 100644 --- a/po/te.po +++ b/po/te.po @@ -11478,7 +11478,7 @@ msgid "regedit: Unrecognized escape sequence [\\%1!c!]\n" msgstr "" #: regedit.rc:420 -msgid "regedit: Unsupported registry data type [%1]\n" +msgid "regedit: Unsupported registry data type [0x%1!x!]\n" msgstr "" #: regedit.rc:421 diff --git a/po/th.po b/po/th.po index ea7ac640ba..fc8119df39 100644 --- a/po/th.po +++ b/po/th.po @@ -11727,7 +11727,7 @@ msgid "regedit: Unrecognized escape sequence [\\%1!c!]\n" msgstr "" #: regedit.rc:420 -msgid "regedit: Unsupported registry data type [%1]\n" +msgid "regedit: Unsupported registry data type [0x%1!x!]\n" msgstr "" #: regedit.rc:421 diff --git a/po/tr.po b/po/tr.po index a947302c4b..ae531231dc 100644 --- a/po/tr.po +++ b/po/tr.po @@ -12086,7 +12086,9 @@ msgstr "" "\n" #: regedit.rc:420 -msgid "regedit: Unsupported registry data type [%1]\n" +#, fuzzy +#| msgid "regedit: Unsupported registry data type [%1]\n" +msgid "regedit: Unsupported registry data type [0x%1!x!]\n" msgstr "regedit: Desteklenmeyen kayıt defteri veri türü [%1]\n" #: regedit.rc:421 diff --git a/po/uk.po b/po/uk.po index 3b5e0a8d96..9ca286cbec 100644 --- a/po/uk.po +++ b/po/uk.po @@ -12157,7 +12157,9 @@ msgid "regedit: Unrecognized escape sequence [\\%1!c!]\n" msgstr "regedit: Нерозпізнана послідовність [\\%1!c!]\n" #: regedit.rc:420 -msgid "regedit: Unsupported registry data type [%1]\n" +#, fuzzy +#| msgid "regedit: Unsupported registry data type [%1]\n" +msgid "regedit: Unsupported registry data type [0x%1!x!]\n" msgstr "regedit: Непідтримуваний тип даних [%1]\n" #: regedit.rc:421 diff --git a/po/wa.po b/po/wa.po index 06487b9ce5..f09a7bbfcb 100644 --- a/po/wa.po +++ b/po/wa.po @@ -11635,7 +11635,7 @@ msgid "regedit: Unrecognized escape sequence [\\%1!c!]\n" msgstr "" #: regedit.rc:420 -msgid "regedit: Unsupported registry data type [%1]\n" +msgid "regedit: Unsupported registry data type [0x%1!x!]\n" msgstr "" #: regedit.rc:421 diff --git a/po/wine.pot b/po/wine.pot index 0be5765978..0da9330272 100644 --- a/po/wine.pot +++ b/po/wine.pot @@ -11413,7 +11413,7 @@ msgid "regedit: Unrecognized escape sequence [\\%1!c!]\n" msgstr "" #: regedit.rc:420 -msgid "regedit: Unsupported registry data type [%1]\n" +msgid "regedit: Unsupported registry data type [0x%1!x!]\n" msgstr "" #: regedit.rc:421 diff --git a/po/zh_CN.po b/po/zh_CN.po index 9f6bf2120d..56514769b2 100644 --- a/po/zh_CN.po +++ b/po/zh_CN.po @@ -11856,7 +11856,9 @@ msgid "regedit: Unrecognized escape sequence [\\%1!c!]\n" msgstr "regedit: 无法识别的转义序列 [\\%1!c!]\n" #: regedit.rc:420 -msgid "regedit: Unsupported registry data type [%1]\n" +#, fuzzy +#| msgid "regedit: Unsupported registry data type [%1]\n" +msgid "regedit: Unsupported registry data type [0x%1!x!]\n" msgstr "regedit: 不受支持的注册表数据类型 [%1]\n" #: regedit.rc:421 diff --git a/po/zh_TW.po b/po/zh_TW.po index 1fb97a8dc1..f6e844a627 100644 --- a/po/zh_TW.po +++ b/po/zh_TW.po @@ -12220,7 +12220,7 @@ msgstr "" #: regedit.rc:420 #, fuzzy #| msgid "Unsupported type.\n" -msgid "regedit: Unsupported registry data type [%1]\n" +msgid "regedit: Unsupported registry data type [0x%1!x!]\n" msgstr "不受支援的型態。\n" #: regedit.rc:421 diff --git a/programs/regedit/regedit.rc b/programs/regedit/regedit.rc index fb7b973ef2..b12e79eb9a 100644 --- a/programs/regedit/regedit.rc +++ b/programs/regedit/regedit.rc @@ -416,7 +416,7 @@ STRINGTABLE STRING_INVALID_HEX, "regedit: Invalid hexadecimal value.\n" STRING_CSV_HEX_ERROR, "regedit: Unable to convert hexadecimal data. An invalid value was encountered at '%1'.\n" STRING_ESCAPE_SEQUENCE, "regedit: Unrecognized escape sequence [\\%1!c!]\n" - STRING_UNKNOWN_DATA_FORMAT, "regedit: Unsupported registry data type [%1]\n" + STRING_UNKNOWN_DATA_FORMAT, "regedit: Unsupported registry data type [0x%1!x!]\n" STRING_UNEXPECTED_EOL, "regedit: Unexpected end of line in '%1'.\n" STRING_UNRECOGNIZED_LINE, "regedit: The line '%1' was not recognized.\n" STRING_SETVALUE_FAILED, "regedit: Unable to add the registry value '%1' to '%2'.\n" diff --git a/programs/regedit/regproc.c b/programs/regedit/regproc.c index ad3c5d5ad0..50564c8fdb 100644 --- a/programs/regedit/regproc.c +++ b/programs/regedit/regproc.c @@ -142,6 +142,11 @@ enum parser_state QUOTED_VALUE_NAME, /* parsing a double-quoted value name */ DATA_START, /* preparing for data parsing operations */ DELETE_VALUE, /* deleting a registry value */ + DATA_TYPE, /* parsing the registry data type */ + STRING_DATA, /* parsing REG_SZ data */ + DWORD_DATA, /* parsing DWORD data */ + HEX_DATA, /* parsing REG_BINARY, REG_NONE, REG_EXPAND_SZ or REG_MULTI_SZ data */ + UNKNOWN_DATA, /* parsing an unhandled or invalid data type */ SET_VALUE, /* adding a value to the registry */ NB_PARSER_STATES }; @@ -152,6 +157,8 @@ struct parser WCHAR two_wchars[2]; /* first two characters from the encoding check */ BOOL is_unicode; /* parsing Unicode or ASCII data */ short int reg_version; /* registry file version */ + HKEY hkey; /* current registry key */ + WCHAR *key_name; /* current key name */ WCHAR *value_name; /* value name */ DWORD data_type; /* data type */ void *data; /* value data */ @@ -171,6 +178,11 @@ static WCHAR *default_value_name_state(struct parser *parser, WCHAR *pos); static WCHAR *quoted_value_name_state(struct parser *parser, WCHAR *pos); static WCHAR *data_start_state(struct parser *parser, WCHAR *pos); static WCHAR *delete_value_state(struct parser *parser, WCHAR *pos); +static WCHAR *data_type_state(struct parser *parser, WCHAR *pos); +static WCHAR *string_data_state(struct parser *parser, WCHAR *pos); +static WCHAR *dword_data_state(struct parser *parser, WCHAR *pos); +static WCHAR *hex_data_state(struct parser *parser, WCHAR *pos); +static WCHAR *unknown_data_state(struct parser *parser, WCHAR *pos); static WCHAR *set_value_state(struct parser *parser, WCHAR *pos); static const parser_state_func parser_funcs[NB_PARSER_STATES] = @@ -184,6 +196,11 @@ static const parser_state_func parser_funcs[NB_PARSER_STATES] = quoted_value_name_state, /* QUOTED_VALUE_NAME */ data_start_state, /* DATA_START */ delete_value_state, /* DELETE_VALUE */ + data_type_state, /* DATA_TYPE */ + string_data_state, /* STRING_DATA */ + dword_data_state, /* DWORD_DATA */ + hex_data_state, /* HEX_DATA */ + unknown_data_state, /* UNKNOWN_DATA */ set_value_state, /* SET_VALUE */ }; @@ -198,7 +215,7 @@ static inline enum parser_state set_state(struct parser *parser, enum parser_sta /****************************************************************************** * Converts a hex representation of a DWORD into a DWORD. */ -static BOOL convertHexToDWord(WCHAR* str, DWORD *dw) +static BOOL convert_hex_to_dword(WCHAR *str, DWORD *dw) { WCHAR *p, *end; int count = 0; @@ -223,14 +240,13 @@ static BOOL convertHexToDWord(WCHAR* str, DWORD *dw) return TRUE; error: - output_message(STRING_INVALID_HEX); return FALSE; } /****************************************************************************** - * Converts a hex comma separated values list into a binary string. + * Converts comma-separated hex data into a binary string. */ -static BYTE* convertHexCSVToHex(WCHAR *str, DWORD *size) +static BYTE *convert_hex_csv_to_hex(WCHAR *str, DWORD *size) { WCHAR *s; BYTE *d, *data; @@ -249,7 +265,6 @@ static BYTE* convertHexCSVToHex(WCHAR *str, DWORD *size) wc = strtoulW(s,&end,16); if (end == s || wc > 0xff || (*end && *end != ',')) { - output_message(STRING_CSV_HEX_ERROR, s); HeapFree(GetProcessHeap(), 0, data); return NULL; } @@ -265,13 +280,12 @@ static BYTE* convertHexCSVToHex(WCHAR *str, DWORD *size) #define REG_UNKNOWN_TYPE 99 /****************************************************************************** - * This function returns the HKEY associated with the data type encoded in the - * value. It modifies the input parameter (key value) in order to skip this - * "now useless" data type information. + * Parses the data type of the registry value being imported and modifies + * the input parameter to skip the string representation of the data type. * - * Note: Updated based on the algorithm used in 'server/registry.c' + * Returns TRUE or FALSE to indicate whether a data type was found. */ -static DWORD getDataType(LPWSTR *lpValue, DWORD* parse_type) +static BOOL parse_data_type(struct parser *parser, WCHAR **line) { struct data_type { const WCHAR *tag; int len; int type; int parse_type; }; @@ -290,31 +304,31 @@ static DWORD getDataType(LPWSTR *lpValue, DWORD* parse_type) }; const struct data_type *ptr; - int type; - for (ptr = data_types; ptr->tag; ptr++) { - if (strncmpW( ptr->tag, *lpValue, ptr->len )) + for (ptr = data_types; ptr->tag; ptr++) + { + if (strncmpW(ptr->tag, *line, ptr->len)) continue; - /* Found! */ - *parse_type = ptr->parse_type; - type=ptr->type; - *lpValue+=ptr->len; - if (type == -1) { - WCHAR* end; + parser->data_type = ptr->parse_type; + *line += ptr->len; + + if (ptr->type == -1) + { + WCHAR *end; + DWORD val; /* "hex(xx):" is special */ - type = (int)strtoulW( *lpValue , &end, 16 ); - if (**lpValue=='\0' || *end!=')' || *(end+1)!=':') { - type = REG_UNKNOWN_TYPE; - } else { - *lpValue = end + 2; - } + val = strtoulW(*line, &end, 16); + if (!**line || *end != ')' || *(end + 1) != ':') + return FALSE; + + parser->data_type = val; + *line = end + 2; } - return type; + return TRUE; } - *parse_type = REG_UNKNOWN_TYPE; - return REG_UNKNOWN_TYPE; + return FALSE; } /****************************************************************************** @@ -388,10 +402,6 @@ static HKEY parse_key_name(WCHAR *key_name, WCHAR **key_path) return 0; } -/* Globals used by the setValue() & co */ -static WCHAR *currentKeyName; -static HKEY currentKeyHandle = NULL; - /* Registry data types */ static const WCHAR type_none[] = {'R','E','G','_','N','O','N','E',0}; static const WCHAR type_sz[] = {'R','E','G','_','S','Z',0}; @@ -431,101 +441,16 @@ static const WCHAR *reg_type_to_wchar(DWORD type) return NULL; } -/****************************************************************************** - * Sets the value with name val_name to the data in val_data for the currently - * opened key. - * - * Parameters: - * val_name - name of the registry value - * val_data - registry value data - */ -static LONG setValue(WCHAR* val_name, WCHAR* val_data, BOOL is_unicode) + +static void close_key(struct parser *parser) { - LONG res; - DWORD dwDataType, dwParseType; - LPBYTE lpbData; - DWORD dwData, dwLen; - WCHAR del[] = {'-',0}; - - if (!val_data) - return ERROR_INVALID_PARAMETER; - - if (lstrcmpW(val_data, del) == 0) + if (parser->hkey) { - res=RegDeleteValueW(currentKeyHandle,val_name); - return (res == ERROR_FILE_NOT_FOUND ? ERROR_SUCCESS : res); - } + HeapFree(GetProcessHeap(), 0, parser->key_name); + parser->key_name = NULL; - /* Get the data type stored into the value field */ - dwDataType = getDataType(&val_data, &dwParseType); - - if (dwParseType == REG_SZ) /* no conversion for string */ - { - WCHAR *line; - if (!REGPROC_unescape_string(val_data, &line)) - return ERROR_INVALID_DATA; - while (*line == ' ' || *line == '\t') line++; - if (*line && *line != ';') - return ERROR_INVALID_DATA; - lpbData = (BYTE*) val_data; - dwLen = (lstrlenW(val_data) + 1) * sizeof(WCHAR); /* size is in bytes */ - } - else if (dwParseType == REG_DWORD) /* Convert the dword types */ - { - if (!convertHexToDWord(val_data, &dwData)) - return ERROR_INVALID_DATA; - lpbData = (BYTE*)&dwData; - dwLen = sizeof(dwData); - } - else if (dwParseType == REG_BINARY) /* Convert the binary data */ - { - lpbData = convertHexCSVToHex(val_data, &dwLen); - if (!lpbData) - return ERROR_INVALID_DATA; - - if((dwDataType == REG_MULTI_SZ || dwDataType == REG_EXPAND_SZ) && !is_unicode) - { - LPBYTE tmp = lpbData; - lpbData = (LPBYTE)GetWideStringN((char*)lpbData, dwLen, &dwLen); - dwLen *= sizeof(WCHAR); - HeapFree(GetProcessHeap(), 0, tmp); - } - } - else /* unknown format */ - { - if (dwDataType == REG_UNKNOWN_TYPE) - { - WCHAR buf[32]; - LoadStringW(GetModuleHandleW(NULL), STRING_UNKNOWN_TYPE, buf, ARRAY_SIZE(buf)); - output_message(STRING_UNKNOWN_DATA_FORMAT, buf); - } - else - output_message(STRING_UNKNOWN_DATA_FORMAT, reg_type_to_wchar(dwDataType)); - - return ERROR_INVALID_DATA; - } - - res = RegSetValueExW( - currentKeyHandle, - val_name, - 0, /* Reserved */ - dwDataType, - lpbData, - dwLen); - if (dwParseType == REG_BINARY) - HeapFree(GetProcessHeap(), 0, lpbData); - return res; -} - -static void closeKey(void) -{ - if (currentKeyHandle) - { - HeapFree(GetProcessHeap(), 0, currentKeyName); - currentKeyName = NULL; - - RegCloseKey(currentKeyHandle); - currentKeyHandle = NULL; + RegCloseKey(parser->hkey); + parser->hkey = NULL; } } @@ -533,32 +458,31 @@ static void closeKey(void) * Opens the registry key given by the input path. * This key must be closed by calling close_key(). */ -static LONG openKeyW(WCHAR* stdInput) +static LONG open_key(struct parser *parser, WCHAR *path) { HKEY key_class; WCHAR *key_path; LONG res; - closeKey(); + close_key(parser); /* Get the registry class */ - if (!stdInput || !(key_class = parse_key_name(stdInput, &key_path))) + if (!path || !(key_class = parse_key_name(path, &key_path))) return ERROR_INVALID_PARAMETER; res = RegCreateKeyExW(key_class, key_path, 0, NULL, REG_OPTION_NON_VOLATILE, - KEY_ALL_ACCESS, NULL, ¤tKeyHandle, NULL); + KEY_ALL_ACCESS, NULL, &parser->hkey, NULL); if (res == ERROR_SUCCESS) { - currentKeyName = HeapAlloc(GetProcessHeap(), 0, (strlenW(stdInput) + 1) * sizeof(WCHAR)); - CHECK_ENOUGH_MEMORY(currentKeyName); - strcpyW(currentKeyName, stdInput); + parser->key_name = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(path) + 1) * sizeof(WCHAR)); + CHECK_ENOUGH_MEMORY(parser->key_name); + lstrcpyW(parser->key_name, path); } else - currentKeyHandle = NULL; + parser->hkey = NULL; return res; - } enum reg_versions { @@ -660,9 +584,7 @@ static WCHAR *parse_win31_line_state(struct parser *parser, WCHAR *pos) line[key_end] = 0; - closeKey(); - - if (openKeyW(line) != ERROR_SUCCESS) + if (open_key(parser, line) != ERROR_SUCCESS) { output_message(STRING_OPEN_KEY_FAILED, line); goto invalid; @@ -729,7 +651,7 @@ static WCHAR *key_name_state(struct parser *parser, WCHAR *pos) set_state(parser, DELETE_KEY); return p + 1; } - else if (openKeyW(p) != ERROR_SUCCESS) + else if (open_key(parser, p) != ERROR_SUCCESS) output_message(STRING_OPEN_KEY_FAILED, p); done: @@ -802,12 +724,10 @@ static WCHAR *data_start_state(struct parser *parser, WCHAR *pos) p[len] = 0; if (*p == '-') - { set_state(parser, DELETE_VALUE); - return p; - } - else if (setValue(parser->value_name, p, parser->is_unicode) != ERROR_SUCCESS) - output_message(STRING_SETVALUE_FAILED, parser->value_name, currentKeyName); + else + set_state(parser, DATA_TYPE); + return p; done: set_state(parser, LINE_START); @@ -822,20 +742,136 @@ static WCHAR *delete_value_state(struct parser *parser, WCHAR *pos) while (*p == ' ' || *p == '\t') p++; if (*p && *p != ';') goto done; - RegDeleteValueW(currentKeyHandle, parser->value_name); + RegDeleteValueW(parser->hkey, parser->value_name); done: set_state(parser, LINE_START); return p; } +/* handler for parser DATA_TYPE state */ +static WCHAR *data_type_state(struct parser *parser, WCHAR *pos) +{ + WCHAR *line = pos; + + if (!parse_data_type(parser, &line)) + { + set_state(parser, LINE_START); + return line; + } + + switch (parser->data_type) + { + case REG_SZ: + set_state(parser, STRING_DATA); + break; + case REG_DWORD: + set_state(parser, DWORD_DATA); + break; + case REG_NONE: + case REG_EXPAND_SZ: + case REG_BINARY: + case REG_MULTI_SZ: + set_state(parser, HEX_DATA); + break; + default: + set_state(parser, UNKNOWN_DATA); + } + + return line; +} + +/* handler for parser STRING_DATA state */ +static WCHAR *string_data_state(struct parser *parser, WCHAR *pos) +{ + WCHAR *line; + + parser->data = pos; + + if (!REGPROC_unescape_string(parser->data, &line)) + goto invalid; + + while (*line == ' ' || *line == '\t') line++; + if (*line && *line != ';') goto invalid; + + parser->data_size = (lstrlenW(parser->data) + 1) * sizeof(WCHAR); + + set_state(parser, SET_VALUE); + return line; + +invalid: + set_state(parser, LINE_START); + return line; +} + +/* handler for parser DWORD_DATA state */ +static WCHAR *dword_data_state(struct parser *parser, WCHAR *pos) +{ + WCHAR *line = pos; + + parser->data = HeapAlloc(GetProcessHeap(), 0, sizeof(DWORD)); + CHECK_ENOUGH_MEMORY(parser->data); + + if (!convert_hex_to_dword(line, parser->data)) + goto invalid; + + parser->data_size = sizeof(DWORD); + + set_state(parser, SET_VALUE); + return line; + +invalid: + HeapFree(GetProcessHeap(), 0, parser->data); + parser->data = NULL; + + set_state(parser, LINE_START); + return line; +} + +/* handler for parser HEX_DATA state */ +static WCHAR *hex_data_state(struct parser *parser, WCHAR *pos) +{ + WCHAR *line = pos; + + if (!(parser->data = convert_hex_csv_to_hex(line, &parser->data_size))) + goto invalid; + + if (!parser->is_unicode && (parser->data_type == REG_EXPAND_SZ || parser->data_type == REG_MULTI_SZ)) + { + void *tmp = parser->data; + + parser->data = GetWideStringN(parser->data, parser->data_size, &parser->data_size); + parser->data_size *= sizeof(WCHAR); + HeapFree(GetProcessHeap(), 0, tmp); + } + + set_state(parser, SET_VALUE); + return line; + +invalid: + set_state(parser, LINE_START); + return line; +} + +/* handler for parser UNKNOWN_DATA state */ +static WCHAR *unknown_data_state(struct parser *parser, WCHAR *pos) +{ + output_message(STRING_UNKNOWN_DATA_FORMAT, parser->data_type); + + set_state(parser, LINE_START); + return pos; +} + /* handler for parser SET_VALUE state */ static WCHAR *set_value_state(struct parser *parser, WCHAR *pos) { - RegSetValueExW(currentKeyHandle, parser->value_name, 0, parser->data_type, + RegSetValueExW(parser->hkey, parser->value_name, 0, parser->data_type, parser->data, parser->data_size); - set_state(parser, PARSE_WIN31_LINE); + if (parser->reg_version == REG_VERSION_31) + set_state(parser, PARSE_WIN31_LINE); + else + set_state(parser, LINE_START); return pos; } @@ -1468,6 +1504,8 @@ BOOL import_registry_file(FILE *reg_file) parser.two_wchars[0] = s[0]; parser.two_wchars[1] = s[1]; parser.reg_version = -1; + parser.hkey = NULL; + parser.key_name = NULL; parser.value_name = NULL; parser.data_type = 0; parser.data = NULL; @@ -1486,7 +1524,8 @@ BOOL import_registry_file(FILE *reg_file) if (parser.value_name) HeapFree(GetProcessHeap(), 0, parser.value_name); - closeKey(); + close_key(&parser); + return TRUE; } diff --git a/programs/regedit/tests/regedit.c b/programs/regedit/tests/regedit.c index c7465d84a1..254073bd8c 100644 --- a/programs/regedit/tests/regedit.c +++ b/programs/regedit/tests/regedit.c @@ -457,14 +457,14 @@ static void test_basic_import(void) "\"Wine13h\"=hex(ffffffff):56,61,6c,75,65,00\n" "\"Wine13i\"=hex(100000000):56,61,6c,75,65,00\n\n"); verify_reg(hkey, "Wine13a", REG_NONE, "Value", 6, 0); - verify_reg(hkey, "Wine13b", 0x10, "Value", 6, 0); - verify_reg(hkey, "Wine13c", 0x100, "Value", 6, 0); - verify_reg(hkey, "Wine13d", 0x1000, "Value", 6, 0); - verify_reg(hkey, "Wine13e", 0x7fff, "Value", 6, 0); - verify_reg(hkey, "Wine13f", 0xffff, "Value", 6, 0); - verify_reg(hkey, "Wine13g", 0x7fffffff, "Value", 6, 0); - verify_reg(hkey, "Wine13h", 0xffffffff, "Value", 6, 0); - todo_wine verify_reg_nonexist(hkey, "Wine13i"); + todo_wine verify_reg(hkey, "Wine13b", 0x10, "Value", 6, 0); + todo_wine verify_reg(hkey, "Wine13c", 0x100, "Value", 6, 0); + todo_wine verify_reg(hkey, "Wine13d", 0x1000, "Value", 6, 0); + todo_wine verify_reg(hkey, "Wine13e", 0x7fff, "Value", 6, 0); + todo_wine verify_reg(hkey, "Wine13f", 0xffff, "Value", 6, 0); + todo_wine verify_reg(hkey, "Wine13g", 0x7fffffff, "Value", 6, 0); + todo_wine verify_reg(hkey, "Wine13h", 0xffffffff, "Value", 6, 0); + verify_reg_nonexist(hkey, "Wine13i"); RegCloseKey(hkey);