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
305fcef6
Commit
305fcef6
authored
Dec 09, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
net: Use the explicit name for all A/W function.
parent
79b00726
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
9 deletions
+10
-9
Makefile.in
programs/net/Makefile.in
+1
-0
net.c
programs/net/net.c
+9
-9
No files found.
programs/net/Makefile.in
View file @
305fcef6
...
@@ -5,6 +5,7 @@ VPATH = @srcdir@
...
@@ -5,6 +5,7 @@ VPATH = @srcdir@
MODULE
=
net.exe
MODULE
=
net.exe
APPMODE
=
-mconsole
APPMODE
=
-mconsole
IMPORTS
=
netapi32 user32 advapi32 kernel32
IMPORTS
=
netapi32 user32 advapi32 kernel32
EXTRADEFS
=
-DWINE_NO_UNICODE_MACROS
C_SRCS
=
net.c
C_SRCS
=
net.c
...
...
programs/net/net.c
View file @
305fcef6
...
@@ -30,7 +30,7 @@ static int output_string(int msg, ...)
...
@@ -30,7 +30,7 @@ static int output_string(int msg, ...)
char
msg_buffer
[
8192
];
char
msg_buffer
[
8192
];
va_list
arguments
;
va_list
arguments
;
LoadString
(
GetModuleHandle
(
NULL
),
msg
,
msg_buffer
,
sizeof
(
msg_buffer
));
LoadString
A
(
GetModuleHandleW
(
NULL
),
msg
,
msg_buffer
,
sizeof
(
msg_buffer
));
va_start
(
arguments
,
msg
);
va_start
(
arguments
,
msg
);
vprintf
(
msg_buffer
,
arguments
);
vprintf
(
msg_buffer
,
arguments
);
va_end
(
arguments
);
va_end
(
arguments
);
...
@@ -92,24 +92,24 @@ static BOOL net_use(int argc, char *argv[])
...
@@ -92,24 +92,24 @@ static BOOL net_use(int argc, char *argv[])
static
BOOL
StopService
(
SC_HANDLE
SCManager
,
SC_HANDLE
serviceHandle
)
static
BOOL
StopService
(
SC_HANDLE
SCManager
,
SC_HANDLE
serviceHandle
)
{
{
LPENUM_SERVICE_STATUS
dependencies
=
NULL
;
LPENUM_SERVICE_STATUS
W
dependencies
=
NULL
;
DWORD
buffer_size
=
0
;
DWORD
buffer_size
=
0
;
DWORD
count
=
0
,
counter
;
DWORD
count
=
0
,
counter
;
BOOL
result
;
BOOL
result
;
SC_HANDLE
dependent_serviceHandle
;
SC_HANDLE
dependent_serviceHandle
;
SERVICE_STATUS_PROCESS
ssp
;
SERVICE_STATUS_PROCESS
ssp
;
result
=
EnumDependentServices
(
serviceHandle
,
SERVICE_ACTIVE
,
dependencies
,
buffer_size
,
&
buffer_size
,
&
count
);
result
=
EnumDependentServices
W
(
serviceHandle
,
SERVICE_ACTIVE
,
dependencies
,
buffer_size
,
&
buffer_size
,
&
count
);
if
(
!
result
&&
(
GetLastError
()
==
ERROR_MORE_DATA
))
if
(
!
result
&&
(
GetLastError
()
==
ERROR_MORE_DATA
))
{
{
dependencies
=
HeapAlloc
(
GetProcessHeap
(),
0
,
buffer_size
);
dependencies
=
HeapAlloc
(
GetProcessHeap
(),
0
,
buffer_size
);
if
(
EnumDependentServices
(
serviceHandle
,
SERVICE_ACTIVE
,
dependencies
,
buffer_size
,
&
buffer_size
,
&
count
))
if
(
EnumDependentServices
W
(
serviceHandle
,
SERVICE_ACTIVE
,
dependencies
,
buffer_size
,
&
buffer_size
,
&
count
))
{
{
for
(
counter
=
0
;
counter
<
count
;
counter
++
)
for
(
counter
=
0
;
counter
<
count
;
counter
++
)
{
{
output_string
(
STRING_STOP_DEP
,
dependencies
[
counter
].
lpDisplayName
);
output_string
(
STRING_STOP_DEP
,
dependencies
[
counter
].
lpDisplayName
);
dependent_serviceHandle
=
OpenService
(
SCManager
,
dependencies
[
counter
].
lpServiceName
,
SC_MANAGER_ALL_ACCESS
);
dependent_serviceHandle
=
OpenService
W
(
SCManager
,
dependencies
[
counter
].
lpServiceName
,
SC_MANAGER_ALL_ACCESS
);
if
(
dependent_serviceHandle
)
result
=
StopService
(
SCManager
,
dependent_serviceHandle
);
if
(
dependent_serviceHandle
)
result
=
StopService
(
SCManager
,
dependent_serviceHandle
);
CloseServiceHandle
(
dependent_serviceHandle
);
CloseServiceHandle
(
dependent_serviceHandle
);
if
(
!
result
)
output_string
(
STRING_CANT_STOP
,
dependencies
[
counter
].
lpDisplayName
);
if
(
!
result
)
output_string
(
STRING_CANT_STOP
,
dependencies
[
counter
].
lpDisplayName
);
...
@@ -129,13 +129,13 @@ static BOOL net_service(int operation, char *service_name)
...
@@ -129,13 +129,13 @@ static BOOL net_service(int operation, char *service_name)
char
service_display_name
[
4096
];
char
service_display_name
[
4096
];
DWORD
buffer_size
=
sizeof
(
service_display_name
);
DWORD
buffer_size
=
sizeof
(
service_display_name
);
SCManager
=
OpenSCManager
(
NULL
,
NULL
,
SC_MANAGER_ALL_ACCESS
);
SCManager
=
OpenSCManager
W
(
NULL
,
NULL
,
SC_MANAGER_ALL_ACCESS
);
if
(
!
SCManager
)
if
(
!
SCManager
)
{
{
output_string
(
STRING_NO_SCM
);
output_string
(
STRING_NO_SCM
);
return
FALSE
;
return
FALSE
;
}
}
serviceHandle
=
OpenService
(
SCManager
,
service_name
,
SC_MANAGER_ALL_ACCESS
);
serviceHandle
=
OpenService
A
(
SCManager
,
service_name
,
SC_MANAGER_ALL_ACCESS
);
if
(
!
serviceHandle
)
if
(
!
serviceHandle
)
{
{
output_string
(
STRING_NO_SVCHANDLE
);
output_string
(
STRING_NO_SVCHANDLE
);
...
@@ -144,14 +144,14 @@ static BOOL net_service(int operation, char *service_name)
...
@@ -144,14 +144,14 @@ static BOOL net_service(int operation, char *service_name)
}
}
GetServiceDisplayName
(
SCManager
,
service_name
,
service_display_name
,
&
buffer_size
);
GetServiceDisplayName
A
(
SCManager
,
service_name
,
service_display_name
,
&
buffer_size
);
if
(
!
service_display_name
[
0
])
strcpy
(
service_display_name
,
service_name
);
if
(
!
service_display_name
[
0
])
strcpy
(
service_display_name
,
service_name
);
switch
(
operation
)
switch
(
operation
)
{
{
case
NET_START
:
case
NET_START
:
output_string
(
STRING_START_SVC
,
service_display_name
);
output_string
(
STRING_START_SVC
,
service_display_name
);
result
=
StartService
(
serviceHandle
,
0
,
NULL
);
result
=
StartService
W
(
serviceHandle
,
0
,
NULL
);
if
(
result
)
output_string
(
STRING_START_SVC_SUCCESS
,
service_display_name
);
if
(
result
)
output_string
(
STRING_START_SVC_SUCCESS
,
service_display_name
);
else
else
...
...
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