Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
d8624c04
Commit
d8624c04
authored
Aug 05, 2011
by
Francois Gouget
Committed by
Alexandre Julliard
Aug 05, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
net: Convert to Unicode.
parent
9432b8e7
Hide whitespace changes
Inline
Side-by-side
Showing
48 changed files
with
107 additions
and
92 deletions
+107
-92
ar.po
po/ar.po
+1
-1
bg.po
po/bg.po
+1
-1
ca.po
po/ca.po
+1
-1
cs.po
po/cs.po
+1
-1
da.po
po/da.po
+2
-2
de.po
po/de.po
+2
-2
el.po
po/el.po
+1
-1
en.po
po/en.po
+2
-2
en_US.po
po/en_US.po
+2
-2
eo.po
po/eo.po
+1
-1
es.po
po/es.po
+1
-1
fa.po
po/fa.po
+1
-1
fi.po
po/fi.po
+1
-1
fr.po
po/fr.po
+2
-2
he.po
po/he.po
+2
-2
hi.po
po/hi.po
+1
-1
hu.po
po/hu.po
+1
-1
it.po
po/it.po
+2
-2
ja.po
po/ja.po
+2
-2
ko.po
po/ko.po
+2
-2
lt.po
po/lt.po
+2
-2
ml.po
po/ml.po
+1
-1
nb_NO.po
po/nb_NO.po
+2
-2
nl.po
po/nl.po
+2
-2
or.po
po/or.po
+1
-1
pa.po
po/pa.po
+1
-1
pl.po
po/pl.po
+2
-2
pt_BR.po
po/pt_BR.po
+2
-2
pt_PT.po
po/pt_PT.po
+2
-2
rm.po
po/rm.po
+1
-1
ro.po
po/ro.po
+2
-2
ru.po
po/ru.po
+2
-2
sk.po
po/sk.po
+1
-1
sl.po
po/sl.po
+2
-2
sr_RS@cyrillic.po
po/sr_RS@cyrillic.po
+1
-1
sr_RS@latin.po
po/sr_RS@latin.po
+1
-1
sv.po
po/sv.po
+2
-2
te.po
po/te.po
+1
-1
th.po
po/th.po
+1
-1
tr.po
po/tr.po
+1
-1
uk.po
po/uk.po
+2
-2
wa.po
po/wa.po
+1
-1
wine.pot
po/wine.pot
+1
-1
zh_CN.po
po/zh_CN.po
+1
-1
zh_TW.po
po/zh_TW.po
+1
-1
Makefile.in
programs/net/Makefile.in
+1
-1
net.c
programs/net/net.c
+40
-25
net.rc
programs/net/net.rc
+1
-1
No files found.
po/ar.po
View file @
d8624c04
...
...
@@ -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
...
...
po/bg.po
View file @
d8624c04
...
...
@@ -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
...
...
po/ca.po
View file @
d8624c04
...
...
@@ -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
...
...
po/cs.po
View file @
d8624c04
...
...
@@ -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
...
...
po/da.po
View file @
d8624c04
...
...
@@ -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"
...
...
po/de.po
View file @
d8624c04
...
...
@@ -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"
...
...
po/el.po
View file @
d8624c04
...
...
@@ -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
...
...
po/en.po
View file @
d8624c04
...
...
@@ -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"
...
...
po/en_US.po
View file @
d8624c04
...
...
@@ -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"
...
...
po/eo.po
View file @
d8624c04
...
...
@@ -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
...
...
po/es.po
View file @
d8624c04
...
...
@@ -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
...
...
po/fa.po
View file @
d8624c04
...
...
@@ -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
...
...
po/fi.po
View file @
d8624c04
...
...
@@ -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
...
...
po/fr.po
View file @
d8624c04
...
...
@@ -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"
...
...
po/he.po
View file @
d8624c04
...
...
@@ -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"
...
...
po/hi.po
View file @
d8624c04
...
...
@@ -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
...
...
po/hu.po
View file @
d8624c04
...
...
@@ -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
...
...
po/it.po
View file @
d8624c04
...
...
@@ -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"
...
...
po/ja.po
View file @
d8624c04
...
...
@@ -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"
...
...
po/ko.po
View file @
d8624c04
...
...
@@ -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"
...
...
po/lt.po
View file @
d8624c04
...
...
@@ -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"
...
...
po/ml.po
View file @
d8624c04
...
...
@@ -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
...
...
po/nb_NO.po
View file @
d8624c04
...
...
@@ -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"
...
...
po/nl.po
View file @
d8624c04
...
...
@@ -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"
...
...
po/or.po
View file @
d8624c04
...
...
@@ -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
...
...
po/pa.po
View file @
d8624c04
...
...
@@ -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
...
...
po/pl.po
View file @
d8624c04
...
...
@@ -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"
...
...
po/pt_BR.po
View file @
d8624c04
...
...
@@ -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"
...
...
po/pt_PT.po
View file @
d8624c04
...
...
@@ -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"
...
...
po/rm.po
View file @
d8624c04
...
...
@@ -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
...
...
po/ro.po
View file @
d8624c04
...
...
@@ -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"
...
...
po/ru.po
View file @
d8624c04
...
...
@@ -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"
...
...
po/sk.po
View file @
d8624c04
...
...
@@ -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
...
...
po/sl.po
View file @
d8624c04
...
...
@@ -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"
...
...
po/sr_RS@cyrillic.po
View file @
d8624c04
...
...
@@ -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
...
...
po/sr_RS@latin.po
View file @
d8624c04
...
...
@@ -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
...
...
po/sv.po
View file @
d8624c04
...
...
@@ -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"
...
...
po/te.po
View file @
d8624c04
...
...
@@ -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
...
...
po/th.po
View file @
d8624c04
...
...
@@ -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
...
...
po/tr.po
View file @
d8624c04
...
...
@@ -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
...
...
po/uk.po
View file @
d8624c04
...
...
@@ -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"
...
...
po/wa.po
View file @
d8624c04
...
...
@@ -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
...
...
po/wine.pot
View file @
d8624c04
...
...
@@ -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
...
...
po/zh_CN.po
View file @
d8624c04
...
...
@@ -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
...
...
po/zh_TW.po
View file @
d8624c04
...
...
@@ -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
...
...
programs/net/Makefile.in
View file @
d8624c04
MODULE
=
net.exe
APPMODE
=
-mconsole
APPMODE
=
-mconsole
-municode
IMPORTS
=
netapi32 user32 advapi32
EXTRADEFS
=
-DWINE_NO_UNICODE_MACROS
...
...
programs/net/net.c
View file @
d8624c04
...
...
@@ -16,10 +16,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <stdio.h>
#include <string.h>
#include <windows.h>
#include <lm.h>
#include <wine/unicode.h>
#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
;
LoadString
A
(
GetModuleHandleW
(
NULL
),
msg
,
msg_buffer
,
sizeof
(
msg_buffer
));
LoadString
W
(
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
(
FormatMessage
A
(
FORMAT_MESSAGE_FROM_SYSTEM
|
LP
W
STR
pBuffer
;
if
(
FormatMessage
W
(
FORMAT_MESSAGE_FROM_SYSTEM
|
FORMAT_MESSAGE_IGNORE_INSERTS
|
FORMAT_MESSAGE_ALLOCATE_BUFFER
,
NULL
,
error
,
0
,
(
LPSTR
)
&
pBuffer
,
0
,
NULL
))
NULL
,
error
,
0
,
(
LP
W
STR
)
&
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
,
c
har
*
argv
[])
static
BOOL
net_use
(
int
argc
,
c
onst
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
);
LoadString
A
(
hmod
,
STRING_OK
+
i
,
status
[
i
],
1024
);
status
[
i
]
=
HeapAlloc
(
GetProcessHeap
(),
0
,
1024
*
sizeof
(
**
status
)
);
LoadString
W
(
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
,
c
har
*
service_name
)
static
BOOL
net_service
(
int
operation
,
c
onst
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
=
OpenService
A
(
SCManager
,
service_name
,
SC_MANAGER_ALL_ACCESS
);
serviceHandle
=
OpenService
W
(
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
;
}
GetServiceDisplayName
A
(
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
);
GetServiceDisplayName
W
(
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
;
}
...
...
programs/net/net.rc
View file @
d8624c04
...
...
@@ -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"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment