Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
be719e08
Commit
be719e08
authored
Jan 14, 2013
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NTservice: force use of ANSI versions of APIs
parent
547e8b09
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
modules/control/ntservice.c
modules/control/ntservice.c
+9
-6
No files found.
modules/control/ntservice.c
View file @
be719e08
...
...
@@ -31,6 +31,7 @@
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_interface.h>
#include <vlc_charset.h>
#define VLCSERVICENAME "VLC media player"
...
...
@@ -139,7 +140,7 @@ static void *Run( void *data )
intf_thread_t
*
p_intf
=
data
;
SERVICE_TABLE_ENTRY
dispatchTable
[]
=
{
{
(
LPTSTR
)
VLCSERVICENAME
,
&
ServiceDispatch
},
{
TEXT
(
VLCSERVICENAME
)
,
&
ServiceDispatch
},
{
NULL
,
NULL
}
};
...
...
@@ -178,7 +179,9 @@ static void *Run( void *data )
static
int
NTServiceInstall
(
intf_thread_t
*
p_intf
)
{
intf_sys_t
*
p_sys
=
p_intf
->
p_sys
;
char
psz_path
[
10
*
MAX_PATH
],
psz_pathtmp
[
MAX_PATH
],
*
psz_extra
;
char
psz_path
[
10
*
MAX_PATH
],
*
psz_extra
;
TCHAR
psz_pathtmp
[
MAX_PATH
];
SC_HANDLE
handle
=
OpenSCManager
(
NULL
,
NULL
,
SC_MANAGER_ALL_ACCESS
);
if
(
handle
==
NULL
)
{
...
...
@@ -190,7 +193,7 @@ static int NTServiceInstall( intf_thread_t *p_intf )
/* Find out the filename of ourselves so we can install it to the
* service control manager */
GetModuleFileName
(
NULL
,
psz_pathtmp
,
MAX_PATH
);
sprintf
(
psz_path
,
"
\"
%s
\"
-I "
MODULE_STRING
,
psz_pathtmp
);
sprintf
(
psz_path
,
"
\"
%s
\"
-I "
MODULE_STRING
,
FromT
(
psz_pathtmp
)
);
psz_extra
=
var_InheritString
(
p_intf
,
"ntservice-extraintf"
);
if
(
psz_extra
)
...
...
@@ -209,7 +212,7 @@ static int NTServiceInstall( intf_thread_t *p_intf )
}
SC_HANDLE
service
=
CreateService
(
handle
,
p_sys
->
psz_service
,
p_sys
->
psz_service
,
CreateService
A
(
handle
,
p_sys
->
psz_service
,
p_sys
->
psz_service
,
GENERIC_READ
|
GENERIC_EXECUTE
,
SERVICE_WIN32_OWN_PROCESS
,
SERVICE_AUTO_START
,
SERVICE_ERROR_IGNORE
,
...
...
@@ -253,7 +256,7 @@ static int NTServiceUninstall( intf_thread_t *p_intf )
}
/* First, open a handle to the service */
SC_HANDLE
service
=
OpenService
(
handle
,
p_sys
->
psz_service
,
DELETE
);
SC_HANDLE
service
=
OpenService
A
(
handle
,
p_sys
->
psz_service
,
DELETE
);
if
(
service
==
NULL
)
{
msg_Err
(
p_intf
,
"could not open service"
);
...
...
@@ -293,7 +296,7 @@ static void WINAPI ServiceDispatch( DWORD numArgs, char **args )
p_sys
->
status
.
dwControlsAccepted
=
SERVICE_ACCEPT_STOP
;
p_sys
->
hStatus
=
RegisterServiceCtrlHandler
(
p_sys
->
psz_service
,
&
ServiceCtrlHandler
);
RegisterServiceCtrlHandler
A
(
p_sys
->
psz_service
,
&
ServiceCtrlHandler
);
if
(
p_sys
->
hStatus
==
(
SERVICE_STATUS_HANDLE
)
0
)
{
msg_Err
(
p_intf
,
"failed to register service control handler"
);
...
...
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