reg: Add wchar/type conversion functions.

oldstable
Jonathan Vollebregt 2015-02-19 13:19:12 +01:00 committed by Alexandre Julliard
parent 513505d6c4
commit 0898bd22bf
49 changed files with 291 additions and 22 deletions

View File

@ -11532,6 +11532,12 @@ msgid ""
"Error: The system was unable to find the specified registry key or value\n"
msgstr "خطأ : فشل النظام في العثور على المفتاح أو القيمة المحددة\n"
#: reg.rc:39
#, fuzzy
#| msgid "Unsupported type.\n"
msgid "Error: Unsupported type\n"
msgstr "النوع غير مدعوم.\n"
#: regedit.rc:34
msgid "&Registry"
msgstr "ال&سجل"

View File

@ -11355,6 +11355,10 @@ msgid ""
"Error: The system was unable to find the specified registry key or value\n"
msgstr ""
#: reg.rc:39
msgid "Error: Unsupported type\n"
msgstr ""
#: regedit.rc:34
msgid "&Registry"
msgstr "&Регистър"

View File

@ -11759,6 +11759,12 @@ msgstr ""
"Error: El sistema no ha pogut trobar la clau o valor de registre "
"especificada\n"
#: reg.rc:39
#, fuzzy
#| msgid "Unsupported type.\n"
msgid "Error: Unsupported type\n"
msgstr "Tipus incompatible.\n"
#: regedit.rc:34
msgid "&Registry"
msgstr "&Registre"

View File

@ -11408,6 +11408,12 @@ msgid ""
"Error: The system was unable to find the specified registry key or value\n"
msgstr "Chyba: Systém nemohl najít specifikovaný klíč registru nebo hodnotu\n"
#: reg.rc:39
#, fuzzy
#| msgid "Unsupported type.\n"
msgid "Error: Unsupported type\n"
msgstr "Nepodporovaný typ.\n"
#: regedit.rc:34
msgid "&Registry"
msgstr "&Registr"

View File

@ -11667,6 +11667,12 @@ msgstr ""
"Fejl: Systemet kunne ikke finde, den angivet registrerings nøgle eller "
"værdi\n"
#: reg.rc:39
#, fuzzy
#| msgid "Unsupported type.\n"
msgid "Error: Unsupported type\n"
msgstr "Ikke-understøttet type.\n"
#: regedit.rc:34
msgid "&Registry"
msgstr "&Register"

View File

@ -11588,6 +11588,12 @@ msgid ""
msgstr ""
"Fehler: Der angegebene Schlüssel oder Wert konnte nicht gefunden werden\n"
#: reg.rc:39
#, fuzzy
#| msgid "Unsupported type.\n"
msgid "Error: Unsupported type\n"
msgstr "Nicht unterstützter Typ.\n"
#: regedit.rc:34
msgid "&Registry"
msgstr "&Registry"

View File

@ -11149,6 +11149,11 @@ msgid ""
"Error: The system was unable to find the specified registry key or value\n"
msgstr ""
#: reg.rc:39
#, fuzzy
msgid "Error: Unsupported type\n"
msgstr "Επιλογές.\n"
#: regedit.rc:34
msgid "&Registry"
msgstr ""

View File

@ -11509,6 +11509,10 @@ msgid ""
msgstr ""
"Error: The system was unable to find the specified registry key or value\n"
#: reg.rc:39
msgid "Error: Unsupported type\n"
msgstr "Error: Unsupported type\n"
#: regedit.rc:34
msgid "&Registry"
msgstr "&Registry"

View File

@ -11509,6 +11509,10 @@ msgid ""
msgstr ""
"Error: The system was unable to find the specified registry key or value\n"
#: reg.rc:39
msgid "Error: Unsupported type\n"
msgstr "Error: Unsupported type\n"
#: regedit.rc:34
msgid "&Registry"
msgstr "&Registry"

View File

@ -11041,6 +11041,10 @@ msgid ""
"Error: The system was unable to find the specified registry key or value\n"
msgstr ""
#: reg.rc:39
msgid "Error: Unsupported type\n"
msgstr ""
#: regedit.rc:34
msgid "&Registry"
msgstr "&Registrejo"

View File

@ -11747,6 +11747,12 @@ msgstr ""
"Error: El sistema no pudo encontrar la clave o el valor del Registro "
"especificado\n"
#: reg.rc:39
#, fuzzy
#| msgid "Unsupported type.\n"
msgid "Error: Unsupported type\n"
msgstr "Tipo no soportado.\n"
#: regedit.rc:34
msgid "&Registry"
msgstr "&Registro"

View File

@ -11148,6 +11148,10 @@ msgid ""
"Error: The system was unable to find the specified registry key or value\n"
msgstr ""
#: reg.rc:39
msgid "Error: Unsupported type\n"
msgstr ""
#: regedit.rc:34
msgid "&Registry"
msgstr ""

View File

@ -11496,6 +11496,12 @@ msgid ""
"Error: The system was unable to find the specified registry key or value\n"
msgstr "Virhe: järjestelmä ei löytänyt annettua rekisteriavainta tai -arvoa\n"
#: reg.rc:39
#, fuzzy
#| msgid "Unsupported type.\n"
msgid "Error: Unsupported type\n"
msgstr "Tyyppiä ei tueta.\n"
#: regedit.rc:34
msgid "&Registry"
msgstr "&Rekisteri"

View File

@ -11654,6 +11654,12 @@ msgstr ""
"Erreur : le système n'a pas pu trouver la clé ou la valeur de registre "
"spécifiée\n"
#: reg.rc:39
#, fuzzy
#| msgid "Unsupported type.\n"
msgid "Error: Unsupported type\n"
msgstr "Type non pris en charge.\n"
#: regedit.rc:34
msgid "&Registry"
msgstr "&Registre"

View File

@ -11727,6 +11727,12 @@ msgid ""
msgstr ""
"Error: The system was unable to find the specified registry key or value\n"
#: reg.rc:39
#, fuzzy
#| msgid "Error: Command line not supported\n"
msgid "Error: Unsupported type\n"
msgstr "Error: Command line not supported\n"
#: regedit.rc:34
msgid "&Registry"
msgstr "&רישום המערכת"

View File

@ -10961,6 +10961,10 @@ msgid ""
"Error: The system was unable to find the specified registry key or value\n"
msgstr ""
#: reg.rc:39
msgid "Error: Unsupported type\n"
msgstr ""
#: regedit.rc:34
msgid "&Registry"
msgstr ""

View File

@ -11227,6 +11227,12 @@ msgid ""
msgstr ""
"Greška: Sustav nije mogao pronaći navedeni ključ ili vrijednost u registru.\n"
#: reg.rc:39
#, fuzzy
#| msgid "Unsupported type.\n"
msgid "Error: Unsupported type\n"
msgstr "Nepodržan tip.\n"
#: regedit.rc:34
msgid "&Registry"
msgstr "&Registar"

View File

@ -11670,6 +11670,12 @@ msgid ""
msgstr ""
"Hiba: A rendszer nem találta a megadott regisztrációs kulcsot vagy értéket\n"
#: reg.rc:39
#, fuzzy
#| msgid "Unsupported type.\n"
msgid "Error: Unsupported type\n"
msgstr "Nem támogatott típus.\n"
#: regedit.rc:34
msgid "&Registry"
msgstr "&Fájl"

View File

@ -11748,6 +11748,12 @@ msgstr ""
"Errore: il sistema non è riuscito a trovare la chiave di registro o il "
"valore specificati\n"
#: reg.rc:39
#, fuzzy
#| msgid "Unsupported type.\n"
msgid "Error: Unsupported type\n"
msgstr "Tipo non supportato.\n"
#: regedit.rc:34
msgid "&Registry"
msgstr "&Registro"

View File

@ -11502,6 +11502,12 @@ msgid ""
"Error: The system was unable to find the specified registry key or value\n"
msgstr "エラー: システムは指定されたキーまたは値を見つけられませんでした\n"
#: reg.rc:39
#, fuzzy
#| msgid "Unsupported type.\n"
msgid "Error: Unsupported type\n"
msgstr "サポートされていない種類です。\n"
#: regedit.rc:34
msgid "&Registry"
msgstr "レジストリ(&R)"

View File

@ -11556,6 +11556,12 @@ msgid ""
"Error: The system was unable to find the specified registry key or value\n"
msgstr "오류: 이 시스템에서 지정된 레지스트리 키나 값을 찾을수 없습니다\n"
#: reg.rc:39
#, fuzzy
#| msgid "Unsupported type.\n"
msgid "Error: Unsupported type\n"
msgstr "지원하지 않는 형식.\n"
#: regedit.rc:34
msgid "&Registry"
msgstr "레지스트리(&R)"

View File

@ -11517,6 +11517,12 @@ msgid ""
"Error: The system was unable to find the specified registry key or value\n"
msgstr "Klaida: Sistemai nepavyko rasti nurodyto registro rakto ar reikšmės\n"
#: reg.rc:39
#, fuzzy
#| msgid "Unsupported type.\n"
msgid "Error: Unsupported type\n"
msgstr "Nepalaikomas tipas.\n"
#: regedit.rc:34
msgid "&Registry"
msgstr "R&egistras"

View File

@ -10961,6 +10961,10 @@ msgid ""
"Error: The system was unable to find the specified registry key or value\n"
msgstr ""
#: reg.rc:39
msgid "Error: Unsupported type\n"
msgstr ""
#: regedit.rc:34
msgid "&Registry"
msgstr ""

View File

@ -11573,6 +11573,12 @@ msgstr ""
"Feil: Systemet klarte ikke finne den angitte registernøkkelen eller -"
"verdien\n"
#: reg.rc:39
#, fuzzy
#| msgid "Unsupported type.\n"
msgid "Error: Unsupported type\n"
msgstr "Typen støttes ikke.\n"
#: regedit.rc:34
msgid "&Registry"
msgstr "&Register"

View File

@ -11714,6 +11714,12 @@ msgstr ""
"Fout: Het systeem kon de gespecificeerde registersleutel of waarde niet "
"vinden\n"
#: reg.rc:39
#, fuzzy
#| msgid "Unsupported type.\n"
msgid "Error: Unsupported type\n"
msgstr "Niet-ondersteund type.\n"
#: regedit.rc:34
msgid "&Registry"
msgstr "&Registerbestand"

View File

@ -10961,6 +10961,10 @@ msgid ""
"Error: The system was unable to find the specified registry key or value\n"
msgstr ""
#: reg.rc:39
msgid "Error: Unsupported type\n"
msgstr ""
#: regedit.rc:34
msgid "&Registry"
msgstr ""

View File

@ -10961,6 +10961,10 @@ msgid ""
"Error: The system was unable to find the specified registry key or value\n"
msgstr ""
#: reg.rc:39
msgid "Error: Unsupported type\n"
msgstr ""
#: regedit.rc:34
msgid "&Registry"
msgstr ""

View File

@ -11565,6 +11565,12 @@ msgid ""
"Error: The system was unable to find the specified registry key or value\n"
msgstr "Błąd: System nie mógł znaleźć podanej wartości lub klucza rejestru\n"
#: reg.rc:39
#, fuzzy
#| msgid "Unsupported type.\n"
msgid "Error: Unsupported type\n"
msgstr "Niewspierany typ.\n"
#: regedit.rc:34
msgid "&Registry"
msgstr "&Rejestr"

View File

@ -11572,6 +11572,12 @@ msgstr ""
"Erro: O sistema foi incapaz de encontrar a chave de registo ou valor "
"especificado\n"
#: reg.rc:39
#, fuzzy
#| msgid "Unsupported type.\n"
msgid "Error: Unsupported type\n"
msgstr "Tipo não suportado.\n"
#: regedit.rc:34
msgid "&Registry"
msgstr "&Registro"

View File

@ -11541,6 +11541,12 @@ msgstr ""
"Erro: O sistema foi incapaz de encontrar a chave de registo ou valor "
"especificado\n"
#: reg.rc:39
#, fuzzy
#| msgid "Unsupported type.\n"
msgid "Error: Unsupported type\n"
msgstr "Tipo não suportado.\n"
#: regedit.rc:34
msgid "&Registry"
msgstr "&Registo"

View File

@ -11039,6 +11039,10 @@ msgid ""
"Error: The system was unable to find the specified registry key or value\n"
msgstr ""
#: reg.rc:39
msgid "Error: Unsupported type\n"
msgstr ""
#: regedit.rc:34
msgid "&Registry"
msgstr ""

View File

@ -11754,6 +11754,12 @@ msgid ""
msgstr ""
"Eroare: Sistemul nu a putut găsi cheia sau valoarea de registru specificată\n"
#: reg.rc:39
#, fuzzy
#| msgid "Error: Command line not supported\n"
msgid "Error: Unsupported type\n"
msgstr "Eroare: Linie de comandă nesuportată\n"
#: regedit.rc:34
msgid "&Registry"
msgstr "&Registru"

View File

@ -11522,6 +11522,12 @@ msgid ""
"Error: The system was unable to find the specified registry key or value\n"
msgstr "Ошибка: не удалось найти указанный раздел реестра или значение\n"
#: reg.rc:39
#, fuzzy
#| msgid "Unsupported type.\n"
msgid "Error: Unsupported type\n"
msgstr "Неподдерживаемый тип.\n"
#: regedit.rc:34
msgid "&Registry"
msgstr "&Реестр"

View File

@ -11191,6 +11191,12 @@ msgid ""
"Error: The system was unable to find the specified registry key or value\n"
msgstr ""
#: reg.rc:39
#, fuzzy
#| msgid "Unsupported type.\n"
msgid "Error: Unsupported type\n"
msgstr "Nepodporovaný typ.\n"
#: regedit.rc:34
msgid "&Registry"
msgstr "&Registry"

View File

@ -11696,6 +11696,12 @@ msgid ""
"Error: The system was unable to find the specified registry key or value\n"
msgstr "Napaka: sistem ni našel navedenega ključa ali vrednosti registra\n"
#: reg.rc:39
#, fuzzy
#| msgid "Unsupported type.\n"
msgid "Error: Unsupported type\n"
msgstr "Nepodprta vrsta.\n"
#: regedit.rc:34
msgid "&Registry"
msgstr "&Register"

View File

@ -11592,6 +11592,13 @@ msgid ""
"Error: The system was unable to find the specified registry key or value\n"
msgstr ""
#: reg.rc:39
#, fuzzy
#| msgid "Error: Invalid command line parameters\n"
msgid "Error: Unsupported type\n"
msgstr ""
"Грешка: унесени су непознати или неисправни параметри наредбене линије\n"
#: regedit.rc:34
msgid "&Registry"
msgstr ""

View File

@ -11730,6 +11730,13 @@ msgid ""
"Error: The system was unable to find the specified registry key or value\n"
msgstr ""
#: reg.rc:39
#, fuzzy
#| msgid "Error: Invalid command line parameters\n"
msgid "Error: Unsupported type\n"
msgstr ""
"Greška: uneseni su nepoznati ili neispravni parametri naredbene linije\n"
#: regedit.rc:34
msgid "&Registry"
msgstr ""

View File

@ -11463,6 +11463,12 @@ msgid ""
msgstr ""
"Fel: Systemet kunde inte hitta angiven nyckel eller värde i registret\n"
#: reg.rc:39
#, fuzzy
#| msgid "Unsupported type.\n"
msgid "Error: Unsupported type\n"
msgstr "Ej stödd typ.\n"
#: regedit.rc:34
msgid "&Registry"
msgstr "&Register"

View File

@ -10961,6 +10961,10 @@ msgid ""
"Error: The system was unable to find the specified registry key or value\n"
msgstr ""
#: reg.rc:39
msgid "Error: Unsupported type\n"
msgstr ""
#: regedit.rc:34
msgid "&Registry"
msgstr ""

View File

@ -11186,6 +11186,10 @@ msgid ""
"Error: The system was unable to find the specified registry key or value\n"
msgstr ""
#: reg.rc:39
msgid "Error: Unsupported type\n"
msgstr ""
#: regedit.rc:34
msgid "&Registry"
msgstr ""

View File

@ -11522,6 +11522,12 @@ msgid ""
"Error: The system was unable to find the specified registry key or value\n"
msgstr ""
#: reg.rc:39
#, fuzzy
#| msgid "Error: Command line not supported\n"
msgid "Error: Unsupported type\n"
msgstr "Hata: Komut satırı desteklenmiyor\n"
#: regedit.rc:34
msgid "&Registry"
msgstr "&Kayıt"

View File

@ -11604,6 +11604,12 @@ msgid ""
"Error: The system was unable to find the specified registry key or value\n"
msgstr "Помилка: не вдалось знайти вказаний ключ реєстру чи значення\n"
#: reg.rc:39
#, fuzzy
#| msgid "Unsupported type.\n"
msgid "Error: Unsupported type\n"
msgstr "Непідтримуваний тип.\n"
#: regedit.rc:34
msgid "&Registry"
msgstr "&Реєстр"

View File

@ -11091,6 +11091,10 @@ msgid ""
"Error: The system was unable to find the specified registry key or value\n"
msgstr ""
#: reg.rc:39
msgid "Error: Unsupported type\n"
msgstr ""
#: regedit.rc:34
msgid "&Registry"
msgstr ""

View File

@ -10900,6 +10900,10 @@ msgid ""
"Error: The system was unable to find the specified registry key or value\n"
msgstr ""
#: reg.rc:39
msgid "Error: Unsupported type\n"
msgstr ""
#: regedit.rc:34
msgid "&Registry"
msgstr ""

View File

@ -11054,6 +11054,12 @@ msgid ""
"Error: The system was unable to find the specified registry key or value\n"
msgstr "错误:系统无法找到指定的注册表键或值\n"
#: reg.rc:39
#, fuzzy
#| msgid "Error: Command line not supported\n"
msgid "Error: Unsupported type\n"
msgstr "错误:不支持此命令行\n"
#: regedit.rc:34
msgid "&Registry"
msgstr "注册表(&R)"

View File

@ -11441,6 +11441,12 @@ msgid ""
"Error: The system was unable to find the specified registry key or value\n"
msgstr "錯誤:系統無法找到指定的註冊表索引鍵或值\n"
#: reg.rc:39
#, fuzzy
#| msgid "Unsupported type.\n"
msgid "Error: Unsupported type\n"
msgstr "不受支援的型態。\n"
#: regedit.rc:34
msgid "&Registry"
msgstr "註冊表(&R)"

View File

@ -20,6 +20,34 @@
#include <wine/unicode.h>
#include "reg.h"
#define ARRAY_SIZE(A) (sizeof(A)/sizeof(*A))
static const WCHAR type_none[] = {'R','E','G','_','N','O','N','E',0};
static const WCHAR type_sz[] = {'R','E','G','_','S','Z',0};
static const WCHAR type_expand_sz[] = {'R','E','G','_','E','X','P','A','N','D','_','S','Z',0};
static const WCHAR type_binary[] = {'R','E','G','_','B','I','N','A','R','Y',0};
static const WCHAR type_dword[] = {'R','E','G','_','D','W','O','R','D',0};
static const WCHAR type_dword_le[] = {'R','E','G','_','D','W','O','R','D','_','L','I','T','T','L','E','_','E','N','D','I','A','N',0};
static const WCHAR type_dword_be[] = {'R','E','G','_','D','W','O','R','D','_','B','I','G','_','E','N','D','I','A','N',0};
static const WCHAR type_multi_sz[] = {'R','E','G','_','M','U','L','T','I','_','S','Z',0};
static const struct
{
DWORD type;
const WCHAR *name;
}
type_rels[] =
{
{REG_NONE, type_none},
{REG_SZ, type_sz},
{REG_EXPAND_SZ, type_expand_sz},
{REG_BINARY, type_binary},
{REG_DWORD, type_dword},
{REG_DWORD_LITTLE_ENDIAN, type_dword_le},
{REG_DWORD_BIG_ENDIAN, type_dword_be},
{REG_MULTI_SZ, type_multi_sz},
};
static int reg_printfW(const WCHAR *msg, ...)
{
va_list va_args;
@ -114,30 +142,20 @@ static HKEY get_rootkey(LPWSTR key)
else return NULL;
}
static DWORD get_regtype(LPWSTR type)
static DWORD wchar_get_type(const WCHAR *type_name)
{
static const WCHAR szREG_SZ[] = {'R','E','G','_','S','Z',0};
static const WCHAR szREG_MULTI_SZ[] = {'R','E','G','_','M','U','L','T','I','_','S','Z',0};
static const WCHAR szREG_DWORD_BIG_ENDIAN[] = {'R','E','G','_','D','W','O','R','D','_','B','I','G','_','E','N','D','I','A','N',0};
static const WCHAR szREG_DWORD[] = {'R','E','G','_','D','W','O','R','D',0};
static const WCHAR szREG_BINARY[] = {'R','E','G','_','B','I','N','A','R','Y',0};
static const WCHAR szREG_DWORD_LITTLE_ENDIAN[] = {'R','E','G','_','D','W','O','R','D','_','L','I','T','T','L','E','_','E','N','D','I','A','N',0};
static const WCHAR szREG_NONE[] = {'R','E','G','_','N','O','N','E',0};
static const WCHAR szREG_EXPAND_SZ[] = {'R','E','G','_','E','X','P','A','N','D','_','S','Z',0};
DWORD i;
if (!type)
if (!type_name)
return REG_SZ;
if (lstrcmpiW(type,szREG_SZ)==0) return REG_SZ;
if (lstrcmpiW(type,szREG_DWORD)==0) return REG_DWORD;
if (lstrcmpiW(type,szREG_MULTI_SZ)==0) return REG_MULTI_SZ;
if (lstrcmpiW(type,szREG_EXPAND_SZ)==0) return REG_EXPAND_SZ;
if (lstrcmpiW(type,szREG_DWORD_BIG_ENDIAN)==0) return REG_DWORD_BIG_ENDIAN;
if (lstrcmpiW(type,szREG_DWORD_LITTLE_ENDIAN)==0) return REG_DWORD_LITTLE_ENDIAN;
if (lstrcmpiW(type,szREG_BINARY)==0) return REG_BINARY;
if (lstrcmpiW(type,szREG_NONE)==0) return REG_NONE;
for (i = 0; i < ARRAY_SIZE(type_rels); i++)
{
if (!strcmpiW(type_rels[i].name, type_name))
return type_rels[i].type;
}
return -1;
return ~0u;
}
static LPBYTE get_regdata(LPWSTR data, DWORD reg_type, WCHAR separator, DWORD *reg_count)
@ -246,11 +264,11 @@ static int reg_add(WCHAR *key_name, WCHAR *value_name, BOOL value_empty,
}
}
reg_type = get_regtype(type);
if (reg_type == -1)
reg_type = wchar_get_type(type);
if (reg_type == ~0u)
{
RegCloseKey(subkey);
reg_message(STRING_INVALID_CMDLINE);
reg_message(STRING_UNSUPPORTED_TYPE);
return 1;
}

View File

@ -30,3 +30,4 @@
#define STRING_INVALID_CMDLINE 107
#define STRING_NO_REMOTE 108
#define STRING_CANNOT_FIND 109
#define STRING_UNSUPPORTED_TYPE 110

View File

@ -35,4 +35,5 @@ STRINGTABLE
STRING_INVALID_CMDLINE, "Error: Invalid command line parameters\n"
STRING_NO_REMOTE, "Error: Unable to access remote machine\n"
STRING_CANNOT_FIND, "Error: The system was unable to find the specified registry key or value\n"
STRING_UNSUPPORTED_TYPE, "Error: Unsupported type\n"
}