Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
620323e2
Commit
620323e2
authored
Jan 24, 2003
by
Matthew Davison
Committed by
Alexandre Julliard
Jan 24, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed some Unicode -> Ascii cross-calls.
parent
f2710545
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
14 deletions
+25
-14
service.c
dlls/advapi32/service.c
+25
-14
No files found.
dlls/advapi32/service.c
View file @
620323e2
...
...
@@ -133,13 +133,16 @@ StartServiceCtrlDispatcherA( LPSERVICE_TABLE_ENTRYA servent )
BOOL
WINAPI
StartServiceCtrlDispatcherW
(
LPSERVICE_TABLE_ENTRYW
servent
)
{
static
const
WCHAR
_ServiceStartDataW
[]
=
{
'A'
,
'D'
,
'V'
,
'A'
,
'P'
,
'I'
,
'_'
,
'S'
,
'e'
,
'r'
,
'v'
,
'i'
,
'c'
,
'e'
,
'S'
,
't'
,
'a'
,
'r'
,
't'
,
'D'
,
'a'
,
't'
,
'a'
,
0
};
LPSERVICE_MAIN_FUNCTIONW
fpMain
;
HANDLE
wait
;
DWORD
dwNumServiceArgs
;
LPWSTR
*
lpServiceArgVectors
;
TRACE
(
"(%p)
\n
"
,
servent
);
wait
=
OpenSemaphore
A
(
SEMAPHORE_ALL_ACCESS
,
FALSE
,
"ADVAPI32_ServiceStartData"
);
wait
=
OpenSemaphore
W
(
SEMAPHORE_ALL_ACCESS
,
FALSE
,
_ServiceStartDataW
);
if
(
wait
==
0
)
{
ERR
(
"Couldn't find wait semaphore
\n
"
);
...
...
@@ -603,37 +606,45 @@ BOOL WINAPI
StartServiceW
(
SC_HANDLE
hService
,
DWORD
dwNumServiceArgs
,
LPCWSTR
*
lpServiceArgVectors
)
{
CHAR
path
[
MAX_PATH
],
str
[
MAX_PATH
];
static
const
WCHAR
_ServiceStartDataW
[]
=
{
'A'
,
'D'
,
'V'
,
'A'
,
'P'
,
'I'
,
'_'
,
'S'
,
'e'
,
'r'
,
'v'
,
'i'
,
'c'
,
'e'
,
'S'
,
't'
,
'a'
,
'r'
,
't'
,
'D'
,
'a'
,
't'
,
'a'
,
0
};
static
const
WCHAR
_WaitServiceStartW
[]
=
{
'A'
,
'D'
,
'V'
,
'A'
,
'P'
,
'I'
,
'_'
,
'W'
,
'a'
,
'i'
,
't'
,
'S'
,
'e'
,
'r'
,
'v'
,
'i'
,
'c'
,
'e'
,
'S'
,
't'
,
'a'
,
'r'
,
't'
,
0
};
static
const
WCHAR
_ImagePathW
[]
=
{
'I'
,
'm'
,
'a'
,
'g'
,
'e'
,
'P'
,
'a'
,
't'
,
'h'
,
0
};
WCHAR
path
[
MAX_PATH
],
str
[
MAX_PATH
];
DWORD
type
,
size
;
long
r
;
HANDLE
data
,
wait
;
PROCESS_INFORMATION
procinfo
;
STARTUPINFOA
startupinfo
;
STARTUPINFOW
startupinfo
;
TRACE
(
"(%p,%ld,%p)
\n
"
,
hService
,
dwNumServiceArgs
,
lpServiceArgVectors
);
size
=
sizeof
str
;
r
=
RegQueryValueEx
A
(
hService
,
"ImagePath"
,
NULL
,
&
type
,
(
LPVOID
)
str
,
&
size
);
r
=
RegQueryValueEx
W
(
hService
,
_ImagePathW
,
NULL
,
&
type
,
(
LPVOID
)
str
,
&
size
);
if
(
r
!=
ERROR_SUCCESS
)
return
FALSE
;
ExpandEnvironmentStrings
A
(
str
,
path
,
sizeof
path
);
ExpandEnvironmentStrings
W
(
str
,
path
,
sizeof
path
);
TRACE
(
"Starting service %s
\n
"
,
debugstr_
a
(
path
)
);
TRACE
(
"Starting service %s
\n
"
,
debugstr_
w
(
path
)
);
data
=
CreateSemaphore
A
(
NULL
,
1
,
1
,
"ADVAPI32_ServiceStartData"
);
data
=
CreateSemaphore
W
(
NULL
,
1
,
1
,
_ServiceStartDataW
);
if
(
!
data
)
{
data
=
OpenSemaphore
A
(
SEMAPHORE_ALL_ACCESS
,
FALSE
,
"ADVAPI32_ServiceStartData"
);
data
=
OpenSemaphore
W
(
SEMAPHORE_ALL_ACCESS
,
FALSE
,
_ServiceStartDataW
);
if
(
data
==
0
)
{
ERR
(
"Couldn't create data semaphore
\n
"
);
return
FALSE
;
}
}
wait
=
CreateSemaphore
A
(
NULL
,
0
,
1
,
"ADVAPI32_WaitServiceStart"
);
wait
=
CreateSemaphore
W
(
NULL
,
0
,
1
,
_WaitServiceStartW
);
{
wait
=
OpenSemaphore
A
(
SEMAPHORE_ALL_ACCESS
,
FALSE
,
"ADVAPI32_ServiceStartData"
);
wait
=
OpenSemaphore
W
(
SEMAPHORE_ALL_ACCESS
,
FALSE
,
_ServiceStartDataW
);
if
(
wait
==
0
)
{
ERR
(
"Couldn't create wait semaphore
\n
"
);
...
...
@@ -658,10 +669,10 @@ StartServiceW( SC_HANDLE hService, DWORD dwNumServiceArgs,
start_dwNumServiceArgs
=
dwNumServiceArgs
;
start_lpServiceArgVectors
=
(
LPWSTR
*
)
lpServiceArgVectors
;
ZeroMemory
(
&
startupinfo
,
sizeof
(
STARTUPINFO
A
));
startupinfo
.
cb
=
sizeof
(
STARTUPINFO
A
);
ZeroMemory
(
&
startupinfo
,
sizeof
(
STARTUPINFO
W
));
startupinfo
.
cb
=
sizeof
(
STARTUPINFO
W
);
r
=
CreateProcess
A
(
path
,
r
=
CreateProcess
W
(
path
,
NULL
,
NULL
,
/* process security attribs */
NULL
,
/* thread security attribs */
...
...
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