From 3e87a70e82b83ba0786a20e195cc8708e692b15b Mon Sep 17 00:00:00 2001 From: Hugh McMaster Date: Fri, 18 Aug 2017 09:30:04 +0000 Subject: [PATCH] reg: Introduce a partial state machine for importing Windows 3.1 registry data. Signed-off-by: Hugh McMaster Signed-off-by: Alexandre Julliard --- po/ar.po | 12 ++ po/bg.po | 11 ++ po/ca.po | 12 ++ po/cs.po | 12 ++ po/da.po | 12 ++ po/de.po | 12 ++ po/el.po | 9 ++ po/en.po | 8 + po/en_US.po | 8 + po/eo.po | 12 ++ po/es.po | 12 ++ po/fa.po | 9 ++ po/fi.po | 12 ++ po/fr.po | 12 ++ po/he.po | 12 ++ po/hi.po | 8 + po/hr.po | 12 ++ po/hu.po | 12 ++ po/it.po | 12 ++ po/ja.po | 12 ++ po/ko.po | 12 ++ po/lt.po | 12 ++ po/ml.po | 8 + po/nb_NO.po | 12 ++ po/nl.po | 12 ++ po/or.po | 8 + po/pa.po | 8 + po/pl.po | 12 ++ po/pt_BR.po | 12 ++ po/pt_PT.po | 12 ++ po/rm.po | 9 ++ po/ro.po | 12 ++ po/ru.po | 12 ++ po/sk.po | 12 ++ po/sl.po | 12 ++ po/sr_RS@cyrillic.po | 11 ++ po/sr_RS@latin.po | 11 ++ po/sv.po | 12 ++ po/te.po | 8 + po/th.po | 10 ++ po/tr.po | 12 ++ po/uk.po | 12 ++ po/wa.po | 9 ++ po/wine.pot | 8 + po/zh_CN.po | 12 ++ po/zh_TW.po | 12 ++ programs/reg/import.c | 408 ++++++++++++++++++++++++++++++++++++++++++++++- programs/reg/reg.c | 12 +- programs/reg/reg.h | 10 ++ programs/reg/reg.rc | 2 + programs/reg/resource.h | 2 + programs/reg/tests/reg.c | 98 ++++++------ 52 files changed, 978 insertions(+), 57 deletions(-) diff --git a/po/ar.po b/po/ar.po index b4769c5c176..0f312643c87 100644 --- a/po/ar.po +++ b/po/ar.po @@ -12455,6 +12455,18 @@ msgstr "(القيمة غير مضبوطة)" msgid "REG IMPORT file.reg\n" msgstr "" +#: reg.rc:67 +#, fuzzy +#| msgid "No command was specified." +msgid "reg: The file '%1' was not found.\n" +msgstr "لم يتم تحديد أي أمر." + +#: reg.rc:68 +#, fuzzy +#| msgid "Error: Unable to add keys to remote machine\n" +msgid "reg: Unable to open the registry key '%1'.\n" +msgstr "خطأ : تعذر إضافة المفاتيح للجهاز البعيد\n" + #: regedit.rc:34 msgid "&Registry" msgstr "ال&سجل" diff --git a/po/bg.po b/po/bg.po index d2f0ebe34b3..f6d92a7e49b 100644 --- a/po/bg.po +++ b/po/bg.po @@ -12021,6 +12021,17 @@ msgstr "" msgid "REG IMPORT file.reg\n" msgstr "" +#: reg.rc:67 +#, fuzzy +msgid "reg: The file '%1' was not found.\n" +msgstr "Файлът не е намерен.\n" + +#: reg.rc:68 +#, fuzzy +#| msgid "Are you sure you want to delete '%1'?" +msgid "reg: Unable to open the registry key '%1'.\n" +msgstr "Наистина ли искате да изтриете '%1'?" + #: regedit.rc:34 msgid "&Registry" msgstr "&Регистър" diff --git a/po/ca.po b/po/ca.po index 829ed8a8da7..2ce76748820 100644 --- a/po/ca.po +++ b/po/ca.po @@ -12317,6 +12317,18 @@ msgstr "(valor no definit)" msgid "REG IMPORT file.reg\n" msgstr "" +#: reg.rc:67 +#, fuzzy +#| msgid "regedit: The file '%1' was not found.\n" +msgid "reg: The file '%1' was not found.\n" +msgstr "regedit: No s'ha trobat el fitxer '%1'.\n" + +#: reg.rc:68 +#, fuzzy +#| msgid "regedit: Unable to open the registry key '%1'.\n" +msgid "reg: Unable to open the registry key '%1'.\n" +msgstr "regedit: No s'ha pogut obrir la clau de registre '%1'.\n" + #: regedit.rc:34 msgid "&Registry" msgstr "&Registre" diff --git a/po/cs.po b/po/cs.po index 3de8c03e3ce..d5ddbdd4ee9 100644 --- a/po/cs.po +++ b/po/cs.po @@ -12144,6 +12144,18 @@ msgstr "(hodnota nenastavena)" msgid "REG IMPORT file.reg\n" msgstr "" +#: reg.rc:67 +#, fuzzy +#| msgid "No command was specified." +msgid "reg: The file '%1' was not found.\n" +msgstr "Nebyl zadán žádný příkaz." + +#: reg.rc:68 +#, fuzzy +#| msgid "Error: Unable to add keys to remote machine\n" +msgid "reg: Unable to open the registry key '%1'.\n" +msgstr "Chyba: Nepodařilo se přidat klíče na vzdálený stroj\n" + #: regedit.rc:34 msgid "&Registry" msgstr "&Registr" diff --git a/po/da.po b/po/da.po index 292fa24baf3..2109e457c3f 100644 --- a/po/da.po +++ b/po/da.po @@ -12410,6 +12410,18 @@ msgstr "(værdi ikke sat)" msgid "REG IMPORT file.reg\n" msgstr "" +#: reg.rc:67 +#, fuzzy +#| msgid "No command was specified." +msgid "reg: The file '%1' was not found.\n" +msgstr "Der blev ikke specificeret nogen kommando." + +#: reg.rc:68 +#, fuzzy +#| msgid "Error: Unable to add keys to remote machine\n" +msgid "reg: Unable to open the registry key '%1'.\n" +msgstr "Fejl: Kunne ikke tilføje nøgler til fjern maskinen\n" + #: regedit.rc:34 msgid "&Registry" msgstr "&Register" diff --git a/po/de.po b/po/de.po index 75e6e4c2b99..69caf28f93b 100644 --- a/po/de.po +++ b/po/de.po @@ -12215,6 +12215,18 @@ msgstr "(Wert nicht gesetzt)" msgid "REG IMPORT file.reg\n" msgstr "" +#: reg.rc:67 +#, fuzzy +#| msgid "regedit: The file '%1' was not found.\n" +msgid "reg: The file '%1' was not found.\n" +msgstr "regedit: Die Datei '%1' wurde nicht gefunden.\n" + +#: reg.rc:68 +#, fuzzy +#| msgid "regedit: Unable to open the registry key '%1'.\n" +msgid "reg: Unable to open the registry key '%1'.\n" +msgstr "regedit: Der Schlüssel '%1' konnte nicht geöffnet werden.\n" + #: regedit.rc:34 msgid "&Registry" msgstr "&Registrierung" diff --git a/po/el.po b/po/el.po index 34c35550bb6..1823d3550c6 100644 --- a/po/el.po +++ b/po/el.po @@ -11792,6 +11792,15 @@ msgstr "" msgid "REG IMPORT file.reg\n" msgstr "" +#: reg.rc:67 +#, fuzzy +msgid "reg: The file '%1' was not found.\n" +msgstr "Το αρχείο δε βρέθηκε.\n" + +#: reg.rc:68 +msgid "reg: Unable to open the registry key '%1'.\n" +msgstr "" + #: regedit.rc:34 msgid "&Registry" msgstr "" diff --git a/po/en.po b/po/en.po index d4b605f1dd7..e230437868a 100644 --- a/po/en.po +++ b/po/en.po @@ -12128,6 +12128,14 @@ msgstr "(value not set)" msgid "REG IMPORT file.reg\n" msgstr "REG IMPORT file.reg\n" +#: reg.rc:67 +msgid "reg: The file '%1' was not found.\n" +msgstr "reg: The file '%1' was not found.\n" + +#: reg.rc:68 +msgid "reg: Unable to open the registry key '%1'.\n" +msgstr "reg: Unable to open the registry key '%1'.\n" + #: regedit.rc:34 msgid "&Registry" msgstr "&Registry" diff --git a/po/en_US.po b/po/en_US.po index f9e1e1f0e7d..2fcee162d3d 100644 --- a/po/en_US.po +++ b/po/en_US.po @@ -12128,6 +12128,14 @@ msgstr "(value not set)" msgid "REG IMPORT file.reg\n" msgstr "REG IMPORT file.reg\n" +#: reg.rc:67 +msgid "reg: The file '%1' was not found.\n" +msgstr "reg: The file '%1' was not found.\n" + +#: reg.rc:68 +msgid "reg: Unable to open the registry key '%1'.\n" +msgstr "reg: Unable to open the registry key '%1'.\n" + #: regedit.rc:34 msgid "&Registry" msgstr "&Registry" diff --git a/po/eo.po b/po/eo.po index 01221ffff1a..98880751981 100644 --- a/po/eo.po +++ b/po/eo.po @@ -11733,6 +11733,18 @@ msgstr "(valoro ne elektita)" msgid "REG IMPORT file.reg\n" msgstr "" +#: reg.rc:67 +#, fuzzy +#| msgid "Search string '%s' not found" +msgid "reg: The file '%1' was not found.\n" +msgstr "Mi ne trovis la ĉenon %s" + +#: reg.rc:68 +#, fuzzy +#| msgid "Are you sure you want to delete '%1'?" +msgid "reg: Unable to open the registry key '%1'.\n" +msgstr "Ĉu vi estas certa pri forigo de '%1'?" + #: regedit.rc:34 msgid "&Registry" msgstr "&Registrejo" diff --git a/po/es.po b/po/es.po index 1ae9821c4dc..488f90fdf61 100644 --- a/po/es.po +++ b/po/es.po @@ -12489,6 +12489,18 @@ msgstr "(valor no definido)" msgid "REG IMPORT file.reg\n" msgstr "" +#: reg.rc:67 +#, fuzzy +#| msgid "No command was specified." +msgid "reg: The file '%1' was not found.\n" +msgstr "No se ha especificado un comando." + +#: reg.rc:68 +#, fuzzy +#| msgid "Error: Unable to add keys to remote machine\n" +msgid "reg: Unable to open the registry key '%1'.\n" +msgstr "Error: No se puede agregar claves al equipo remoto\n" + #: regedit.rc:34 msgid "&Registry" msgstr "&Registro" diff --git a/po/fa.po b/po/fa.po index 90d7b9200bd..44f06be35a8 100644 --- a/po/fa.po +++ b/po/fa.po @@ -11777,6 +11777,15 @@ msgstr "" msgid "REG IMPORT file.reg\n" msgstr "" +#: reg.rc:67 +msgid "reg: The file '%1' was not found.\n" +msgstr "" + +#: reg.rc:68 +#, fuzzy +msgid "reg: Unable to open the registry key '%1'.\n" +msgstr "پرونده‌های متنی (*.txt).\n" + #: regedit.rc:34 msgid "&Registry" msgstr "" diff --git a/po/fi.po b/po/fi.po index 3bc496de070..88109c18b90 100644 --- a/po/fi.po +++ b/po/fi.po @@ -12119,6 +12119,18 @@ msgstr "(arvoa ei asetettu)" msgid "REG IMPORT file.reg\n" msgstr "" +#: reg.rc:67 +#, fuzzy +#| msgid "regedit: The file '%1' was not found.\n" +msgid "reg: The file '%1' was not found.\n" +msgstr "regedit: Tiedostoa '%1' ei löydy.\n" + +#: reg.rc:68 +#, fuzzy +#| msgid "regedit: Unable to open the registry key '%1'.\n" +msgid "reg: Unable to open the registry key '%1'.\n" +msgstr "regedit: Rekisteriavainta '%1' ei voida avata.\n" + #: regedit.rc:34 msgid "&Registry" msgstr "&Rekisteri" diff --git a/po/fr.po b/po/fr.po index fef6c6e426c..1d79e002dd6 100644 --- a/po/fr.po +++ b/po/fr.po @@ -12360,6 +12360,18 @@ msgstr "(valeur non définie)" msgid "REG IMPORT file.reg\n" msgstr "" +#: reg.rc:67 +#, fuzzy +#| msgid "regedit: The file '%1' was not found.\n" +msgid "reg: The file '%1' was not found.\n" +msgstr "regedit : le fichier « %1 » est introuvable.\n" + +#: reg.rc:68 +#, fuzzy +#| msgid "regedit: Unable to open the registry key '%1'.\n" +msgid "reg: Unable to open the registry key '%1'.\n" +msgstr "regedit : impossible d'ouvrir la clé de registre « %1 ».\n" + #: regedit.rc:34 msgid "&Registry" msgstr "&Registre" diff --git a/po/he.po b/po/he.po index 1e682c9c5c4..a6c153f43fe 100644 --- a/po/he.po +++ b/po/he.po @@ -12201,6 +12201,18 @@ msgstr "(לא הוגדר ערך)" msgid "REG IMPORT file.reg\n" msgstr "" +#: reg.rc:67 +#, fuzzy +#| msgid "Search string '%s' not found" +msgid "reg: The file '%1' was not found.\n" +msgstr "מחרוזת החיפוש ׳%s׳ לא נמצאה" + +#: reg.rc:68 +#, fuzzy +#| msgid "Error: Unable to add keys to remote machine\n" +msgid "reg: Unable to open the registry key '%1'.\n" +msgstr "Error: Unable to add keys to remote machine\n" + #: regedit.rc:34 msgid "&Registry" msgstr "&רישום המערכת" diff --git a/po/hi.po b/po/hi.po index 08aa50182d1..6c45aa69b0f 100644 --- a/po/hi.po +++ b/po/hi.po @@ -11579,6 +11579,14 @@ msgstr "" msgid "REG IMPORT file.reg\n" msgstr "" +#: reg.rc:67 +msgid "reg: The file '%1' was not found.\n" +msgstr "" + +#: reg.rc:68 +msgid "reg: Unable to open the registry key '%1'.\n" +msgstr "" + #: regedit.rc:34 msgid "&Registry" msgstr "" diff --git a/po/hr.po b/po/hr.po index 684e0fd6634..03e864ee94a 100644 --- a/po/hr.po +++ b/po/hr.po @@ -11961,6 +11961,18 @@ msgstr "(vrijednost nije postavljena)" msgid "REG IMPORT file.reg\n" msgstr "" +#: reg.rc:67 +#, fuzzy +#| msgid "File not found.\n" +msgid "reg: The file '%1' was not found.\n" +msgstr "Datoteka nije pronađena.\n" + +#: reg.rc:68 +#, fuzzy +#| msgid "Could not open the file." +msgid "reg: Unable to open the registry key '%1'.\n" +msgstr "Datoteka se ne može otvoriti." + #: regedit.rc:34 msgid "&Registry" msgstr "&Registar" diff --git a/po/hu.po b/po/hu.po index 84881f4fb9c..b582c334a30 100644 --- a/po/hu.po +++ b/po/hu.po @@ -12404,6 +12404,18 @@ msgstr "(nem beállított)" msgid "REG IMPORT file.reg\n" msgstr "" +#: reg.rc:67 +#, fuzzy +#| msgid "No command was specified." +msgid "reg: The file '%1' was not found.\n" +msgstr "Nem volt parancs meghatározva." + +#: reg.rc:68 +#, fuzzy +#| msgid "Error: Unable to add keys to remote machine\n" +msgid "reg: Unable to open the registry key '%1'.\n" +msgstr "Hiba: nem lehet kulcsokat hozzáadni a távoli gépnél\n" + #: regedit.rc:34 msgid "&Registry" msgstr "&Fájl" diff --git a/po/it.po b/po/it.po index 2b63a0442ca..543514f834d 100644 --- a/po/it.po +++ b/po/it.po @@ -12490,6 +12490,18 @@ msgstr "(valore non immesso)" msgid "REG IMPORT file.reg\n" msgstr "" +#: reg.rc:67 +#, fuzzy +#| msgid "No command was specified." +msgid "reg: The file '%1' was not found.\n" +msgstr "Non è stato specificato nessun comando." + +#: reg.rc:68 +#, fuzzy +#| msgid "Error: Unable to add keys to remote machine\n" +msgid "reg: Unable to open the registry key '%1'.\n" +msgstr "Errore: impossibile aggiungere chiavi alla macchina remota\n" + #: regedit.rc:34 msgid "&Registry" msgstr "&Registro" diff --git a/po/ja.po b/po/ja.po index 5b0c0c55c84..68a259432a2 100644 --- a/po/ja.po +++ b/po/ja.po @@ -12131,6 +12131,18 @@ msgstr "(値の設定なし)" msgid "REG IMPORT file.reg\n" msgstr "" +#: reg.rc:67 +#, fuzzy +#| msgid "regedit: The file '%1' was not found.\n" +msgid "reg: The file '%1' was not found.\n" +msgstr "regedit: ファイル '%1' が見つかりません。\n" + +#: reg.rc:68 +#, fuzzy +#| msgid "regedit: Unable to open the registry key '%1'.\n" +msgid "reg: Unable to open the registry key '%1'.\n" +msgstr "regedit: レジストリ キー '%1' を開けません。\n" + #: regedit.rc:34 msgid "&Registry" msgstr "レジストリ(&R)" diff --git a/po/ko.po b/po/ko.po index efbb9e63930..213644f47c6 100644 --- a/po/ko.po +++ b/po/ko.po @@ -12479,6 +12479,18 @@ msgstr "(값이 정해지지 않음)" msgid "REG IMPORT file.reg\n" msgstr "" +#: reg.rc:67 +#, fuzzy +#| msgid "No command was specified." +msgid "reg: The file '%1' was not found.\n" +msgstr "어떤 명령도 정의되지 않았습니다." + +#: reg.rc:68 +#, fuzzy +#| msgid "Error: Unable to add keys to remote machine\n" +msgid "reg: Unable to open the registry key '%1'.\n" +msgstr "오류: 원격 머신에 키를 더하는 것은 가능하지 않습니다\n" + #: regedit.rc:34 msgid "&Registry" msgstr "레지스트리(&R)" diff --git a/po/lt.po b/po/lt.po index 6c252fefdcc..4ee3ebb3665 100644 --- a/po/lt.po +++ b/po/lt.po @@ -12142,6 +12142,18 @@ msgstr "(reikšmė nenustatyta)" msgid "REG IMPORT file.reg\n" msgstr "" +#: reg.rc:67 +#, fuzzy +#| msgid "regedit: The file '%1' was not found.\n" +msgid "reg: The file '%1' was not found.\n" +msgstr "regedit: Failas „%1“ nerastas.\n" + +#: reg.rc:68 +#, fuzzy +#| msgid "regedit: Unable to open the registry key '%1'.\n" +msgid "reg: Unable to open the registry key '%1'.\n" +msgstr "regedit: Nepavyko atverti registro rakto „%1“.\n" + #: regedit.rc:34 msgid "&Registry" msgstr "R&egistras" diff --git a/po/ml.po b/po/ml.po index 8714a9011f1..779239673b1 100644 --- a/po/ml.po +++ b/po/ml.po @@ -11579,6 +11579,14 @@ msgstr "" msgid "REG IMPORT file.reg\n" msgstr "" +#: reg.rc:67 +msgid "reg: The file '%1' was not found.\n" +msgstr "" + +#: reg.rc:68 +msgid "reg: Unable to open the registry key '%1'.\n" +msgstr "" + #: regedit.rc:34 msgid "&Registry" msgstr "" diff --git a/po/nb_NO.po b/po/nb_NO.po index a6531148e83..203637ff143 100644 --- a/po/nb_NO.po +++ b/po/nb_NO.po @@ -12133,6 +12133,18 @@ msgstr "(verdi ikke oppgitt)" msgid "REG IMPORT file.reg\n" msgstr "" +#: reg.rc:67 +#, fuzzy +#| msgid "regedit: The file '%1' was not found.\n" +msgid "reg: The file '%1' was not found.\n" +msgstr "regedit: Filen \"%1\" ble ikke funnet.\n" + +#: reg.rc:68 +#, fuzzy +#| msgid "regedit: Unable to open the registry key '%1'.\n" +msgid "reg: Unable to open the registry key '%1'.\n" +msgstr "regedit: Kan ikke åpne registernøkkelen \"%1\".\n" + #: regedit.rc:34 msgid "&Registry" msgstr "&Register" diff --git a/po/nl.po b/po/nl.po index 99f900135c7..64c7ba57422 100644 --- a/po/nl.po +++ b/po/nl.po @@ -12456,6 +12456,18 @@ msgstr "(Geen waarde ingesteld)" msgid "REG IMPORT file.reg\n" msgstr "" +#: reg.rc:67 +#, fuzzy +#| msgid "No command was specified." +msgid "reg: The file '%1' was not found.\n" +msgstr "Er was geen opdracht opgegeven." + +#: reg.rc:68 +#, fuzzy +#| msgid "Error: Unable to add keys to remote machine\n" +msgid "reg: Unable to open the registry key '%1'.\n" +msgstr "Fout: Sleutels konden niet toegevoegd worden aan de remote machine\n" + #: regedit.rc:34 msgid "&Registry" msgstr "&Registerbestand" diff --git a/po/or.po b/po/or.po index 5d605f72da4..e6732be6216 100644 --- a/po/or.po +++ b/po/or.po @@ -11579,6 +11579,14 @@ msgstr "" msgid "REG IMPORT file.reg\n" msgstr "" +#: reg.rc:67 +msgid "reg: The file '%1' was not found.\n" +msgstr "" + +#: reg.rc:68 +msgid "reg: Unable to open the registry key '%1'.\n" +msgstr "" + #: regedit.rc:34 msgid "&Registry" msgstr "" diff --git a/po/pa.po b/po/pa.po index 6da2a9fb997..9e76eccb3b2 100644 --- a/po/pa.po +++ b/po/pa.po @@ -11579,6 +11579,14 @@ msgstr "" msgid "REG IMPORT file.reg\n" msgstr "" +#: reg.rc:67 +msgid "reg: The file '%1' was not found.\n" +msgstr "" + +#: reg.rc:68 +msgid "reg: Unable to open the registry key '%1'.\n" +msgstr "" + #: regedit.rc:34 msgid "&Registry" msgstr "" diff --git a/po/pl.po b/po/pl.po index d8a73d7475d..ba4421ac26c 100644 --- a/po/pl.po +++ b/po/pl.po @@ -12190,6 +12190,18 @@ msgstr "(wartość nie ustalona)" msgid "REG IMPORT file.reg\n" msgstr "" +#: reg.rc:67 +#, fuzzy +#| msgid "regedit: The file '%1' was not found.\n" +msgid "reg: The file '%1' was not found.\n" +msgstr "regedit: Nie znaleziono pliku '%1'.\n" + +#: reg.rc:68 +#, fuzzy +#| msgid "regedit: Unable to open the registry key '%1'.\n" +msgid "reg: Unable to open the registry key '%1'.\n" +msgstr "regedit: Nie udało się otworzyć klucza rejestru '%1'.\n" + #: regedit.rc:34 msgid "&Registry" msgstr "&Rejestr" diff --git a/po/pt_BR.po b/po/pt_BR.po index ed9c5eec408..ed0351c503b 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -12278,6 +12278,18 @@ msgstr "(valor não dado)" msgid "REG IMPORT file.reg\n" msgstr "" +#: reg.rc:67 +#, fuzzy +#| msgid "regedit: The file '%1' was not found.\n" +msgid "reg: The file '%1' was not found.\n" +msgstr "regedit: O arquivo '%1' não foi encontrado.\n" + +#: reg.rc:68 +#, fuzzy +#| msgid "regedit: Unable to open the registry key '%1'.\n" +msgid "reg: Unable to open the registry key '%1'.\n" +msgstr "regedit: Não foi possível abrir a chave de registro '%1'.\n" + #: regedit.rc:34 msgid "&Registry" msgstr "&Registro" diff --git a/po/pt_PT.po b/po/pt_PT.po index c2f20a682e6..755cd4ad991 100644 --- a/po/pt_PT.po +++ b/po/pt_PT.po @@ -12281,6 +12281,18 @@ msgstr "(valor não dado)" msgid "REG IMPORT file.reg\n" msgstr "" +#: reg.rc:67 +#, fuzzy +#| msgid "No command was specified." +msgid "reg: The file '%1' was not found.\n" +msgstr "Nenhum comando indicado." + +#: reg.rc:68 +#, fuzzy +#| msgid "Error: Unable to add keys to remote machine\n" +msgid "reg: Unable to open the registry key '%1'.\n" +msgstr "Erro: Incapaz de adicionar chaves à máquina remota\n" + #: regedit.rc:34 msgid "&Registry" msgstr "&Registo" diff --git a/po/rm.po b/po/rm.po index 4bcb7ae6a3b..685da714c2f 100644 --- a/po/rm.po +++ b/po/rm.po @@ -11663,6 +11663,15 @@ msgstr "" msgid "REG IMPORT file.reg\n" msgstr "" +#: reg.rc:67 +msgid "reg: The file '%1' was not found.\n" +msgstr "" + +#: reg.rc:68 +#, fuzzy +msgid "reg: Unable to open the registry key '%1'.\n" +msgstr "Tuot las datotecas (*.*).\n" + #: regedit.rc:34 msgid "&Registry" msgstr "" diff --git a/po/ro.po b/po/ro.po index e4dadc547b2..b0f720e7369 100644 --- a/po/ro.po +++ b/po/ro.po @@ -12215,6 +12215,18 @@ msgstr "(valoare nestabilită)" msgid "REG IMPORT file.reg\n" msgstr "" +#: reg.rc:67 +#, fuzzy +#| msgid "regedit: The file '%1' was not found.\n" +msgid "reg: The file '%1' was not found.\n" +msgstr "regedit: Fișierul „%1” nu a fost găsit.\n" + +#: reg.rc:68 +#, fuzzy +#| msgid "regedit: Unable to open the registry key '%1'.\n" +msgid "reg: Unable to open the registry key '%1'.\n" +msgstr "regedit: Nu s-a putut deschide cheia de registru „%1”.\n" + #: regedit.rc:34 msgid "&Registry" msgstr "&Registru" diff --git a/po/ru.po b/po/ru.po index 45c75a5266b..9e0bfedfbdc 100644 --- a/po/ru.po +++ b/po/ru.po @@ -12139,6 +12139,18 @@ msgstr "(значение не задано)" msgid "REG IMPORT file.reg\n" msgstr "" +#: reg.rc:67 +#, fuzzy +#| msgid "regedit: The file '%1' was not found.\n" +msgid "reg: The file '%1' was not found.\n" +msgstr "regedit: файл «%1» не найден.\n" + +#: reg.rc:68 +#, fuzzy +#| msgid "regedit: Unable to open the registry key '%1'.\n" +msgid "reg: Unable to open the registry key '%1'.\n" +msgstr "regedit: не удалось открыть ключ «%1».\n" + #: regedit.rc:34 msgid "&Registry" msgstr "&Реестр" diff --git a/po/sk.po b/po/sk.po index 5c0ea89c28d..75399df385a 100644 --- a/po/sk.po +++ b/po/sk.po @@ -11896,6 +11896,18 @@ msgstr "" msgid "REG IMPORT file.reg\n" msgstr "" +#: reg.rc:67 +#, fuzzy +#| msgid "No command was specified." +msgid "reg: The file '%1' was not found.\n" +msgstr "Nebol špecifikovaný žiadny príkaz." + +#: reg.rc:68 +#, fuzzy +#| msgid "Error: Unable to terminate process \"%1\".\n" +msgid "reg: Unable to open the registry key '%1'.\n" +msgstr "Chyba: Nemožno ukončiť proces \"%1\".\n" + #: regedit.rc:34 msgid "&Registry" msgstr "&Registry" diff --git a/po/sl.po b/po/sl.po index b2e1e6173a4..84b7738f773 100644 --- a/po/sl.po +++ b/po/sl.po @@ -12433,6 +12433,18 @@ msgstr "(vrednost ni nastavljena)" msgid "REG IMPORT file.reg\n" msgstr "" +#: reg.rc:67 +#, fuzzy +#| msgid "No command was specified." +msgid "reg: The file '%1' was not found.\n" +msgstr "Ukaz ni bil naveden." + +#: reg.rc:68 +#, fuzzy +#| msgid "Error: Unable to add keys to remote machine\n" +msgid "reg: Unable to open the registry key '%1'.\n" +msgstr "Napaka: ni mogoče dodati ključa na oddaljen računalnik\n" + #: regedit.rc:34 msgid "&Registry" msgstr "&Register" diff --git a/po/sr_RS@cyrillic.po b/po/sr_RS@cyrillic.po index e06737e9b37..ccb802edad2 100644 --- a/po/sr_RS@cyrillic.po +++ b/po/sr_RS@cyrillic.po @@ -12280,6 +12280,17 @@ msgstr "" msgid "REG IMPORT file.reg\n" msgstr "" +#: reg.rc:67 +#, fuzzy +msgid "reg: The file '%1' was not found.\n" +msgstr "%s путања није пронађена" + +#: reg.rc:68 +#, fuzzy +#| msgid "Are you sure you want to delete '%1'?" +msgid "reg: Unable to open the registry key '%1'.\n" +msgstr "Желите ли да избришете „%1“?" + #: regedit.rc:34 msgid "&Registry" msgstr "" diff --git a/po/sr_RS@latin.po b/po/sr_RS@latin.po index 6a9e8188f3d..ae8036eb473 100644 --- a/po/sr_RS@latin.po +++ b/po/sr_RS@latin.po @@ -12438,6 +12438,17 @@ msgstr "" msgid "REG IMPORT file.reg\n" msgstr "" +#: reg.rc:67 +#, fuzzy +msgid "reg: The file '%1' was not found.\n" +msgstr "%s putanja nije pronađena" + +#: reg.rc:68 +#, fuzzy +#| msgid "Are you sure you want to delete '%1'?" +msgid "reg: Unable to open the registry key '%1'.\n" +msgstr "Želite li da izbrišete „%1“?" + #: regedit.rc:34 msgid "&Registry" msgstr "" diff --git a/po/sv.po b/po/sv.po index de88f2117a7..1277c34b375 100644 --- a/po/sv.po +++ b/po/sv.po @@ -12105,6 +12105,18 @@ msgstr "(värde ej angivet)" msgid "REG IMPORT file.reg\n" msgstr "" +#: reg.rc:67 +#, fuzzy +#| msgid "No command was specified." +msgid "reg: The file '%1' was not found.\n" +msgstr "Inget kommando angavs." + +#: reg.rc:68 +#, fuzzy +#| msgid "reg: Unable to access remote machine\n" +msgid "reg: Unable to open the registry key '%1'.\n" +msgstr "reg: Kan inte få tillgång till fjärrmaskin\n" + #: regedit.rc:34 msgid "&Registry" msgstr "&Register" diff --git a/po/te.po b/po/te.po index 42f05dd96fc..0f0e44e419c 100644 --- a/po/te.po +++ b/po/te.po @@ -11579,6 +11579,14 @@ msgstr "" msgid "REG IMPORT file.reg\n" msgstr "" +#: reg.rc:67 +msgid "reg: The file '%1' was not found.\n" +msgstr "" + +#: reg.rc:68 +msgid "reg: Unable to open the registry key '%1'.\n" +msgstr "" + #: regedit.rc:34 msgid "&Registry" msgstr "" diff --git a/po/th.po b/po/th.po index 739d87de486..da8e411db56 100644 --- a/po/th.po +++ b/po/th.po @@ -11823,6 +11823,16 @@ msgstr "" msgid "REG IMPORT file.reg\n" msgstr "" +#: reg.rc:67 +#, fuzzy +msgid "reg: The file '%1' was not found.\n" +msgstr "ไม่พบแฟ้ม.\n" + +#: reg.rc:68 +#, fuzzy +msgid "reg: Unable to open the registry key '%1'.\n" +msgstr "แฟ้มตํารา (*.txt).\n" + #: regedit.rc:34 msgid "&Registry" msgstr "" diff --git a/po/tr.po b/po/tr.po index 1a89068ccb4..8e161f3e06b 100644 --- a/po/tr.po +++ b/po/tr.po @@ -12157,6 +12157,18 @@ msgstr "(değer belirlenmemiş)" msgid "REG IMPORT file.reg\n" msgstr "" +#: reg.rc:67 +#, fuzzy +#| msgid "regedit: The file '%1' was not found.\n" +msgid "reg: The file '%1' was not found.\n" +msgstr "regedit: '%1' dosyası bulunamadı.\n" + +#: reg.rc:68 +#, fuzzy +#| msgid "regedit: Unable to open the registry key '%1'.\n" +msgid "reg: Unable to open the registry key '%1'.\n" +msgstr "regedit: '%1' kayıt anahtarı açılamıyor.\n" + #: regedit.rc:34 msgid "&Registry" msgstr "&Kayıt Defteri" diff --git a/po/uk.po b/po/uk.po index e79d778511c..d4c7a0908b3 100644 --- a/po/uk.po +++ b/po/uk.po @@ -12234,6 +12234,18 @@ msgstr "(значення не задане)" msgid "REG IMPORT file.reg\n" msgstr "" +#: reg.rc:67 +#, fuzzy +#| msgid "regedit: The file '%1' was not found.\n" +msgid "reg: The file '%1' was not found.\n" +msgstr "regedit: Файл '%1' не знайдено.\n" + +#: reg.rc:68 +#, fuzzy +#| msgid "regedit: Unable to open the registry key '%1'.\n" +msgid "reg: Unable to open the registry key '%1'.\n" +msgstr "regedit: Неможливо відкрити ключ '%1'.\n" + #: regedit.rc:34 msgid "&Registry" msgstr "&Реєстр" diff --git a/po/wa.po b/po/wa.po index da030dde2e4..0ffdf46d6dd 100644 --- a/po/wa.po +++ b/po/wa.po @@ -11727,6 +11727,15 @@ msgstr "" msgid "REG IMPORT file.reg\n" msgstr "" +#: reg.rc:67 +msgid "reg: The file '%1' was not found.\n" +msgstr "" + +#: reg.rc:68 +#, fuzzy +msgid "reg: Unable to open the registry key '%1'.\n" +msgstr "Fitchîs tekse (*.txt).\n" + #: regedit.rc:34 msgid "&Registry" msgstr "" diff --git a/po/wine.pot b/po/wine.pot index 49852bea930..32a5527a00e 100644 --- a/po/wine.pot +++ b/po/wine.pot @@ -11506,6 +11506,14 @@ msgstr "" msgid "REG IMPORT file.reg\n" msgstr "" +#: reg.rc:67 +msgid "reg: The file '%1' was not found.\n" +msgstr "" + +#: reg.rc:68 +msgid "reg: Unable to open the registry key '%1'.\n" +msgstr "" + #: regedit.rc:34 msgid "&Registry" msgstr "" diff --git a/po/zh_CN.po b/po/zh_CN.po index 91ba3ed517b..953cef49057 100644 --- a/po/zh_CN.po +++ b/po/zh_CN.po @@ -11925,6 +11925,18 @@ msgstr "(没有设值)" msgid "REG IMPORT file.reg\n" msgstr "" +#: reg.rc:67 +#, fuzzy +#| msgid "regedit: The file '%1' was not found.\n" +msgid "reg: The file '%1' was not found.\n" +msgstr "regedit: 找不到文件 '%1'。\n" + +#: reg.rc:68 +#, fuzzy +#| msgid "regedit: Unable to open the registry key '%1'.\n" +msgid "reg: Unable to open the registry key '%1'.\n" +msgstr "regedit: 无法打开注册表键 '%1'。\n" + #: regedit.rc:34 msgid "&Registry" msgstr "注册表(&R)" diff --git a/po/zh_TW.po b/po/zh_TW.po index a054c1b5d41..03eeeed31c3 100644 --- a/po/zh_TW.po +++ b/po/zh_TW.po @@ -12364,6 +12364,18 @@ msgstr "(沒有設值)" msgid "REG IMPORT file.reg\n" msgstr "" +#: reg.rc:67 +#, fuzzy +#| msgid "No command was specified." +msgid "reg: The file '%1' was not found.\n" +msgstr "沒有任何命令被指定。" + +#: reg.rc:68 +#, fuzzy +#| msgid "Error: Unable to add keys to remote machine\n" +msgid "reg: Unable to open the registry key '%1'.\n" +msgstr "錯誤:無法加入索引鍵到遠端機器\n" + #: regedit.rc:34 msgid "&Registry" msgstr "註冊表(&R)" diff --git a/programs/reg/import.c b/programs/reg/import.c index 734e6ae94c8..ea070ef03d4 100644 --- a/programs/reg/import.c +++ b/programs/reg/import.c @@ -17,14 +17,420 @@ */ #include +#include + +#include #include #include "reg.h" WINE_DEFAULT_DEBUG_CHANNEL(reg); +static WCHAR *GetWideString(const char *strA) +{ + if (strA) + { + WCHAR *strW; + int len = MultiByteToWideChar(CP_ACP, 0, strA, -1, NULL, 0); + + strW = heap_xalloc(len * sizeof(WCHAR)); + MultiByteToWideChar(CP_ACP, 0, strA, -1, strW, len); + return strW; + } + return NULL; +} + +static WCHAR *(*get_line)(FILE *); + +/* parser definitions */ +enum parser_state +{ + HEADER, /* parsing the registry file version header */ + PARSE_WIN31_LINE, /* parsing a Windows 3.1 registry line */ + SET_VALUE, /* adding a value to the registry */ + NB_PARSER_STATES +}; + +struct parser +{ + FILE *file; /* pointer to a registry file */ + 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 */ + DWORD data_size; /* size of the data (in bytes) */ + enum parser_state state; /* current parser state */ +}; + +typedef WCHAR *(*parser_state_func)(struct parser *parser, WCHAR *pos); + +/* parser state machine functions */ +static WCHAR *header_state(struct parser *parser, WCHAR *pos); +static WCHAR *parse_win31_line_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] = +{ + header_state, /* HEADER */ + parse_win31_line_state, /* PARSE_WIN31_LINE */ + set_value_state, /* SET_VALUE */ +}; + +/* set the new parser state and return the previous one */ +static inline enum parser_state set_state(struct parser *parser, enum parser_state state) +{ + enum parser_state ret = parser->state; + parser->state = state; + return ret; +} + +static HKEY parse_key_name(WCHAR *key_name, WCHAR **key_path) +{ + if (!key_name) return 0; + + *key_path = strchrW(key_name, '\\'); + if (*key_path) (*key_path)++; + + return path_get_rootkey(key_name); +} + +static void close_key(struct parser *parser) +{ + if (parser->hkey) + { + heap_free(parser->key_name); + parser->key_name = NULL; + + RegCloseKey(parser->hkey); + parser->hkey = NULL; + } +} + +static LONG open_key(struct parser *parser, WCHAR *path) +{ + HKEY key_class; + WCHAR *key_path; + LONG res; + + close_key(parser); + + /* Get the registry class */ + 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, &parser->hkey, NULL); + + if (res == ERROR_SUCCESS) + { + parser->key_name = heap_xalloc((lstrlenW(path) + 1) * sizeof(WCHAR)); + lstrcpyW(parser->key_name, path); + } + else + parser->hkey = NULL; + + return res; +} + +static void free_parser_data(struct parser *parser) +{ + parser->data = NULL; + parser->data_size = 0; +} + +enum reg_versions { + REG_VERSION_31, + REG_VERSION_40, + REG_VERSION_50, + REG_VERSION_FUZZY, + REG_VERSION_INVALID +}; + +static enum reg_versions parse_file_header(const WCHAR *s) +{ + static const WCHAR header_31[] = {'R','E','G','E','D','I','T',0}; + static const WCHAR header_40[] = {'R','E','G','E','D','I','T','4',0}; + static const WCHAR header_50[] = {'W','i','n','d','o','w','s',' ', + 'R','e','g','i','s','t','r','y',' ','E','d','i','t','o','r',' ', + 'V','e','r','s','i','o','n',' ','5','.','0','0',0}; + + while (*s == ' ' || *s == '\t') s++; + + if (!strcmpW(s, header_31)) + return REG_VERSION_31; + + if (!strcmpW(s, header_40)) + return REG_VERSION_40; + + if (!strcmpW(s, header_50)) + return REG_VERSION_50; + + /* The Windows version accepts registry file headers beginning with "REGEDIT" and ending + * with other characters, as long as "REGEDIT" appears at the start of the line. For example, + * "REGEDIT 4", "REGEDIT9" and "REGEDIT4FOO" are all treated as valid file headers. + * In all such cases, however, the contents of the registry file are not imported. + */ + if (!strncmpW(s, header_31, 7)) /* "REGEDIT" without NUL */ + return REG_VERSION_FUZZY; + + return REG_VERSION_INVALID; +} + +/* handler for parser HEADER state */ +static WCHAR *header_state(struct parser *parser, WCHAR *pos) +{ + WCHAR *line, *header; + + if (!(line = get_line(parser->file))) + return NULL; + + if (!parser->is_unicode) + { + header = heap_xalloc((lstrlenW(line) + 3) * sizeof(WCHAR)); + header[0] = parser->two_wchars[0]; + header[1] = parser->two_wchars[1]; + lstrcpyW(header + 2, line); + parser->reg_version = parse_file_header(header); + heap_free(header); + } + else parser->reg_version = parse_file_header(line); + + switch (parser->reg_version) + { + case REG_VERSION_31: + set_state(parser, PARSE_WIN31_LINE); + break; + case REG_VERSION_40: + case REG_VERSION_50: + default: + get_line(NULL); /* Reset static variables */ + return NULL; + } + + return line; +} + +/* handler for parser PARSE_WIN31_LINE state */ +static WCHAR *parse_win31_line_state(struct parser *parser, WCHAR *pos) +{ + WCHAR *line, *value; + static WCHAR hkcr[] = {'H','K','E','Y','_','C','L','A','S','S','E','S','_','R','O','O','T'}; + unsigned int key_end = 0; + + if (!(line = get_line(parser->file))) + return NULL; + + if (strncmpW(line, hkcr, ARRAY_SIZE(hkcr))) + return line; + + /* get key name */ + while (line[key_end] && !isspaceW(line[key_end])) key_end++; + + value = line + key_end; + while (*value == ' ' || *value == '\t') value++; + + if (*value == '=') value++; + if (*value == ' ') value++; /* at most one space is skipped */ + + line[key_end] = 0; + + if (open_key(parser, line) != ERROR_SUCCESS) + { + output_message(STRING_OPEN_KEY_FAILED, line); + return line; + } + + parser->value_name = NULL; + parser->data_type = REG_SZ; + parser->data = value; + parser->data_size = (lstrlenW(value) + 1) * sizeof(WCHAR); + + set_state(parser, SET_VALUE); + return value; +} + +/* handler for parser SET_VALUE state */ +static WCHAR *set_value_state(struct parser *parser, WCHAR *pos) +{ + RegSetValueExW(parser->hkey, parser->value_name, 0, parser->data_type, + parser->data, parser->data_size); + + free_parser_data(parser); + + set_state(parser, PARSE_WIN31_LINE); + + return pos; +} + +#define REG_VAL_BUF_SIZE 4096 + +static WCHAR *get_lineA(FILE *fp) +{ + static WCHAR *lineW; + static size_t size; + static char *buf, *next; + char *line; + + heap_free(lineW); + + if (!fp) goto cleanup; + + if (!size) + { + size = REG_VAL_BUF_SIZE; + buf = heap_xalloc(size); + *buf = 0; + next = buf; + } + line = next; + + while (next) + { + char *p = strpbrk(line, "\r\n"); + if (!p) + { + size_t len, count; + len = strlen(next); + memmove(buf, next, len + 1); + if (size - len < 3) + { + size *= 2; + buf = heap_xrealloc(buf, size); + } + if (!(count = fread(buf + len, 1, size - len - 1, fp))) + { + next = NULL; + lineW = GetWideString(buf); + return lineW; + } + buf[len + count] = 0; + next = buf; + line = buf; + continue; + } + next = p + 1; + if (*p == '\r' && *(p + 1) == '\n') next++; + *p = 0; + lineW = GetWideString(line); + return lineW; + } + +cleanup: + lineW = NULL; + if (size) heap_free(buf); + size = 0; + return NULL; +} + +static WCHAR *get_lineW(FILE *fp) +{ + static size_t size; + static WCHAR *buf, *next; + WCHAR *line; + + if (!fp) goto cleanup; + + if (!size) + { + size = REG_VAL_BUF_SIZE; + buf = heap_xalloc(size * sizeof(WCHAR)); + *buf = 0; + next = buf; + } + line = next; + + while (next) + { + static const WCHAR line_endings[] = {'\r','\n',0}; + WCHAR *p = strpbrkW(line, line_endings); + if (!p) + { + size_t len, count; + len = strlenW(next); + memmove(buf, next, (len + 1) * sizeof(WCHAR)); + if (size - len < 3) + { + size *= 2; + buf = heap_xrealloc(buf, size * sizeof(WCHAR)); + } + if (!(count = fread(buf + len, sizeof(WCHAR), size - len - 1, fp))) + { + next = NULL; + return buf; + } + buf[len + count] = 0; + next = buf; + line = buf; + continue; + } + next = p + 1; + if (*p == '\r' && *(p + 1) == '\n') next++; + *p = 0; + return line; + } + +cleanup: + if (size) heap_free(buf); + size = 0; + return NULL; +} + int reg_import(const WCHAR *filename) { - FIXME(": operation not yet implemented\n"); + FILE *fp; + static const WCHAR rb_mode[] = {'r','b',0}; + BYTE s[2]; + struct parser parser; + WCHAR *pos; + + fp = _wfopen(filename, rb_mode); + if (!fp) + { + output_message(STRING_FILE_NOT_FOUND, filename); + return 1; + } + + if (fread(s, sizeof(WCHAR), 1, fp) != 1) + goto error; + + parser.is_unicode = (s[0] == 0xff && s[1] == 0xfe); + get_line = parser.is_unicode ? get_lineW : get_lineA; + + parser.file = fp; + parser.two_wchars[0] = s[0]; + parser.two_wchars[1] = s[1]; + parser.reg_version = -1; + parser.hkey = NULL; + parser.key_name = NULL; + parser.data_type = 0; + parser.data = NULL; + parser.data_size = 0; + parser.state = HEADER; + + pos = parser.two_wchars; + + /* parser main loop */ + while (pos) + pos = (parser_funcs[parser.state])(&parser, pos); + + if (parser.reg_version == REG_VERSION_INVALID) + goto error; + else if (parser.reg_version == REG_VERSION_40 || parser.reg_version == REG_VERSION_50) + { + FIXME(": operation not yet implemented\n"); + goto error; + } + + close_key(&parser); + + fclose(fp); + return 0; + +error: + fclose(fp); return 1; } diff --git a/programs/reg/reg.c b/programs/reg/reg.c index 43e5321704c..fac3d22ea13 100644 --- a/programs/reg/reg.c +++ b/programs/reg/reg.c @@ -23,8 +23,6 @@ #include #include "reg.h" -#define ARRAY_SIZE(A) (sizeof(A)/sizeof(*A)) - WINE_DEFAULT_DEBUG_CHANNEL(reg); static const WCHAR short_hklm[] = {'H','K','L','M',0}; @@ -79,7 +77,7 @@ type_rels[] = {REG_MULTI_SZ, type_multi_sz}, }; -static void *heap_xalloc(size_t size) +void *heap_xalloc(size_t size) { void *buf = HeapAlloc(GetProcessHeap(), 0, size); if (!buf) @@ -90,7 +88,7 @@ static void *heap_xalloc(size_t size) return buf; } -static void *heap_xrealloc(void *buf, size_t size) +void *heap_xrealloc(void *buf, size_t size) { void *new_buf; @@ -108,7 +106,7 @@ static void *heap_xrealloc(void *buf, size_t size) return new_buf; } -static BOOL heap_free(void *buf) +BOOL heap_free(void *buf) { return HeapFree(GetProcessHeap(), 0, buf); } @@ -153,7 +151,7 @@ static void output_formatstring(const WCHAR *fmt, __ms_va_list va_args) LocalFree(str); } -static void __cdecl output_message(unsigned int id, ...) +void __cdecl output_message(unsigned int id, ...) { WCHAR fmt[1024]; __ms_va_list va_args; @@ -216,7 +214,7 @@ static inline BOOL path_rootname_cmp(const WCHAR *input_path, const WCHAR *rootk (input_path[length] == 0 || input_path[length] == '\\')); } -static HKEY path_get_rootkey(const WCHAR *path) +HKEY path_get_rootkey(const WCHAR *path) { DWORD i; diff --git a/programs/reg/reg.h b/programs/reg/reg.h index 1fbef7806c4..14c05b13d49 100644 --- a/programs/reg/reg.h +++ b/programs/reg/reg.h @@ -21,6 +21,16 @@ #include "resource.h" +#define ARRAY_SIZE(A) (sizeof(A)/sizeof(*A)) + +/* reg.c */ +void *heap_xalloc(size_t size); +void *heap_xrealloc(void *buf, size_t size); +BOOL heap_free(void *buf); +void __cdecl output_message(unsigned int id, ...); +HKEY path_get_rootkey(const WCHAR *path); + +/* import.c */ int reg_import(const WCHAR *filename); #endif /* __REG_H__ */ diff --git a/programs/reg/reg.rc b/programs/reg/reg.rc index e26970916fe..6d4ccb593fa 100644 --- a/programs/reg/reg.rc +++ b/programs/reg/reg.rc @@ -63,4 +63,6 @@ STRINGTABLE STRING_FUNC_HELP, "Type \"REG %1 /?\" for help.\n" STRING_VALUE_NOT_SET, "(value not set)" STRING_IMPORT_USAGE, "REG IMPORT file.reg\n" + STRING_FILE_NOT_FOUND, "reg: The file '%1' was not found.\n" + STRING_OPEN_KEY_FAILED, "reg: Unable to open the registry key '%1'.\n" } diff --git a/programs/reg/resource.h b/programs/reg/resource.h index 31a83ee1154..653a9d1e604 100644 --- a/programs/reg/resource.h +++ b/programs/reg/resource.h @@ -53,3 +53,5 @@ #define STRING_FUNC_HELP 130 #define STRING_VALUE_NOT_SET 131 #define STRING_IMPORT_USAGE 132 +#define STRING_FILE_NOT_FOUND 133 +#define STRING_OPEN_KEY_FAILED 134 diff --git a/programs/reg/tests/reg.c b/programs/reg/tests/reg.c index 69c01c00b91..2a6f35165ed 100644 --- a/programs/reg/tests/reg.c +++ b/programs/reg/tests/reg.c @@ -847,10 +847,10 @@ static void test_import(void) "got exit code %d, expected 1\n", r); test_import_str("REGEDIT", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); test_import_str("REGEDIT\n", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); test_import_str("REGEDIT4\n", &r); todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); @@ -874,19 +874,19 @@ static void test_import(void) "got exit code %d, expected 1\n", r); test_import_str("REGEDIT3\n", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); test_import_str("REGEDIT5\n", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); test_import_str("REGEDIT9\n", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); test_import_str("REGEDIT 4\n", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); test_import_str("REGEDIT4 FOO\n", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); test_import_str("REGEDIT4\n" "[HKEY_CURRENT_USER\\" KEY_BASE "]\n", &r); @@ -898,7 +898,7 @@ static void test_import(void) test_import_str("REGEDIT3\n\n" "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" "\"Test1\"=\"Value\"\n", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); todo_wine verify_reg_nonexist(hkey, "Test1"); test_import_str("regedit4\n\n" @@ -918,31 +918,31 @@ static void test_import(void) test_import_str("REGEDIT 4\n\n" "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" "\"Test4\"=\"Value\"\n", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); todo_wine verify_reg_nonexist(hkey, "Test4"); test_import_str("REGEDIT4FOO\n\n" "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" "\"Test5\"=\"Value\"\n", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); todo_wine verify_reg_nonexist(hkey, "Test5"); test_import_str("REGEDIT4 FOO\n\n" "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" "\"Test6\"=\"Value\"\n", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); todo_wine verify_reg_nonexist(hkey, "Test6"); test_import_str("REGEDIT5\n\n" "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" "\"Test7\"=\"Value\"\n", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); todo_wine verify_reg_nonexist(hkey, "Test7"); test_import_str("REGEDIT9\n\n" "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" "\"Test8\"=\"Value\"\n", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); todo_wine verify_reg_nonexist(hkey, "Test8"); test_import_str("Windows Registry Editor Version 4.00\n\n" @@ -2304,10 +2304,10 @@ static void test_unicode_import(void) "got exit code %d, expected 1\n", r); test_import_wstr("\xef\xbb\xbfREGEDIT", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); test_import_wstr("\xef\xbb\xbfREGEDIT\n", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); test_import_wstr("\xef\xbb\xbfREGEDIT4", &r); todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); @@ -2335,7 +2335,7 @@ static void test_unicode_import(void) test_import_wstr("\xef\xbb\xbfREGEDIT3\n\n" "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" "\"Test1\"=\"Value\"\n", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); todo_wine verify_reg_nonexist(hkey, "Test1"); test_import_wstr("\xef\xbb\xbfregedit4\n\n" @@ -2355,31 +2355,31 @@ static void test_unicode_import(void) test_import_wstr("\xef\xbb\xbfREGEDIT 4\n\n" "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" "\"Test4\"=\"Value\"\n", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); todo_wine verify_reg_nonexist(hkey, "Test4"); test_import_wstr("\xef\xbb\xbfREGEDIT4FOO\n\n" "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" "\"Test5\"=\"Value\"\n", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); todo_wine verify_reg_nonexist(hkey, "Test5"); test_import_wstr("\xef\xbb\xbfREGEDIT4 FOO\n\n" "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" "\"Test6\"=\"Value\"\n", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); todo_wine verify_reg_nonexist(hkey, "Test6"); test_import_wstr("\xef\xbb\xbfREGEDIT5\n\n" "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" "\"Test7\"=\"Value\"\n", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); todo_wine verify_reg_nonexist(hkey, "Test7"); test_import_wstr("\xef\xbb\xbfREGEDIT9\n\n" "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" "\"Test8\"=\"Value\"\n", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); todo_wine verify_reg_nonexist(hkey, "Test8"); test_import_wstr("\xef\xbb\xbfREGEDIT4\n" @@ -4074,94 +4074,94 @@ static void test_import_31(void) /* Test simple value */ test_import_str("REGEDIT\r\n" - "HKEY_CLASSES_ROOT\\" KEY_BASE " = Value0\r\n", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - todo_wine verify_reg(hkey, "", REG_SZ, "Value0", 7, 0); + "HKEY_CLASSES_ROOT\\" KEY_BASE " = Value0\r\n", &r); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + verify_reg(hkey, "", REG_SZ, "Value0", 7, 0); /* Test proper handling of spaces and equals signs */ test_import_str("REGEDIT\r\n" "HKEY_CLASSES_ROOT\\" KEY_BASE " =Value1\r\n", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - todo_wine verify_reg(hkey, "", REG_SZ, "Value1", 7, 0); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + verify_reg(hkey, "", REG_SZ, "Value1", 7, 0); test_import_str("REGEDIT\r\n" "HKEY_CLASSES_ROOT\\" KEY_BASE " = Value2\r\n", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - todo_wine verify_reg(hkey, "", REG_SZ, " Value2", 8, 0); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + verify_reg(hkey, "", REG_SZ, " Value2", 8, 0); test_import_str("REGEDIT\r\n" "HKEY_CLASSES_ROOT\\" KEY_BASE " = Value3 \r\n", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - todo_wine verify_reg(hkey, "", REG_SZ, "Value3 ", 8, 0); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + verify_reg(hkey, "", REG_SZ, "Value3 ", 8, 0); test_import_str("REGEDIT\r\n" "HKEY_CLASSES_ROOT\\" KEY_BASE " Value4\r\n", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - todo_wine verify_reg(hkey, "", REG_SZ, "Value4", 7, 0); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + verify_reg(hkey, "", REG_SZ, "Value4", 7, 0); test_import_str("REGEDIT\r\n" "HKEY_CLASSES_ROOT\\" KEY_BASE " Value5\r\n", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - todo_wine verify_reg(hkey, "", REG_SZ, "Value5", 7, 0); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + verify_reg(hkey, "", REG_SZ, "Value5", 7, 0); test_import_str("REGEDIT\r\n" "HKEY_CLASSES_ROOT\\" KEY_BASE "\r\n", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - todo_wine verify_reg(hkey, "", REG_SZ, "", 1, 0); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + verify_reg(hkey, "", REG_SZ, "", 1, 0); test_import_str("REGEDIT\r\n" "HKEY_CLASSES_ROOT\\" KEY_BASE " \r\n", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - todo_wine verify_reg(hkey, "", REG_SZ, "", 1, 0); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + verify_reg(hkey, "", REG_SZ, "", 1, 0); test_import_str("REGEDIT\r\n" "HKEY_CLASSES_ROOT\\" KEY_BASE " = No newline", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - todo_wine verify_reg(hkey, "", REG_SZ, "No newline", 11, 0); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + verify_reg(hkey, "", REG_SZ, "No newline", 11, 0); err = RegDeleteValueW(hkey, NULL); - todo_wine ok(err == ERROR_SUCCESS, "RegDeleteValue failed: %d\n", err); + ok(err == ERROR_SUCCESS, "RegDeleteValue failed: %d\n", err); /* Test character validity at the start of the line */ test_import_str("REGEDIT\r\n" " HKEY_CLASSES_ROOT\\" KEY_BASE " = Value1a\r\n", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); verify_reg_nonexist(hkey, ""); test_import_str("REGEDIT\r\n" " HKEY_CLASSES_ROOT\\" KEY_BASE " = Value1b\r\n", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); verify_reg_nonexist(hkey, ""); test_import_str("REGEDIT\r\n" "\tHKEY_CLASSES_ROOT\\" KEY_BASE " = Value1c\r\n", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); verify_reg_nonexist(hkey, ""); test_import_str("REGEDIT\r\n" ";HKEY_CLASSES_ROOT\\" KEY_BASE " = Value2a\r\n", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); verify_reg_nonexist(hkey, ""); test_import_str("REGEDIT\r\n" "#HKEY_CLASSES_ROOT\\" KEY_BASE " = Value2b\r\n", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); verify_reg_nonexist(hkey, ""); /* Test case sensitivity */ test_import_str("REGEDIT\r\n" "hkey_classes_root\\" KEY_BASE " = Value3a\r\n", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); verify_reg_nonexist(hkey, ""); test_import_str("REGEDIT\r\n" "hKEY_CLASSES_ROOT\\" KEY_BASE " = Value3b\r\n", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); verify_reg_nonexist(hkey, ""); test_import_str("REGEDIT\r\n" "Hkey_Classes_Root\\" KEY_BASE " = Value3c\r\n", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); verify_reg_nonexist(hkey, ""); RegCloseKey(hkey); -- 2.11.4.GIT