diff --git a/po/ar.po b/po/ar.po index a801a186eec..a9bcc836a67 100644 --- a/po/ar.po +++ b/po/ar.po @@ -8317,7 +8317,7 @@ msgid "" msgstr "" #: net.rc:44 -msgid "%s %S %S Open resources: %lu\n" +msgid "%s %s %s Open resources: %lu\n" msgstr "" #: net.rc:45 diff --git a/po/bg.po b/po/bg.po index b8314c6c7cf..bfdfb9a1115 100644 --- a/po/bg.po +++ b/po/bg.po @@ -8487,7 +8487,7 @@ msgid "" msgstr "" #: net.rc:44 -msgid "%s %S %S Open resources: %lu\n" +msgid "%s %s %s Open resources: %lu\n" msgstr "" #: net.rc:45 diff --git a/po/ca.po b/po/ca.po index 05d49495dce..334d9801a2e 100644 --- a/po/ca.po +++ b/po/ca.po @@ -8233,7 +8233,7 @@ msgid "" msgstr "" #: net.rc:44 -msgid "%s %S %S Open resources: %lu\n" +msgid "%s %s %s Open resources: %lu\n" msgstr "" #: net.rc:45 diff --git a/po/cs.po b/po/cs.po index 2126a19e870..c3a9960a830 100644 --- a/po/cs.po +++ b/po/cs.po @@ -8857,7 +8857,7 @@ msgid "" msgstr "" #: net.rc:44 -msgid "%s %S %S Open resources: %lu\n" +msgid "%s %s %s Open resources: %lu\n" msgstr "" #: net.rc:45 diff --git a/po/da.po b/po/da.po index eb9efb4e4b0..4cc50aa4210 100644 --- a/po/da.po +++ b/po/da.po @@ -8920,8 +8920,8 @@ msgstr "" "---------------------------------------------------------------\n" #: net.rc:44 -msgid "%s %S %S Open resources: %lu\n" -msgstr "%s %S %S Åbne resourser: %lu\n" +msgid "%s %s %s Open resources: %lu\n" +msgstr "%s %s %s Åbne resourser: %lu\n" #: net.rc:45 msgid "OK" diff --git a/po/de.po b/po/de.po index 5b9f0e43d9f..7cb7ae88533 100644 --- a/po/de.po +++ b/po/de.po @@ -8906,8 +8906,8 @@ msgstr "" "---------------------------------------------------------------\n" #: net.rc:44 -msgid "%s %S %S Open resources: %lu\n" -msgstr "%s %S %S Offene Ressourcen: %lu\n" +msgid "%s %s %s Open resources: %lu\n" +msgstr "%s %s %s Offene Ressourcen: %lu\n" #: net.rc:45 msgid "OK" diff --git a/po/el.po b/po/el.po index 5784cf3b400..bbd9a263e78 100644 --- a/po/el.po +++ b/po/el.po @@ -8366,7 +8366,7 @@ msgid "" msgstr "" #: net.rc:44 -msgid "%s %S %S Open resources: %lu\n" +msgid "%s %s %s Open resources: %lu\n" msgstr "" #: net.rc:45 diff --git a/po/en.po b/po/en.po index e2c5e2b8af7..26030aa54dd 100644 --- a/po/en.po +++ b/po/en.po @@ -8546,8 +8546,8 @@ msgstr "" "---------------------------------------------------------------\n" #: net.rc:44 -msgid "%s %S %S Open resources: %lu\n" -msgstr "%s %S %S Open resources: %lu\n" +msgid "%s %s %s Open resources: %lu\n" +msgstr "%s %s %s Open resources: %lu\n" #: net.rc:45 msgid "OK" diff --git a/po/en_US.po b/po/en_US.po index 1fd9b10de49..ec628843377 100644 --- a/po/en_US.po +++ b/po/en_US.po @@ -8654,8 +8654,8 @@ msgstr "" "---------------------------------------------------------------\n" #: net.rc:44 -msgid "%s %S %S Open resources: %lu\n" -msgstr "%s %S %S Open resources: %lu\n" +msgid "%s %s %s Open resources: %lu\n" +msgstr "%s %s %s Open resources: %lu\n" #: net.rc:45 msgid "OK" diff --git a/po/eo.po b/po/eo.po index 66eda3758bb..549a2b97a5e 100644 --- a/po/eo.po +++ b/po/eo.po @@ -8491,7 +8491,7 @@ msgid "" msgstr "" #: net.rc:44 -msgid "%s %S %S Open resources: %lu\n" +msgid "%s %s %s Open resources: %lu\n" msgstr "" #: net.rc:45 diff --git a/po/es.po b/po/es.po index 7adad07d298..f4ef00856e3 100644 --- a/po/es.po +++ b/po/es.po @@ -9085,7 +9085,7 @@ msgid "" msgstr "" #: net.rc:44 -msgid "%s %S %S Open resources: %lu\n" +msgid "%s %s %s Open resources: %lu\n" msgstr "" #: net.rc:45 diff --git a/po/fa.po b/po/fa.po index 6950488fcd5..2ee68848288 100644 --- a/po/fa.po +++ b/po/fa.po @@ -8319,7 +8319,7 @@ msgid "" msgstr "" #: net.rc:44 -msgid "%s %S %S Open resources: %lu\n" +msgid "%s %s %s Open resources: %lu\n" msgstr "" #: net.rc:45 diff --git a/po/fi.po b/po/fi.po index 61da6fa3286..5220cc34bd1 100644 --- a/po/fi.po +++ b/po/fi.po @@ -8572,7 +8572,7 @@ msgid "" msgstr "" #: net.rc:44 -msgid "%s %S %S Open resources: %lu\n" +msgid "%s %s %s Open resources: %lu\n" msgstr "" #: net.rc:45 diff --git a/po/fr.po b/po/fr.po index ec0be226c4f..72b293eda78 100644 --- a/po/fr.po +++ b/po/fr.po @@ -8745,8 +8745,8 @@ msgstr "" "---------------------------------------------------------------\n" #: net.rc:44 -msgid "%s %S %S Open resources: %lu\n" -msgstr "%s %S %S Ressources ouvertes : %lu\n" +msgid "%s %s %s Open resources: %lu\n" +msgstr "%s %s %s Ressources ouvertes : %lu\n" #: net.rc:45 msgid "OK" diff --git a/po/he.po b/po/he.po index a0921413740..72f21d5daa8 100644 --- a/po/he.po +++ b/po/he.po @@ -8755,8 +8755,8 @@ msgstr "" "---------------------------------------------------------------\n" #: net.rc:44 -msgid "%s %S %S Open resources: %lu\n" -msgstr "%s %S %S Open resources: %lu\n" +msgid "%s %s %s Open resources: %lu\n" +msgstr "%s %s %s Open resources: %lu\n" #: net.rc:45 msgid "OK" diff --git a/po/hi.po b/po/hi.po index 43bdfa0f9be..d44578b60e4 100644 --- a/po/hi.po +++ b/po/hi.po @@ -8228,7 +8228,7 @@ msgid "" msgstr "" #: net.rc:44 -msgid "%s %S %S Open resources: %lu\n" +msgid "%s %s %s Open resources: %lu\n" msgstr "" #: net.rc:45 diff --git a/po/hu.po b/po/hu.po index 9b67b42d23b..548944eef3b 100644 --- a/po/hu.po +++ b/po/hu.po @@ -8767,7 +8767,7 @@ msgid "" msgstr "" #: net.rc:44 -msgid "%s %S %S Open resources: %lu\n" +msgid "%s %s %s Open resources: %lu\n" msgstr "" #: net.rc:45 diff --git a/po/it.po b/po/it.po index 0a9a229e4ae..d2e27b4b1ce 100644 --- a/po/it.po +++ b/po/it.po @@ -9006,8 +9006,8 @@ msgstr "" "---------------------------------------------------------------\n" #: net.rc:44 -msgid "%s %S %S Open resources: %lu\n" -msgstr "%s %S %S Risorse aperte: %lu\n" +msgid "%s %s %s Open resources: %lu\n" +msgstr "%s %s %s Risorse aperte: %lu\n" #: net.rc:45 msgid "OK" diff --git a/po/ja.po b/po/ja.po index a61c863acc6..39233c10e95 100644 --- a/po/ja.po +++ b/po/ja.po @@ -8641,8 +8641,8 @@ msgstr "" "---------------------------------------------------------------\n" #: net.rc:44 -msgid "%s %S %S Open resources: %lu\n" -msgstr "%s %S %S リソース数: %lu\n" +msgid "%s %s %s Open resources: %lu\n" +msgstr "%s %s %s リソース数: %lu\n" #: net.rc:45 msgid "OK" diff --git a/po/ko.po b/po/ko.po index d00d9290105..107fc459189 100644 --- a/po/ko.po +++ b/po/ko.po @@ -8617,8 +8617,8 @@ msgstr "" "---------------------------------------------------------------\n" #: net.rc:44 -msgid "%s %S %S Open resources: %lu\n" -msgstr "%s %S %S 열린 리소스: %lu\n" +msgid "%s %s %s Open resources: %lu\n" +msgstr "%s %s %s 열린 리소스: %lu\n" #: net.rc:45 msgid "OK" diff --git a/po/lt.po b/po/lt.po index 63a44a76b3b..0f58c0dd501 100644 --- a/po/lt.po +++ b/po/lt.po @@ -8668,8 +8668,8 @@ msgstr "" "---------------------------------------------------------------\n" #: net.rc:44 -msgid "%s %S %S Open resources: %lu\n" -msgstr "%s %S %S Atverti ištekliai: %lu\n" +msgid "%s %s %s Open resources: %lu\n" +msgstr "%s %s %s Atverti ištekliai: %lu\n" #: net.rc:45 msgid "OK" diff --git a/po/ml.po b/po/ml.po index 0aa7fa36cbc..edbdf8c3729 100644 --- a/po/ml.po +++ b/po/ml.po @@ -8228,7 +8228,7 @@ msgid "" msgstr "" #: net.rc:44 -msgid "%s %S %S Open resources: %lu\n" +msgid "%s %s %s Open resources: %lu\n" msgstr "" #: net.rc:45 diff --git a/po/nb_NO.po b/po/nb_NO.po index 836f349f968..d32a71ef52e 100644 --- a/po/nb_NO.po +++ b/po/nb_NO.po @@ -8922,8 +8922,8 @@ msgstr "" "---------------------------------------------------------------\n" #: net.rc:44 -msgid "%s %S %S Open resources: %lu\n" -msgstr "%s %S %S Åpne ressurser: %lu\n" +msgid "%s %s %s Open resources: %lu\n" +msgstr "%s %s %s Åpne ressurser: %lu\n" #: net.rc:45 msgid "OK" diff --git a/po/nl.po b/po/nl.po index ff024205cf1..2e20aaaecaf 100644 --- a/po/nl.po +++ b/po/nl.po @@ -8808,8 +8808,8 @@ msgstr "" "---------------------------------------------------------------\n" #: net.rc:44 -msgid "%s %S %S Open resources: %lu\n" -msgstr "%s %S %S Open resources: %lu\n" +msgid "%s %s %s Open resources: %lu\n" +msgstr "%s %s %s Open resources: %lu\n" #: net.rc:45 msgid "OK" diff --git a/po/or.po b/po/or.po index 54b0ffe7cac..d48876252d9 100644 --- a/po/or.po +++ b/po/or.po @@ -8228,7 +8228,7 @@ msgid "" msgstr "" #: net.rc:44 -msgid "%s %S %S Open resources: %lu\n" +msgid "%s %s %s Open resources: %lu\n" msgstr "" #: net.rc:45 diff --git a/po/pa.po b/po/pa.po index e9406eb1652..183e7c127d9 100644 --- a/po/pa.po +++ b/po/pa.po @@ -8228,7 +8228,7 @@ msgid "" msgstr "" #: net.rc:44 -msgid "%s %S %S Open resources: %lu\n" +msgid "%s %s %s Open resources: %lu\n" msgstr "" #: net.rc:45 diff --git a/po/pl.po b/po/pl.po index 30cbb43fea1..8c222a11212 100644 --- a/po/pl.po +++ b/po/pl.po @@ -8672,8 +8672,8 @@ msgstr "" "---------------------------------------------------------------\n" #: net.rc:44 -msgid "%s %S %S Open resources: %lu\n" -msgstr "%s %S %S Otwarte zasoby: %lu\n" +msgid "%s %s %s Open resources: %lu\n" +msgstr "%s %s %s Otwarte zasoby: %lu\n" #: net.rc:45 msgid "OK" diff --git a/po/pt_BR.po b/po/pt_BR.po index 11978e509b2..8c2125a5195 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -8950,8 +8950,8 @@ msgstr "" "---------------------------------------------------------------\n" #: net.rc:44 -msgid "%s %S %S Open resources: %lu\n" -msgstr "%s %S %S Recursos disponíveis: %lu\n" +msgid "%s %s %s Open resources: %lu\n" +msgstr "%s %s %s Recursos disponíveis: %lu\n" #: net.rc:45 msgid "OK" diff --git a/po/pt_PT.po b/po/pt_PT.po index 7c622289a6c..f27ee90b70c 100644 --- a/po/pt_PT.po +++ b/po/pt_PT.po @@ -9003,8 +9003,8 @@ msgstr "" "---------------------------------------------------------------\n" #: net.rc:44 -msgid "%s %S %S Open resources: %lu\n" -msgstr "%s %S %S Recursos disponíveis: %lu\n" +msgid "%s %s %s Open resources: %lu\n" +msgstr "%s %s %s Recursos disponíveis: %lu\n" #: net.rc:45 msgid "OK" diff --git a/po/rm.po b/po/rm.po index c5475adf012..9a8dd66118b 100644 --- a/po/rm.po +++ b/po/rm.po @@ -8281,7 +8281,7 @@ msgid "" msgstr "" #: net.rc:44 -msgid "%s %S %S Open resources: %lu\n" +msgid "%s %s %s Open resources: %lu\n" msgstr "" #: net.rc:45 diff --git a/po/ro.po b/po/ro.po index 68c4cd6cd64..0e990ba5cb4 100644 --- a/po/ro.po +++ b/po/ro.po @@ -9239,8 +9239,8 @@ msgstr "" "---------------------------------------------------------------\n" #: net.rc:44 -msgid "%s %S %S Open resources: %lu\n" -msgstr "%s %S %S Resurse deschise: %lu\n" +msgid "%s %s %s Open resources: %lu\n" +msgstr "%s %s %s Resurse deschise: %lu\n" #: net.rc:45 msgid "OK" diff --git a/po/ru.po b/po/ru.po index adcd5ca01e5..838bfc75972 100644 --- a/po/ru.po +++ b/po/ru.po @@ -8662,8 +8662,8 @@ msgstr "" "---------------------------------------------------------------\n" #: net.rc:44 -msgid "%s %S %S Open resources: %lu\n" -msgstr "%s %S %S Открытых ресурсов: %lu\n" +msgid "%s %s %s Open resources: %lu\n" +msgstr "%s %s %s Открытых ресурсов: %lu\n" #: net.rc:45 msgid "OK" diff --git a/po/sk.po b/po/sk.po index 6e57928a210..b21e71cb670 100644 --- a/po/sk.po +++ b/po/sk.po @@ -8525,7 +8525,7 @@ msgid "" msgstr "" #: net.rc:44 -msgid "%s %S %S Open resources: %lu\n" +msgid "%s %s %s Open resources: %lu\n" msgstr "" #: net.rc:45 diff --git a/po/sl.po b/po/sl.po index 5af9aea943f..46ddb3fd596 100644 --- a/po/sl.po +++ b/po/sl.po @@ -8693,8 +8693,8 @@ msgstr "" "---------------------------------------------------------------\n" #: net.rc:44 -msgid "%s %S %S Open resources: %lu\n" -msgstr "%s %S %S Odprta sredstva: %lu\n" +msgid "%s %s %s Open resources: %lu\n" +msgstr "%s %s %s Odprta sredstva: %lu\n" #: net.rc:45 msgid "OK" diff --git a/po/sr_RS@cyrillic.po b/po/sr_RS@cyrillic.po index 56afbea222f..ed554f73640 100644 --- a/po/sr_RS@cyrillic.po +++ b/po/sr_RS@cyrillic.po @@ -8635,7 +8635,7 @@ msgid "" msgstr "" #: net.rc:44 -msgid "%s %S %S Open resources: %lu\n" +msgid "%s %s %s Open resources: %lu\n" msgstr "" #: net.rc:45 diff --git a/po/sr_RS@latin.po b/po/sr_RS@latin.po index 1af884dcd78..afd785b2f27 100644 --- a/po/sr_RS@latin.po +++ b/po/sr_RS@latin.po @@ -8689,7 +8689,7 @@ msgid "" msgstr "" #: net.rc:44 -msgid "%s %S %S Open resources: %lu\n" +msgid "%s %s %s Open resources: %lu\n" msgstr "" #: net.rc:45 diff --git a/po/sv.po b/po/sv.po index 0d2a6e2d69e..646233cd9a7 100644 --- a/po/sv.po +++ b/po/sv.po @@ -8672,8 +8672,8 @@ msgstr "" "---------------------------------------------------------------\n" #: net.rc:44 -msgid "%s %S %S Open resources: %lu\n" -msgstr "%s %S %S Öppna resurser: %lu\n" +msgid "%s %s %s Open resources: %lu\n" +msgstr "%s %s %s Öppna resurser: %lu\n" #: net.rc:45 msgid "OK" diff --git a/po/te.po b/po/te.po index e02238948b3..777897287c4 100644 --- a/po/te.po +++ b/po/te.po @@ -8228,7 +8228,7 @@ msgid "" msgstr "" #: net.rc:44 -msgid "%s %S %S Open resources: %lu\n" +msgid "%s %s %s Open resources: %lu\n" msgstr "" #: net.rc:45 diff --git a/po/th.po b/po/th.po index 30ce208e260..20b964c13c5 100644 --- a/po/th.po +++ b/po/th.po @@ -8375,7 +8375,7 @@ msgid "" msgstr "" #: net.rc:44 -msgid "%s %S %S Open resources: %lu\n" +msgid "%s %s %s Open resources: %lu\n" msgstr "" #: net.rc:45 diff --git a/po/tr.po b/po/tr.po index d8919b8307c..b599393d689 100644 --- a/po/tr.po +++ b/po/tr.po @@ -9027,7 +9027,7 @@ msgid "" msgstr "" #: net.rc:44 -msgid "%s %S %S Open resources: %lu\n" +msgid "%s %s %s Open resources: %lu\n" msgstr "" #: net.rc:45 diff --git a/po/uk.po b/po/uk.po index 14e9822f5c3..c40fada10f6 100644 --- a/po/uk.po +++ b/po/uk.po @@ -8650,8 +8650,8 @@ msgstr "" "---------------------------------------------------------------\n" #: net.rc:44 -msgid "%s %S %S Open resources: %lu\n" -msgstr "%s %S %S Відкритих ресурсів: %lu\n" +msgid "%s %s %s Open resources: %lu\n" +msgstr "%s %s %s Відкритих ресурсів: %lu\n" #: net.rc:45 msgid "OK" diff --git a/po/wa.po b/po/wa.po index c8b96d5766b..def7695663a 100644 --- a/po/wa.po +++ b/po/wa.po @@ -8341,7 +8341,7 @@ msgid "" msgstr "" #: net.rc:44 -msgid "%s %S %S Open resources: %lu\n" +msgid "%s %s %s Open resources: %lu\n" msgstr "" #: net.rc:45 diff --git a/po/wine.pot b/po/wine.pot index 9808e22e1b1..d58153ffc8c 100644 --- a/po/wine.pot +++ b/po/wine.pot @@ -8204,7 +8204,7 @@ msgid "" msgstr "" #: net.rc:44 -msgid "%s %S %S Open resources: %lu\n" +msgid "%s %s %s Open resources: %lu\n" msgstr "" #: net.rc:45 diff --git a/po/zh_CN.po b/po/zh_CN.po index 1e4c1b74089..ad824a80c5c 100644 --- a/po/zh_CN.po +++ b/po/zh_CN.po @@ -8620,7 +8620,7 @@ msgid "" msgstr "" #: net.rc:44 -msgid "%s %S %S Open resources: %lu\n" +msgid "%s %s %s Open resources: %lu\n" msgstr "" #: net.rc:45 diff --git a/po/zh_TW.po b/po/zh_TW.po index da34bce14e6..01946af6874 100644 --- a/po/zh_TW.po +++ b/po/zh_TW.po @@ -8678,7 +8678,7 @@ msgid "" msgstr "" #: net.rc:44 -msgid "%s %S %S Open resources: %lu\n" +msgid "%s %s %s Open resources: %lu\n" msgstr "" #: net.rc:45 diff --git a/programs/net/Makefile.in b/programs/net/Makefile.in index 0369b519868..ab8781d9c8e 100644 --- a/programs/net/Makefile.in +++ b/programs/net/Makefile.in @@ -1,5 +1,5 @@ MODULE = net.exe -APPMODE = -mconsole +APPMODE = -mconsole -municode IMPORTS = netapi32 user32 advapi32 EXTRADEFS = -DWINE_NO_UNICODE_MACROS diff --git a/programs/net/net.c b/programs/net/net.c index 92f6ea78751..0761571908d 100644 --- a/programs/net/net.c +++ b/programs/net/net.c @@ -16,10 +16,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include -#include #include #include +#include + #include "resources.h" #define NET_START 0001 @@ -27,35 +27,41 @@ static int output_string(int msg, ...) { - char msg_buffer[8192]; + WCHAR fmt[8192]; + WCHAR str[8192]; + int len; + DWORD count; va_list arguments; - LoadStringA(GetModuleHandleW(NULL), msg, msg_buffer, sizeof(msg_buffer)); + LoadStringW(GetModuleHandleW(NULL), msg, fmt, sizeof(fmt)); va_start(arguments, msg); - vprintf(msg_buffer, arguments); + len = vsprintfW(str, fmt, arguments); + WriteConsoleW(GetStdHandle(STD_OUTPUT_HANDLE), str, len, &count, NULL); va_end(arguments); return 0; } static BOOL output_error_string(DWORD error) { - LPSTR pBuffer; - if (FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | + LPWSTR pBuffer; + if (FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_ALLOCATE_BUFFER, - NULL, error, 0, (LPSTR)&pBuffer, 0, NULL)) + NULL, error, 0, (LPWSTR)&pBuffer, 0, NULL)) { - fputs(pBuffer, stdout); + DWORD count; + int len = lstrlenW(pBuffer); + WriteConsoleW(GetStdHandle(STD_OUTPUT_HANDLE), pBuffer, len, &count, NULL); LocalFree(pBuffer); return TRUE; } return FALSE; } -static BOOL net_use(int argc, char *argv[]) +static BOOL net_use(int argc, const WCHAR* argv[]) { USE_INFO_2 *buffer, *connection; DWORD read, total, resume_handle, rc, i; - char *status[STRING_RECONN-STRING_OK+1]; + WCHAR* status[STRING_RECONN-STRING_OK+1]; resume_handle = 0; buffer = NULL; @@ -66,8 +72,8 @@ static BOOL net_use(int argc, char *argv[]) /* Load the status strings */ for (i = 0; i < sizeof(status)/sizeof(*status); i++) { - status[i] = HeapAlloc(GetProcessHeap(), 0, 1024); - LoadStringA(hmod, STRING_OK+i, status[i], 1024); + status[i] = HeapAlloc(GetProcessHeap(), 0, 1024 * sizeof(**status)); + LoadStringW(hmod, STRING_OK+i, status[i], 1024); } do { @@ -133,12 +139,12 @@ static BOOL StopService(SC_HANDLE SCManager, SC_HANDLE serviceHandle) return result; } -static BOOL net_service(int operation, char *service_name) +static BOOL net_service(int operation, const WCHAR* service_name) { SC_HANDLE SCManager, serviceHandle; BOOL result = 0; - char service_display_name[4096]; - DWORD buffer_size = sizeof(service_display_name); + WCHAR service_display_name[4096]; + DWORD buffer_size; SCManager = OpenSCManagerW(NULL, NULL, SC_MANAGER_ALL_ACCESS); if(!SCManager) @@ -146,7 +152,7 @@ static BOOL net_service(int operation, char *service_name) output_string(STRING_NO_SCM); return FALSE; } - serviceHandle = OpenServiceA(SCManager, service_name, SC_MANAGER_ALL_ACCESS); + serviceHandle = OpenServiceW(SCManager, service_name, SC_MANAGER_ALL_ACCESS); if(!serviceHandle) { output_string(STRING_NO_SVCHANDLE); @@ -154,9 +160,9 @@ static BOOL net_service(int operation, char *service_name) return FALSE; } - - GetServiceDisplayNameA(SCManager, service_name, service_display_name, &buffer_size); - if (!service_display_name[0]) strcpy(service_display_name, service_name); + buffer_size = sizeof(service_display_name)/sizeof(*service_display_name); + GetServiceDisplayNameW(SCManager, service_name, service_display_name, &buffer_size); + if (!service_display_name[0]) lstrcpyW(service_display_name, service_name); switch(operation) { @@ -189,20 +195,29 @@ static BOOL net_service(int operation, char *service_name) return result; } -int main(int argc, char *argv[]) +static int arg_is(const WCHAR* str1, const WCHAR* str2) { + return CompareStringW(LOCALE_USER_DEFAULT, NORM_IGNORECASE, str1, -1, str2, -1) == CSTR_EQUAL; +} + +int wmain(int argc, const WCHAR* argv[]) +{ + static const WCHAR helpW[]={'h','e','l','p',0}; + static const WCHAR startW[]={'s','t','a','r','t',0}; + static const WCHAR stopW[]={'s','t','o','p',0}; + static const WCHAR useW[]={'u','s','e',0}; if (argc < 2) { output_string(STRING_USAGE); return 1; } - if(!strcasecmp(argv[1], "help")) + if(arg_is(argv[1], helpW)) { output_string(STRING_HELP_USAGE); } - if(!strcasecmp(argv[1], "start")) + if(arg_is(argv[1], startW)) { if(argc < 3) { @@ -217,7 +232,7 @@ int main(int argc, char *argv[]) return 0; } - if(!strcasecmp(argv[1], "stop")) + if(arg_is(argv[1], stopW)) { if(argc < 3) { @@ -232,7 +247,7 @@ int main(int argc, char *argv[]) return 0; } - if(!strcasecmp(argv[1], "use")) + if(arg_is(argv[1], useW)) { if(!net_use(argc, argv)) return 1; } diff --git a/programs/net/net.rc b/programs/net/net.rc index b8df6c9d1e2..9b691f9579f 100644 --- a/programs/net/net.rc +++ b/programs/net/net.rc @@ -41,7 +41,7 @@ STRINGTABLE " Commands available are:\n NET HELP NET START NET STOP NET USE\n" STRING_NO_ENTRIES, "There are no entries in the list.\n" STRING_USE_HEADER, "\nStatus Local Remote\n---------------------------------------------------------------\n" - STRING_USE_ENTRY, "%s %S %S Open resources: %lu\n" + STRING_USE_ENTRY, "%s %s %s Open resources: %lu\n" STRING_OK, "OK" STRING_PAUSED, "Paused" STRING_SESSLOST, "Disconnected"