Commit 397ce0db authored by Zhiyi Zhang's avatar Zhiyi Zhang Committed by Alexandre Julliard

tasklist: Support '/fo' option.

parent 8238c1d4
......@@ -18523,6 +18523,12 @@ msgstr "استخدام الذاكرة"
msgid "K"
msgstr "حسنًا"
#: programs/tasklist/tasklist.rc:36
#, fuzzy
#| msgid "Error: Invalid key name\n"
msgid "ERROR: Invalid syntax\n"
msgstr "خطأ : اسم المفتاح غير سليم\n"
#: programs/taskmgr/taskmgr.rc:37 programs/taskmgr/taskmgr.rc:108
msgid "&New Task (Run...)"
msgstr "م&همة جديدة (تشغيل)..."
......
......@@ -17164,6 +17164,12 @@ msgstr ""
msgid "K"
msgstr "Aceutar"
#: programs/tasklist/tasklist.rc:36
#, fuzzy
#| msgid "reg: Invalid syntax. "
msgid "ERROR: Invalid syntax\n"
msgstr "reg: La sintaxis nun ye válida. "
#: programs/taskmgr/taskmgr.rc:37 programs/taskmgr/taskmgr.rc:108
msgid "&New Task (Run...)"
msgstr ""
......
......@@ -17163,6 +17163,11 @@ msgstr ""
msgid "K"
msgstr "OK"
#: programs/tasklist/tasklist.rc:36
#, fuzzy
msgid "ERROR: Invalid syntax\n"
msgstr "Невалидни знаци в пътя.\n"
#: programs/taskmgr/taskmgr.rc:37 programs/taskmgr/taskmgr.rc:108
msgid "&New Task (Run...)"
msgstr ""
......
......@@ -17443,6 +17443,12 @@ msgstr "Ús de memòria"
msgid "K"
msgstr "D'acord"
#: programs/tasklist/tasklist.rc:36
#, fuzzy
#| msgid "reg: Invalid syntax. "
msgid "ERROR: Invalid syntax\n"
msgstr "reg: La sintaxi no és vàlida. "
#: programs/taskmgr/taskmgr.rc:37 programs/taskmgr/taskmgr.rc:108
msgid "&New Task (Run...)"
msgstr "&Tasca nova (executa...)"
......
......@@ -17927,6 +17927,12 @@ msgstr "Využití paměti"
msgid "K"
msgstr "OK"
#: programs/tasklist/tasklist.rc:36
#, fuzzy
#| msgid "reg: Invalid syntax. "
msgid "ERROR: Invalid syntax\n"
msgstr "reg: Neplatná syntaxe. "
#: programs/taskmgr/taskmgr.rc:37 programs/taskmgr/taskmgr.rc:108
msgid "&New Task (Run...)"
msgstr "&Nová úloha (Spustit...)"
......
......@@ -18434,6 +18434,12 @@ msgstr "Hukommelse forbrug"
msgid "K"
msgstr "OK"
#: programs/tasklist/tasklist.rc:36
#, fuzzy
#| msgid "Error: Invalid key name\n"
msgid "ERROR: Invalid syntax\n"
msgstr "Fejl: Ugyldigt nøgle navn\n"
#: programs/taskmgr/taskmgr.rc:37 programs/taskmgr/taskmgr.rc:108
msgid "&New Task (Run...)"
msgstr "&Ny opgave (Kør...)"
......
......@@ -17410,6 +17410,12 @@ msgstr "Speicherauslastung"
msgid "K"
msgstr "OK"
#: programs/tasklist/tasklist.rc:36
#, fuzzy
#| msgid "reg: Invalid syntax. "
msgid "ERROR: Invalid syntax\n"
msgstr "reg: Ungültige Syntax. "
#: programs/taskmgr/taskmgr.rc:37 programs/taskmgr/taskmgr.rc:108
msgid "&New Task (Run...)"
msgstr "&Neuer Task (Ausführen...)"
......
......@@ -16798,6 +16798,11 @@ msgstr ""
msgid "K"
msgstr ""
#: programs/tasklist/tasklist.rc:36
#, fuzzy
msgid "ERROR: Invalid syntax\n"
msgstr "Μη έγγυρος(οι) χαρακτήρας(ες) στο μονοπάτι.\n"
#: programs/taskmgr/taskmgr.rc:37 programs/taskmgr/taskmgr.rc:108
msgid "&New Task (Run...)"
msgstr ""
......
......@@ -17294,6 +17294,10 @@ msgstr "Mem Usage"
msgid "K"
msgstr "K"
#: programs/tasklist/tasklist.rc:36
msgid "ERROR: Invalid syntax\n"
msgstr "ERROR: Invalid syntax\n"
#: programs/taskmgr/taskmgr.rc:37 programs/taskmgr/taskmgr.rc:108
msgid "&New Task (Run...)"
msgstr "&New Task (Run...)"
......
......@@ -17294,6 +17294,10 @@ msgstr "Mem Usage"
msgid "K"
msgstr "K"
#: programs/tasklist/tasklist.rc:36
msgid "ERROR: Invalid syntax\n"
msgstr "ERROR: Invalid syntax\n"
#: programs/taskmgr/taskmgr.rc:37 programs/taskmgr/taskmgr.rc:108
msgid "&New Task (Run...)"
msgstr "&New Task (Run...)"
......
......@@ -17486,6 +17486,12 @@ msgstr ""
msgid "K"
msgstr "Bone"
#: programs/tasklist/tasklist.rc:36
#, fuzzy
#| msgid "Invalid share name.\n"
msgid "ERROR: Invalid syntax\n"
msgstr "Nevalida nomo de kunuzata aparato.\n"
#: programs/taskmgr/taskmgr.rc:37 programs/taskmgr/taskmgr.rc:108
msgid "&New Task (Run...)"
msgstr ""
......
......@@ -17768,6 +17768,12 @@ msgstr "Uso de Mem"
msgid "K"
msgstr "Aceptar"
#: programs/tasklist/tasklist.rc:36
#, fuzzy
#| msgid "reg: Invalid syntax. "
msgid "ERROR: Invalid syntax\n"
msgstr "reg: Sintaxis inválida. "
#: programs/taskmgr/taskmgr.rc:37 programs/taskmgr/taskmgr.rc:108
msgid "&New Task (Run...)"
msgstr "&Nueva Tarea (Ejecutar...)"
......
......@@ -16992,6 +16992,11 @@ msgstr ""
msgid "K"
msgstr "قبول"
#: programs/tasklist/tasklist.rc:36
#, fuzzy
msgid "ERROR: Invalid syntax\n"
msgstr "پرونده‌های متنی (*.txt).\n"
#: programs/taskmgr/taskmgr.rc:37 programs/taskmgr/taskmgr.rc:108
msgid "&New Task (Run...)"
msgstr ""
......
......@@ -17267,6 +17267,12 @@ msgstr "Muistin käyttö"
msgid "K"
msgstr "OK"
#: programs/tasklist/tasklist.rc:36
#, fuzzy
#| msgid "reg: Invalid syntax. "
msgid "ERROR: Invalid syntax\n"
msgstr "reg: Syntaksi ei kelpaa. "
#: programs/taskmgr/taskmgr.rc:37 programs/taskmgr/taskmgr.rc:108
msgid "&New Task (Run...)"
msgstr "&Uusi tehtävä (Suorita...)"
......
......@@ -18009,6 +18009,12 @@ msgstr "Mémoire"
msgid "K"
msgstr "OK"
#: programs/tasklist/tasklist.rc:36
#, fuzzy
#| msgid "reg: Invalid syntax. "
msgid "ERROR: Invalid syntax\n"
msgstr "reg : syntaxe invalide. "
#: programs/taskmgr/taskmgr.rc:37 programs/taskmgr/taskmgr.rc:108
msgid "&New Task (Run...)"
msgstr "&Nouvelle tâche (Exécuter...)"
......
......@@ -17940,6 +17940,12 @@ msgstr "שימוש בזיכרון"
msgid "K"
msgstr "אישור"
#: programs/tasklist/tasklist.rc:36
#, fuzzy
#| msgid "Error: Invalid key name\n"
msgid "ERROR: Invalid syntax\n"
msgstr "Error: Invalid key name\n"
#: programs/taskmgr/taskmgr.rc:37 programs/taskmgr/taskmgr.rc:108
msgid "&New Task (Run...)"
msgstr "משימה &חדשה (הפעלה...)"
......
......@@ -16467,6 +16467,10 @@ msgstr ""
msgid "K"
msgstr ""
#: programs/tasklist/tasklist.rc:36
msgid "ERROR: Invalid syntax\n"
msgstr ""
#: programs/taskmgr/taskmgr.rc:37 programs/taskmgr/taskmgr.rc:108
msgid "&New Task (Run...)"
msgstr ""
......
......@@ -17894,6 +17894,12 @@ msgstr "Mem uporaba"
msgid "K"
msgstr "U redu"
#: programs/tasklist/tasklist.rc:36
#, fuzzy
#| msgid "Error: Invalid key name\n"
msgid "ERROR: Invalid syntax\n"
msgstr "Greška: Neispravan naziv ključa\n"
#: programs/taskmgr/taskmgr.rc:37 programs/taskmgr/taskmgr.rc:108
msgid "&New Task (Run...)"
msgstr "&Novi zadatak (Pokreni...)"
......
......@@ -18425,6 +18425,12 @@ msgstr "Memória - (Személyes munkakészlet)"
msgid "K"
msgstr "OK"
#: programs/tasklist/tasklist.rc:36
#, fuzzy
#| msgid "Error: Invalid key name\n"
msgid "ERROR: Invalid syntax\n"
msgstr "Hiba: Érvénytelen kulcsnév\n"
#: programs/taskmgr/taskmgr.rc:37 programs/taskmgr/taskmgr.rc:108
msgid "&New Task (Run...)"
msgstr "Új feladat (f&uttatás...)"
......
......@@ -18512,6 +18512,12 @@ msgstr "Uso della memoria"
msgid "K"
msgstr "Ok"
#: programs/tasklist/tasklist.rc:36
#, fuzzy
#| msgid "Error: Invalid key name\n"
msgid "ERROR: Invalid syntax\n"
msgstr "Errore: nome della chiave non valido\n"
#: programs/taskmgr/taskmgr.rc:37 programs/taskmgr/taskmgr.rc:108
msgid "&New Task (Run...)"
msgstr "&Nuovo processo (Esegui...)"
......
......@@ -17304,6 +17304,12 @@ msgstr "メモリ使用量"
msgid "K"
msgstr "OK"
#: programs/tasklist/tasklist.rc:36
#, fuzzy
#| msgid "reg: Invalid syntax. "
msgid "ERROR: Invalid syntax\n"
msgstr "reg: 無効な構文です。"
#: programs/taskmgr/taskmgr.rc:37 programs/taskmgr/taskmgr.rc:108
msgid "&New Task (Run...)"
msgstr "新しいタスクの実行(&N)..."
......
......@@ -17244,6 +17244,12 @@ msgstr "메모리 사용량"
msgid "K"
msgstr "확인"
#: programs/tasklist/tasklist.rc:36
#, fuzzy
#| msgid "reg: Invalid syntax. "
msgid "ERROR: Invalid syntax\n"
msgstr "reg: 잘못된 구문. "
#: programs/taskmgr/taskmgr.rc:37 programs/taskmgr/taskmgr.rc:108
msgid "&New Task (Run...)"
msgstr "새 작업(&N) (실행...)"
......
......@@ -17319,6 +17319,12 @@ msgstr "Atm naudojimas"
msgid "K"
msgstr "Gerai"
#: programs/tasklist/tasklist.rc:36
#, fuzzy
#| msgid "reg: Invalid syntax. "
msgid "ERROR: Invalid syntax\n"
msgstr "reg: Netinkama sintaksė. "
#: programs/taskmgr/taskmgr.rc:37 programs/taskmgr/taskmgr.rc:108
msgid "&New Task (Run...)"
msgstr "&Nauja užduotis (vykdyti...)"
......
......@@ -16470,6 +16470,10 @@ msgstr ""
msgid "K"
msgstr "ശരി"
#: programs/tasklist/tasklist.rc:36
msgid "ERROR: Invalid syntax\n"
msgstr ""
#: programs/taskmgr/taskmgr.rc:37 programs/taskmgr/taskmgr.rc:108
msgid "&New Task (Run...)"
msgstr ""
......
......@@ -17989,6 +17989,12 @@ msgstr "Minnebruk"
msgid "K"
msgstr "OK"
#: programs/tasklist/tasklist.rc:36
#, fuzzy
#| msgid "reg: Invalid syntax. "
msgid "ERROR: Invalid syntax\n"
msgstr "reg: Ugyldig syntaks. "
#: programs/taskmgr/taskmgr.rc:37 programs/taskmgr/taskmgr.rc:108
msgid "&New Task (Run...)"
msgstr "&Ny oppgave (Kjør...)"
......
......@@ -17384,6 +17384,12 @@ msgstr "Geheugengebruik"
msgid "K"
msgstr "OK"
#: programs/tasklist/tasklist.rc:36
#, fuzzy
#| msgid "reg: Invalid syntax. "
msgid "ERROR: Invalid syntax\n"
msgstr "reg: Foutieve syntax. "
#: programs/taskmgr/taskmgr.rc:37 programs/taskmgr/taskmgr.rc:108
msgid "&New Task (Run...)"
msgstr "&Nieuwe taak (uitvoeren...)"
......
......@@ -16452,6 +16452,10 @@ msgstr ""
msgid "K"
msgstr ""
#: programs/tasklist/tasklist.rc:36
msgid "ERROR: Invalid syntax\n"
msgstr ""
#: programs/taskmgr/taskmgr.rc:37 programs/taskmgr/taskmgr.rc:108
msgid "&New Task (Run...)"
msgstr ""
......
......@@ -16452,6 +16452,10 @@ msgstr ""
msgid "K"
msgstr ""
#: programs/tasklist/tasklist.rc:36
msgid "ERROR: Invalid syntax\n"
msgstr ""
#: programs/taskmgr/taskmgr.rc:37 programs/taskmgr/taskmgr.rc:108
msgid "&New Task (Run...)"
msgstr ""
......
......@@ -17524,6 +17524,12 @@ msgstr "Użycie pamięci"
msgid "K"
msgstr "OK"
#: programs/tasklist/tasklist.rc:36
#, fuzzy
#| msgid "reg: Invalid syntax. "
msgid "ERROR: Invalid syntax\n"
msgstr "reg: Nieprawidłowa składnia. "
#: programs/taskmgr/taskmgr.rc:37 programs/taskmgr/taskmgr.rc:108
msgid "&New Task (Run...)"
msgstr "&Nowe zadanie (Uruchom...)"
......
......@@ -17586,6 +17586,12 @@ msgstr "Uso de Memória"
msgid "K"
msgstr "OK"
#: programs/tasklist/tasklist.rc:36
#, fuzzy
#| msgid "reg: Invalid syntax. "
msgid "ERROR: Invalid syntax\n"
msgstr "reg: Sintaxe inválida. "
#: programs/taskmgr/taskmgr.rc:37 programs/taskmgr/taskmgr.rc:108
msgid "&New Task (Run...)"
msgstr "&Nova Tarefa (Executar...)"
......
......@@ -18160,6 +18160,12 @@ msgstr "Utilização de Memória"
msgid "K"
msgstr "OK"
#: programs/tasklist/tasklist.rc:36
#, fuzzy
#| msgid "reg: Invalid syntax. "
msgid "ERROR: Invalid syntax\n"
msgstr "reg: Sintaxe inválida. "
#: programs/taskmgr/taskmgr.rc:37 programs/taskmgr/taskmgr.rc:108
msgid "&New Task (Run...)"
msgstr "&Nova Tarefa (Executar...)"
......
......@@ -16583,6 +16583,11 @@ msgstr ""
msgid "K"
msgstr ""
#: programs/tasklist/tasklist.rc:36
#, fuzzy
msgid "ERROR: Invalid syntax\n"
msgstr "Tuot las datotecas (*.*).\n"
#: programs/taskmgr/taskmgr.rc:37 programs/taskmgr/taskmgr.rc:108
msgid "&New Task (Run...)"
msgstr ""
......
......@@ -18189,6 +18189,12 @@ msgstr "Utilizare memorie"
msgid "K"
msgstr "OK"
#: programs/tasklist/tasklist.rc:36
#, fuzzy
#| msgid "reg: Invalid syntax. "
msgid "ERROR: Invalid syntax\n"
msgstr "reg: Sintaxă nevalidă. "
#: programs/taskmgr/taskmgr.rc:37 programs/taskmgr/taskmgr.rc:108
msgid "&New Task (Run...)"
msgstr "Sarcină &nouă (executare...)"
......
......@@ -17553,6 +17553,12 @@ msgstr "Память"
msgid "K"
msgstr "ОК"
#: programs/tasklist/tasklist.rc:36
#, fuzzy
#| msgid "reg: Invalid syntax. "
msgid "ERROR: Invalid syntax\n"
msgstr "reg: неверный синтаксис. "
#: programs/taskmgr/taskmgr.rc:37 programs/taskmgr/taskmgr.rc:108
msgid "&New Task (Run...)"
msgstr "&Новая задача (Выполнить...)"
......
......@@ -17217,6 +17217,12 @@ msgstr "මතක භාවිතය"
msgid "K"
msgstr "හරි"
#: programs/tasklist/tasklist.rc:36
#, fuzzy
#| msgid "reg: Invalid syntax. "
msgid "ERROR: Invalid syntax\n"
msgstr "reg: අවලංගු රීති."
#: programs/taskmgr/taskmgr.rc:37 programs/taskmgr/taskmgr.rc:108
msgid "&New Task (Run...)"
msgstr "අලුත් කාර්යයක් (ධාවන කරන්න...) (&N)"
......
......@@ -17663,6 +17663,12 @@ msgstr ""
msgid "K"
msgstr "OK"
#: programs/tasklist/tasklist.rc:36
#, fuzzy
#| msgid "Invalid name.\n"
msgid "ERROR: Invalid syntax\n"
msgstr "Nesprávny názov.\n"
#: programs/taskmgr/taskmgr.rc:37 programs/taskmgr/taskmgr.rc:108
msgid "&New Task (Run...)"
msgstr "&Nová úloha (Spusti...)"
......
......@@ -18449,6 +18449,12 @@ msgstr "Uporaba pomnilnika"
msgid "K"
msgstr "V redu"
#: programs/tasklist/tasklist.rc:36
#, fuzzy
#| msgid "Error: Invalid key name\n"
msgid "ERROR: Invalid syntax\n"
msgstr "Napaka: neveljavno ime ključa\n"
#: programs/taskmgr/taskmgr.rc:37 programs/taskmgr/taskmgr.rc:108
msgid "&New Task (Run...)"
msgstr "&Novo opravilo (Zaženi ...)"
......
......@@ -17739,6 +17739,11 @@ msgstr ""
msgid "K"
msgstr "У реду"
#: programs/tasklist/tasklist.rc:36
#, fuzzy
msgid "ERROR: Invalid syntax\n"
msgstr "Неисправна синтакса.\n"
#: programs/taskmgr/taskmgr.rc:37 programs/taskmgr/taskmgr.rc:108
msgid "&New Task (Run...)"
msgstr ""
......
......@@ -17934,6 +17934,11 @@ msgstr ""
msgid "K"
msgstr "U redu"
#: programs/tasklist/tasklist.rc:36
#, fuzzy
msgid "ERROR: Invalid syntax\n"
msgstr "Neispravna sintaksa.\n"
#: programs/taskmgr/taskmgr.rc:37 programs/taskmgr/taskmgr.rc:108
msgid "&New Task (Run...)"
msgstr ""
......
......@@ -18121,6 +18121,12 @@ msgstr "Minnesanvändning"
msgid "K"
msgstr "OK"
#: programs/tasklist/tasklist.rc:36
#, fuzzy
#| msgid "reg: Invalid syntax. "
msgid "ERROR: Invalid syntax\n"
msgstr "reg: Ogiltig syntax. "
#: programs/taskmgr/taskmgr.rc:37 programs/taskmgr/taskmgr.rc:108
msgid "&New Task (Run...)"
msgstr "&Ny aktivitet (Kör...)"
......
......@@ -16436,6 +16436,10 @@ msgstr ""
msgid "K"
msgstr "சரி"
#: programs/tasklist/tasklist.rc:36
msgid "ERROR: Invalid syntax\n"
msgstr ""
#: programs/taskmgr/taskmgr.rc:37 programs/taskmgr/taskmgr.rc:108
msgid "&New Task (Run...)"
msgstr ""
......
......@@ -16452,6 +16452,10 @@ msgstr ""
msgid "K"
msgstr ""
#: programs/tasklist/tasklist.rc:36
msgid "ERROR: Invalid syntax\n"
msgstr ""
#: programs/taskmgr/taskmgr.rc:37 programs/taskmgr/taskmgr.rc:108
msgid "&New Task (Run...)"
msgstr ""
......
......@@ -17102,6 +17102,11 @@ msgstr ""
msgid "K"
msgstr "ตกลง"
#: programs/tasklist/tasklist.rc:36
#, fuzzy
msgid "ERROR: Invalid syntax\n"
msgstr "แฟ้มตํารา (*.txt).\n"
#: programs/taskmgr/taskmgr.rc:37 programs/taskmgr/taskmgr.rc:108
msgid "&New Task (Run...)"
msgstr ""
......
......@@ -17350,6 +17350,12 @@ msgstr "Bellek Kullanımı"
msgid "K"
msgstr "Tamam"
#: programs/tasklist/tasklist.rc:36
#, fuzzy
#| msgid "reg: Invalid syntax. "
msgid "ERROR: Invalid syntax\n"
msgstr "reg: Geçersiz sözdizimi. "
#: programs/taskmgr/taskmgr.rc:37 programs/taskmgr/taskmgr.rc:108
msgid "&New Task (Run...)"
msgstr "&Yeni Görev (Çalıştır...)"
......
......@@ -17407,6 +17407,12 @@ msgstr "Пам'ять"
msgid "K"
msgstr "OK"
#: programs/tasklist/tasklist.rc:36
#, fuzzy
#| msgid "reg: Invalid syntax. "
msgid "ERROR: Invalid syntax\n"
msgstr "reg: Невірний синтаксис. "
#: programs/taskmgr/taskmgr.rc:37 programs/taskmgr/taskmgr.rc:108
msgid "&New Task (Run...)"
msgstr "&Нове завдання (Виконати...)"
......
......@@ -16954,6 +16954,11 @@ msgstr ""
msgid "K"
msgstr "I Va"
#: programs/tasklist/tasklist.rc:36
#, fuzzy
msgid "ERROR: Invalid syntax\n"
msgstr "Fitchîs tekse (*.txt).\n"
#: programs/taskmgr/taskmgr.rc:37 programs/taskmgr/taskmgr.rc:108
msgid "&New Task (Run...)"
msgstr ""
......
......@@ -16359,6 +16359,10 @@ msgstr ""
msgid "K"
msgstr ""
#: programs/tasklist/tasklist.rc:36
msgid "ERROR: Invalid syntax\n"
msgstr ""
#: programs/taskmgr/taskmgr.rc:37 programs/taskmgr/taskmgr.rc:108
msgid "&New Task (Run...)"
msgstr ""
......
......@@ -17063,6 +17063,12 @@ msgstr "内存占用"
msgid "K"
msgstr "确定"
#: programs/tasklist/tasklist.rc:36
#, fuzzy
#| msgid "reg: Invalid syntax. "
msgid "ERROR: Invalid syntax\n"
msgstr "reg: 语法无效。"
#: programs/taskmgr/taskmgr.rc:37 programs/taskmgr/taskmgr.rc:108
msgid "&New Task (Run...)"
msgstr "新任务(&N)..."
......
......@@ -17128,6 +17128,12 @@ msgstr "記憶體使用量"
msgid "K"
msgstr "確定"
#: programs/tasklist/tasklist.rc:36
#, fuzzy
#| msgid "reg: Invalid syntax. "
msgid "ERROR: Invalid syntax\n"
msgstr "reg: 無效的語法。 "
#: programs/taskmgr/taskmgr.rc:37 programs/taskmgr/taskmgr.rc:108
msgid "&New Task (Run...)"
msgstr "執行新工作(&N)..."
......
......@@ -33,6 +33,14 @@ static int tasklist_message(int msg)
return wprintf(msg_buffer);
}
static int tasklist_error(int msg)
{
WCHAR msg_buffer[MAXSTRING];
LoadStringW(GetModuleHandleW(NULL), msg, msg_buffer, ARRAY_SIZE(msg_buffer));
return fwprintf(stderr, msg_buffer);
}
static PROCESSENTRY32W *enumerate_processes(DWORD *process_count)
{
unsigned int alloc_count = 128;
......@@ -112,7 +120,8 @@ static NUMBERFMTW *tasklist_get_memory_format(void)
return &format;
}
static void tasklist_get_header(struct tasklist_process_info *header)
static void tasklist_get_header(const struct tasklist_options *options,
struct tasklist_process_info *header)
{
HMODULE module;
......@@ -122,6 +131,14 @@ static void tasklist_get_header(struct tasklist_process_info *header)
LoadStringW(module, STRING_SESSION_NAME, header->session_name, ARRAY_SIZE(header->session_name));
LoadStringW(module, STRING_SESSION_NUMBER, header->session_number, ARRAY_SIZE(header->session_number));
LoadStringW(module, STRING_MEM_USAGE, header->memory_usage, ARRAY_SIZE(header->memory_usage));
if (options->format == LIST)
{
wcscat(header->image_name, L":");
wcscat(header->pid, L":");
wcscat(header->session_name, L":");
wcscat(header->session_number, L":");
wcscat(header->memory_usage, L":");
}
}
static BOOL tasklist_get_process_info(const PROCESSENTRY32W *process_entry, struct tasklist_process_info *info)
......@@ -169,14 +186,19 @@ static void tasklist_print(const struct tasklist_options *options)
PROCESSENTRY32W *process_list;
DWORD process_count, i;
wprintf(L"\n");
if (options->format == TABLE)
wprintf(L"\n");
tasklist_get_header(options, &header);
if (!options->no_header)
{
tasklist_get_header(&header);
wprintf(L"%-25.25s %8.8s %-16.16s %11.11s %12.12s\n"
L"========================= ======== ================ =========== ============\n",
header.image_name, header.pid, header.session_name, header.session_number, header.memory_usage);
if (options->format == TABLE)
wprintf(L"%-25.25s %8.8s %-16.16s %11.11s %12.12s\n"
L"========================= ======== ================ =========== ============\n",
header.image_name, header.pid, header.session_name, header.session_number, header.memory_usage);
else if (options->format == CSV)
wprintf(L"\"%s\",\"%s\",\"%s\",\"%s\",\"%s\"\n",
header.image_name, header.pid, header.session_name, header.session_number, header.memory_usage);
}
process_list = enumerate_processes(&process_count);
......@@ -185,8 +207,24 @@ static void tasklist_print(const struct tasklist_options *options)
if (!tasklist_get_process_info(&process_list[i], &info))
continue;
wprintf(L"%-25.25s %8.8s %-16.16s %11.11s %12s\n",
info.image_name, info.pid, info.session_name, info.session_number, info.memory_usage);
if (options->format == TABLE)
wprintf(L"%-25.25s %8.8s %-16.16s %11.11s %12s\n",
info.image_name, info.pid, info.session_name, info.session_number, info.memory_usage);
else if (options->format == CSV)
wprintf(L"\"%s\",\"%s\",\"%s\",\"%s\",\"%s\"\n",
info.image_name, info.pid, info.session_name, info.session_number, info.memory_usage);
else if (options->format == LIST)
wprintf(L"\n"
L"%-13.13s %s\n"
L"%-13.13s %s\n"
L"%-13.13s %s\n"
L"%-13.13s %s\n"
L"%-13.13s %s\n",
header.image_name, info.image_name,
header.pid, info.pid,
header.session_name, info.session_name,
header.session_number, info.session_number,
header.memory_usage, info.memory_usage);
}
free(process_list);
}
......@@ -211,6 +249,31 @@ int __cdecl wmain(int argc, WCHAR *argv[])
{
options.no_header = TRUE;
}
else if (!wcsicmp(argv[i], L"/fo"))
{
if (i + 1 >= argc)
{
tasklist_error(STRING_INVALID_SYNTAX);
return 1;
}
else if (!wcsicmp(argv[i + 1], L"TABLE"))
{
options.format = TABLE;
}
else if (!wcsicmp(argv[i + 1], L"CSV"))
{
options.format = CSV;
}
else if (!wcsicmp(argv[i + 1], L"LIST"))
{
options.format = LIST;
}
else
{
tasklist_error(STRING_INVALID_SYNTAX);
return 1;
}
}
else
{
WINE_WARN("Ignoring option %s\n", wine_dbgstr_w(argv[i]));
......
......@@ -27,6 +27,14 @@
#define STRING_SESSION_NUMBER 105
#define STRING_MEM_USAGE 106
#define STRING_K 107
#define STRING_INVALID_SYNTAX 108
enum tasklist_format
{
TABLE = 0,
CSV = 1,
LIST = 2,
};
struct tasklist_process_info
{
......@@ -40,4 +48,5 @@ struct tasklist_process_info
struct tasklist_options
{
BOOL no_header;
enum tasklist_format format;
};
......@@ -32,6 +32,7 @@ STRINGTABLE
STRING_SESSION_NUMBER, "Session#"
STRING_MEM_USAGE, "Mem Usage"
STRING_K, "K"
STRING_INVALID_SYNTAX, "ERROR: Invalid syntax\n"
}
#define WINE_FILEDESCRIPTION_STR "Wine tasklist"
......
......@@ -122,6 +122,48 @@ static void test_no_header(void)
ok(!pos, "Got header.\n");
}
static void test_format(void)
{
char *pos;
/* /fo */
run_tasklist("/fo", 1);
ok(stdout_size == 0, "Unexpected stdout buffer size %ld.\n", stdout_size);
ok(stderr_size > 0, "Unexpected stderr buffer size %ld.\n", stderr_size);
/* /fo invalid */
run_tasklist("/fo invalid", 1);
ok(stdout_size == 0, "Unexpected stdout buffer size %ld.\n", stdout_size);
ok(stderr_size > 0, "Unexpected stderr buffer size %ld.\n", stderr_size);
/* /fo TABLE */
run_tasklist("/fo TABLE", 0);
ok(stdout_size > 0, "Unexpected stdout buffer size %ld.\n", stdout_size);
ok(stderr_size == 0, "Unexpected stderr buffer size %ld.\n", stderr_size);
pos = strstr(stdout_buffer, "\r\n"
"Image Name PID Session Name Session# Mem Usage\r\n"
"========================= ======== ================ =========== ============\r\n");
ok(pos == stdout_buffer, "Got the wrong first line.\n");
pos = strstr(stdout_buffer, "tasklist.exe");
ok(!!pos, "Failed to list tasklist.exe.\n");
/* /fo CSV */
run_tasklist("/fo CSV", 0);
ok(stdout_size > 0, "Unexpected stdout buffer size %ld.\n", stdout_size);
ok(stderr_size == 0, "Unexpected stderr buffer size %ld.\n", stderr_size);
pos = strstr(stdout_buffer, "\"Image Name\",\"PID\",\"Session Name\",\"Session#\",\"Mem Usage\"");
ok(pos == stdout_buffer, "Got the wrong first line.\n");
pos = strstr(stdout_buffer, "\"tasklist.exe\",");
ok(!!pos, "Failed to list tasklist.exe.\n");
/* /fo LIST */
run_tasklist("/fo LIST", 0);
ok(stdout_size > 0, "Unexpected stdout buffer size %ld.\n", stdout_size);
ok(stderr_size == 0, "Unexpected stderr buffer size %ld.\n", stderr_size);
pos = strstr(stdout_buffer, "Image Name: tasklist.exe");
ok(!!pos, "Failed to list tasklist.exe.\n");
}
START_TEST(tasklist)
{
if (PRIMARYLANGID(GetUserDefaultUILanguage()) != LANG_ENGLISH)
......@@ -132,4 +174,5 @@ START_TEST(tasklist)
test_basic();
test_no_header();
test_format();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment