Does every windows service calls its executable main function?
I have a very basic question about windows services, I have this main
function which install I can use it to install my service, And also there are some configuration data that are loaded inside main function:
int
wmain(int argc, WCHAR* argv)
{
// it reads config and fill a global struct.
ReadConfig();
// if command == 'install'
install_service();
}
and here is the service main function:
void WINAPI ServiceMain(DWORD argc, WCHAR* argv)
{
// this method retrieves the global config object.
auto config_data = GetConfigData();
// service stuff
}
and here is another function which is called in my wmain
function if it is run without any arguments (argc = 0 !):
bool
ServiceRunAsService()
{
static const SERVICE_TABLE_ENTRY table = {
{ SERVICE_NAME, ServiceMain },
{ NULL, NULL }
};
g_hStopService = CreateEvent(0, TRUE, FALSE, 0);
return StartServiceCtrlDispatcher(table) && GetLastError() != ERROR_FAILED_SERVICE_CONTROLLER_CONNECT;
}
My question is that when windows wants to run my service(after the PC has been shut down and turn on again), Does it call my wmain
function (and hence call the ReadConfig
function) or call the registered ServiceMain
function?
I want to point that the install_service
method, finds the path of executable by GetModuleFileName
and pass that to CreateService
and ScmManager
c++ windows winapi windows-services
add a comment |
I have a very basic question about windows services, I have this main
function which install I can use it to install my service, And also there are some configuration data that are loaded inside main function:
int
wmain(int argc, WCHAR* argv)
{
// it reads config and fill a global struct.
ReadConfig();
// if command == 'install'
install_service();
}
and here is the service main function:
void WINAPI ServiceMain(DWORD argc, WCHAR* argv)
{
// this method retrieves the global config object.
auto config_data = GetConfigData();
// service stuff
}
and here is another function which is called in my wmain
function if it is run without any arguments (argc = 0 !):
bool
ServiceRunAsService()
{
static const SERVICE_TABLE_ENTRY table = {
{ SERVICE_NAME, ServiceMain },
{ NULL, NULL }
};
g_hStopService = CreateEvent(0, TRUE, FALSE, 0);
return StartServiceCtrlDispatcher(table) && GetLastError() != ERROR_FAILED_SERVICE_CONTROLLER_CONNECT;
}
My question is that when windows wants to run my service(after the PC has been shut down and turn on again), Does it call my wmain
function (and hence call the ReadConfig
function) or call the registered ServiceMain
function?
I want to point that the install_service
method, finds the path of executable by GetModuleFileName
and pass that to CreateService
and ScmManager
c++ windows winapi windows-services
Why not just check? Output a log message.
– Yakk - Adam Nevraumont
Nov 24 '18 at 20:38
Honestly I found it difficult to log messages in service ! I don't know how
– Rathma
Nov 24 '18 at 20:39
of course windows call exe entry point. sowmain
. system have no any knowledge aboutServiceMain
until you not callStartServiceCtrlDispatcher
– RbMm
Nov 24 '18 at 20:46
add a comment |
I have a very basic question about windows services, I have this main
function which install I can use it to install my service, And also there are some configuration data that are loaded inside main function:
int
wmain(int argc, WCHAR* argv)
{
// it reads config and fill a global struct.
ReadConfig();
// if command == 'install'
install_service();
}
and here is the service main function:
void WINAPI ServiceMain(DWORD argc, WCHAR* argv)
{
// this method retrieves the global config object.
auto config_data = GetConfigData();
// service stuff
}
and here is another function which is called in my wmain
function if it is run without any arguments (argc = 0 !):
bool
ServiceRunAsService()
{
static const SERVICE_TABLE_ENTRY table = {
{ SERVICE_NAME, ServiceMain },
{ NULL, NULL }
};
g_hStopService = CreateEvent(0, TRUE, FALSE, 0);
return StartServiceCtrlDispatcher(table) && GetLastError() != ERROR_FAILED_SERVICE_CONTROLLER_CONNECT;
}
My question is that when windows wants to run my service(after the PC has been shut down and turn on again), Does it call my wmain
function (and hence call the ReadConfig
function) or call the registered ServiceMain
function?
I want to point that the install_service
method, finds the path of executable by GetModuleFileName
and pass that to CreateService
and ScmManager
c++ windows winapi windows-services
I have a very basic question about windows services, I have this main
function which install I can use it to install my service, And also there are some configuration data that are loaded inside main function:
int
wmain(int argc, WCHAR* argv)
{
// it reads config and fill a global struct.
ReadConfig();
// if command == 'install'
install_service();
}
and here is the service main function:
void WINAPI ServiceMain(DWORD argc, WCHAR* argv)
{
// this method retrieves the global config object.
auto config_data = GetConfigData();
// service stuff
}
and here is another function which is called in my wmain
function if it is run without any arguments (argc = 0 !):
bool
ServiceRunAsService()
{
static const SERVICE_TABLE_ENTRY table = {
{ SERVICE_NAME, ServiceMain },
{ NULL, NULL }
};
g_hStopService = CreateEvent(0, TRUE, FALSE, 0);
return StartServiceCtrlDispatcher(table) && GetLastError() != ERROR_FAILED_SERVICE_CONTROLLER_CONNECT;
}
My question is that when windows wants to run my service(after the PC has been shut down and turn on again), Does it call my wmain
function (and hence call the ReadConfig
function) or call the registered ServiceMain
function?
I want to point that the install_service
method, finds the path of executable by GetModuleFileName
and pass that to CreateService
and ScmManager
c++ windows winapi windows-services
c++ windows winapi windows-services
asked Nov 24 '18 at 20:23
RathmaRathma
26011035
26011035
Why not just check? Output a log message.
– Yakk - Adam Nevraumont
Nov 24 '18 at 20:38
Honestly I found it difficult to log messages in service ! I don't know how
– Rathma
Nov 24 '18 at 20:39
of course windows call exe entry point. sowmain
. system have no any knowledge aboutServiceMain
until you not callStartServiceCtrlDispatcher
– RbMm
Nov 24 '18 at 20:46
add a comment |
Why not just check? Output a log message.
– Yakk - Adam Nevraumont
Nov 24 '18 at 20:38
Honestly I found it difficult to log messages in service ! I don't know how
– Rathma
Nov 24 '18 at 20:39
of course windows call exe entry point. sowmain
. system have no any knowledge aboutServiceMain
until you not callStartServiceCtrlDispatcher
– RbMm
Nov 24 '18 at 20:46
Why not just check? Output a log message.
– Yakk - Adam Nevraumont
Nov 24 '18 at 20:38
Why not just check? Output a log message.
– Yakk - Adam Nevraumont
Nov 24 '18 at 20:38
Honestly I found it difficult to log messages in service ! I don't know how
– Rathma
Nov 24 '18 at 20:39
Honestly I found it difficult to log messages in service ! I don't know how
– Rathma
Nov 24 '18 at 20:39
of course windows call exe entry point. so
wmain
. system have no any knowledge about ServiceMain
until you not call StartServiceCtrlDispatcher
– RbMm
Nov 24 '18 at 20:46
of course windows call exe entry point. so
wmain
. system have no any knowledge about ServiceMain
until you not call StartServiceCtrlDispatcher
– RbMm
Nov 24 '18 at 20:46
add a comment |
2 Answers
2
active
oldest
votes
when executable is started, no matter for what reason, the exe entry point is called (if process not crashed or hooked before). so in your case always wmainCRTStartup
(or what is name of your exe real entry point) which call your wmain
. so yes - your wamin
will be called every time when your executable file start.
and system simply can not just call ServiceMain
anyway. it simply don't know it address. and it not registered. when you register exe service you register the command line for your service, but not any exported name inside exe. your executable became service and register ServiceMain
only after StartServiceCtrlDispatcher
, which must be called from your wmain
even in case dll form service which work with svchost.exe
- you register exported function which must be called from your dll as service entry point, or ServiceMain
by default. but anyway even in this case first your DllMain
(dll entry point) will be called (if exist). in case exe - entry point is mandatory and always will be called
So in the end my executable is called without any arguments which then lead toServiceRunAsService
being called (which of course gets called when argc == 0) ?
– Rathma
Nov 24 '18 at 21:13
1
@Rachmaninoff - this depend from how you register your service viaCreateService
- what is in lpBinaryPathName (or ImagePath in registry)- service actually can have and not empty command line. if you mix exe for normal start and work as service - you need analyze command line, detect that you run as service and callStartServiceCtrlDispatcher
. if your executable design run only as service (you register it via another app) - you unconditionally callStartServiceCtrlDispatcher
. anyway - you became service only afterStartServiceCtrlDispatcher
call andwmain
always called on start
– RbMm
Nov 24 '18 at 21:18
I give the path of executable toCreateService
's lpBinaryPathName
– Rathma
Nov 24 '18 at 21:31
1
@Rachmaninoff - this not change main point. you can use as now empty command line. or some special, for indicate that you run as service. inwmain
you based on command line or callStartServiceCtrlDispatcher
or do another tasks, like register/unregister
– RbMm
Nov 24 '18 at 21:43
add a comment |
When the OS executes your EXE, it calls your EXE's entry point, which then calls your code's (w)main()
function. When running as a service, your code must call StartServiceCtrlDispatcher()
, which loops on processing messages from the service controller and calls your ServiceMain()
.
No, the OS will definitely not callmain
. The OS will call whatever is specified as the entry point in the PE header. That is notmain
, simply because it doesn't even have the correct signature. Unclear, why this was upvoted. It is blatantly wrong, and doesn't acknowledge, that this question is asking about Windows Services, not just any old application.
– IInspectable
Nov 24 '18 at 22:04
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53462047%2fdoes-every-windows-service-calls-its-executable-main-function%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
when executable is started, no matter for what reason, the exe entry point is called (if process not crashed or hooked before). so in your case always wmainCRTStartup
(or what is name of your exe real entry point) which call your wmain
. so yes - your wamin
will be called every time when your executable file start.
and system simply can not just call ServiceMain
anyway. it simply don't know it address. and it not registered. when you register exe service you register the command line for your service, but not any exported name inside exe. your executable became service and register ServiceMain
only after StartServiceCtrlDispatcher
, which must be called from your wmain
even in case dll form service which work with svchost.exe
- you register exported function which must be called from your dll as service entry point, or ServiceMain
by default. but anyway even in this case first your DllMain
(dll entry point) will be called (if exist). in case exe - entry point is mandatory and always will be called
So in the end my executable is called without any arguments which then lead toServiceRunAsService
being called (which of course gets called when argc == 0) ?
– Rathma
Nov 24 '18 at 21:13
1
@Rachmaninoff - this depend from how you register your service viaCreateService
- what is in lpBinaryPathName (or ImagePath in registry)- service actually can have and not empty command line. if you mix exe for normal start and work as service - you need analyze command line, detect that you run as service and callStartServiceCtrlDispatcher
. if your executable design run only as service (you register it via another app) - you unconditionally callStartServiceCtrlDispatcher
. anyway - you became service only afterStartServiceCtrlDispatcher
call andwmain
always called on start
– RbMm
Nov 24 '18 at 21:18
I give the path of executable toCreateService
's lpBinaryPathName
– Rathma
Nov 24 '18 at 21:31
1
@Rachmaninoff - this not change main point. you can use as now empty command line. or some special, for indicate that you run as service. inwmain
you based on command line or callStartServiceCtrlDispatcher
or do another tasks, like register/unregister
– RbMm
Nov 24 '18 at 21:43
add a comment |
when executable is started, no matter for what reason, the exe entry point is called (if process not crashed or hooked before). so in your case always wmainCRTStartup
(or what is name of your exe real entry point) which call your wmain
. so yes - your wamin
will be called every time when your executable file start.
and system simply can not just call ServiceMain
anyway. it simply don't know it address. and it not registered. when you register exe service you register the command line for your service, but not any exported name inside exe. your executable became service and register ServiceMain
only after StartServiceCtrlDispatcher
, which must be called from your wmain
even in case dll form service which work with svchost.exe
- you register exported function which must be called from your dll as service entry point, or ServiceMain
by default. but anyway even in this case first your DllMain
(dll entry point) will be called (if exist). in case exe - entry point is mandatory and always will be called
So in the end my executable is called without any arguments which then lead toServiceRunAsService
being called (which of course gets called when argc == 0) ?
– Rathma
Nov 24 '18 at 21:13
1
@Rachmaninoff - this depend from how you register your service viaCreateService
- what is in lpBinaryPathName (or ImagePath in registry)- service actually can have and not empty command line. if you mix exe for normal start and work as service - you need analyze command line, detect that you run as service and callStartServiceCtrlDispatcher
. if your executable design run only as service (you register it via another app) - you unconditionally callStartServiceCtrlDispatcher
. anyway - you became service only afterStartServiceCtrlDispatcher
call andwmain
always called on start
– RbMm
Nov 24 '18 at 21:18
I give the path of executable toCreateService
's lpBinaryPathName
– Rathma
Nov 24 '18 at 21:31
1
@Rachmaninoff - this not change main point. you can use as now empty command line. or some special, for indicate that you run as service. inwmain
you based on command line or callStartServiceCtrlDispatcher
or do another tasks, like register/unregister
– RbMm
Nov 24 '18 at 21:43
add a comment |
when executable is started, no matter for what reason, the exe entry point is called (if process not crashed or hooked before). so in your case always wmainCRTStartup
(or what is name of your exe real entry point) which call your wmain
. so yes - your wamin
will be called every time when your executable file start.
and system simply can not just call ServiceMain
anyway. it simply don't know it address. and it not registered. when you register exe service you register the command line for your service, but not any exported name inside exe. your executable became service and register ServiceMain
only after StartServiceCtrlDispatcher
, which must be called from your wmain
even in case dll form service which work with svchost.exe
- you register exported function which must be called from your dll as service entry point, or ServiceMain
by default. but anyway even in this case first your DllMain
(dll entry point) will be called (if exist). in case exe - entry point is mandatory and always will be called
when executable is started, no matter for what reason, the exe entry point is called (if process not crashed or hooked before). so in your case always wmainCRTStartup
(or what is name of your exe real entry point) which call your wmain
. so yes - your wamin
will be called every time when your executable file start.
and system simply can not just call ServiceMain
anyway. it simply don't know it address. and it not registered. when you register exe service you register the command line for your service, but not any exported name inside exe. your executable became service and register ServiceMain
only after StartServiceCtrlDispatcher
, which must be called from your wmain
even in case dll form service which work with svchost.exe
- you register exported function which must be called from your dll as service entry point, or ServiceMain
by default. but anyway even in this case first your DllMain
(dll entry point) will be called (if exist). in case exe - entry point is mandatory and always will be called
answered Nov 24 '18 at 21:05
RbMmRbMm
17.9k11226
17.9k11226
So in the end my executable is called without any arguments which then lead toServiceRunAsService
being called (which of course gets called when argc == 0) ?
– Rathma
Nov 24 '18 at 21:13
1
@Rachmaninoff - this depend from how you register your service viaCreateService
- what is in lpBinaryPathName (or ImagePath in registry)- service actually can have and not empty command line. if you mix exe for normal start and work as service - you need analyze command line, detect that you run as service and callStartServiceCtrlDispatcher
. if your executable design run only as service (you register it via another app) - you unconditionally callStartServiceCtrlDispatcher
. anyway - you became service only afterStartServiceCtrlDispatcher
call andwmain
always called on start
– RbMm
Nov 24 '18 at 21:18
I give the path of executable toCreateService
's lpBinaryPathName
– Rathma
Nov 24 '18 at 21:31
1
@Rachmaninoff - this not change main point. you can use as now empty command line. or some special, for indicate that you run as service. inwmain
you based on command line or callStartServiceCtrlDispatcher
or do another tasks, like register/unregister
– RbMm
Nov 24 '18 at 21:43
add a comment |
So in the end my executable is called without any arguments which then lead toServiceRunAsService
being called (which of course gets called when argc == 0) ?
– Rathma
Nov 24 '18 at 21:13
1
@Rachmaninoff - this depend from how you register your service viaCreateService
- what is in lpBinaryPathName (or ImagePath in registry)- service actually can have and not empty command line. if you mix exe for normal start and work as service - you need analyze command line, detect that you run as service and callStartServiceCtrlDispatcher
. if your executable design run only as service (you register it via another app) - you unconditionally callStartServiceCtrlDispatcher
. anyway - you became service only afterStartServiceCtrlDispatcher
call andwmain
always called on start
– RbMm
Nov 24 '18 at 21:18
I give the path of executable toCreateService
's lpBinaryPathName
– Rathma
Nov 24 '18 at 21:31
1
@Rachmaninoff - this not change main point. you can use as now empty command line. or some special, for indicate that you run as service. inwmain
you based on command line or callStartServiceCtrlDispatcher
or do another tasks, like register/unregister
– RbMm
Nov 24 '18 at 21:43
So in the end my executable is called without any arguments which then lead to
ServiceRunAsService
being called (which of course gets called when argc == 0) ?– Rathma
Nov 24 '18 at 21:13
So in the end my executable is called without any arguments which then lead to
ServiceRunAsService
being called (which of course gets called when argc == 0) ?– Rathma
Nov 24 '18 at 21:13
1
1
@Rachmaninoff - this depend from how you register your service via
CreateService
- what is in lpBinaryPathName (or ImagePath in registry)- service actually can have and not empty command line. if you mix exe for normal start and work as service - you need analyze command line, detect that you run as service and call StartServiceCtrlDispatcher
. if your executable design run only as service (you register it via another app) - you unconditionally call StartServiceCtrlDispatcher
. anyway - you became service only after StartServiceCtrlDispatcher
call and wmain
always called on start– RbMm
Nov 24 '18 at 21:18
@Rachmaninoff - this depend from how you register your service via
CreateService
- what is in lpBinaryPathName (or ImagePath in registry)- service actually can have and not empty command line. if you mix exe for normal start and work as service - you need analyze command line, detect that you run as service and call StartServiceCtrlDispatcher
. if your executable design run only as service (you register it via another app) - you unconditionally call StartServiceCtrlDispatcher
. anyway - you became service only after StartServiceCtrlDispatcher
call and wmain
always called on start– RbMm
Nov 24 '18 at 21:18
I give the path of executable to
CreateService
's lpBinaryPathName– Rathma
Nov 24 '18 at 21:31
I give the path of executable to
CreateService
's lpBinaryPathName– Rathma
Nov 24 '18 at 21:31
1
1
@Rachmaninoff - this not change main point. you can use as now empty command line. or some special, for indicate that you run as service. in
wmain
you based on command line or call StartServiceCtrlDispatcher
or do another tasks, like register/unregister– RbMm
Nov 24 '18 at 21:43
@Rachmaninoff - this not change main point. you can use as now empty command line. or some special, for indicate that you run as service. in
wmain
you based on command line or call StartServiceCtrlDispatcher
or do another tasks, like register/unregister– RbMm
Nov 24 '18 at 21:43
add a comment |
When the OS executes your EXE, it calls your EXE's entry point, which then calls your code's (w)main()
function. When running as a service, your code must call StartServiceCtrlDispatcher()
, which loops on processing messages from the service controller and calls your ServiceMain()
.
No, the OS will definitely not callmain
. The OS will call whatever is specified as the entry point in the PE header. That is notmain
, simply because it doesn't even have the correct signature. Unclear, why this was upvoted. It is blatantly wrong, and doesn't acknowledge, that this question is asking about Windows Services, not just any old application.
– IInspectable
Nov 24 '18 at 22:04
add a comment |
When the OS executes your EXE, it calls your EXE's entry point, which then calls your code's (w)main()
function. When running as a service, your code must call StartServiceCtrlDispatcher()
, which loops on processing messages from the service controller and calls your ServiceMain()
.
No, the OS will definitely not callmain
. The OS will call whatever is specified as the entry point in the PE header. That is notmain
, simply because it doesn't even have the correct signature. Unclear, why this was upvoted. It is blatantly wrong, and doesn't acknowledge, that this question is asking about Windows Services, not just any old application.
– IInspectable
Nov 24 '18 at 22:04
add a comment |
When the OS executes your EXE, it calls your EXE's entry point, which then calls your code's (w)main()
function. When running as a service, your code must call StartServiceCtrlDispatcher()
, which loops on processing messages from the service controller and calls your ServiceMain()
.
When the OS executes your EXE, it calls your EXE's entry point, which then calls your code's (w)main()
function. When running as a service, your code must call StartServiceCtrlDispatcher()
, which loops on processing messages from the service controller and calls your ServiceMain()
.
edited Nov 24 '18 at 23:35
Remy Lebeau
338k19261456
338k19261456
answered Nov 24 '18 at 21:11
davedave
291
291
No, the OS will definitely not callmain
. The OS will call whatever is specified as the entry point in the PE header. That is notmain
, simply because it doesn't even have the correct signature. Unclear, why this was upvoted. It is blatantly wrong, and doesn't acknowledge, that this question is asking about Windows Services, not just any old application.
– IInspectable
Nov 24 '18 at 22:04
add a comment |
No, the OS will definitely not callmain
. The OS will call whatever is specified as the entry point in the PE header. That is notmain
, simply because it doesn't even have the correct signature. Unclear, why this was upvoted. It is blatantly wrong, and doesn't acknowledge, that this question is asking about Windows Services, not just any old application.
– IInspectable
Nov 24 '18 at 22:04
No, the OS will definitely not call
main
. The OS will call whatever is specified as the entry point in the PE header. That is not main
, simply because it doesn't even have the correct signature. Unclear, why this was upvoted. It is blatantly wrong, and doesn't acknowledge, that this question is asking about Windows Services, not just any old application.– IInspectable
Nov 24 '18 at 22:04
No, the OS will definitely not call
main
. The OS will call whatever is specified as the entry point in the PE header. That is not main
, simply because it doesn't even have the correct signature. Unclear, why this was upvoted. It is blatantly wrong, and doesn't acknowledge, that this question is asking about Windows Services, not just any old application.– IInspectable
Nov 24 '18 at 22:04
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53462047%2fdoes-every-windows-service-calls-its-executable-main-function%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Why not just check? Output a log message.
– Yakk - Adam Nevraumont
Nov 24 '18 at 20:38
Honestly I found it difficult to log messages in service ! I don't know how
– Rathma
Nov 24 '18 at 20:39
of course windows call exe entry point. so
wmain
. system have no any knowledge aboutServiceMain
until you not callStartServiceCtrlDispatcher
– RbMm
Nov 24 '18 at 20:46