Re: Service Auto Start Problems in PPC2003

From: Jeremy T. (JeremyT_at_discussions.microsoft.com)
Date: 11/18/04


Date: Thu, 18 Nov 2004 11:07:20 -0800

I can clarify a few points for you. The serivce's name isn't actually "My
Service.dll", I just used that name to protect the innocent. The real name
has no spaces in it.

Let me tell you a little about what it does and then maybe that will give
you some clues. The service is primarily used as a form of ipc for sending
and receiving data through a serial interface. The service in its init
function calls another function that starts two threads that each
respectively setup invisible windows that have their own message pumps that
sit and listen for windows messages and at times send them.

I don't think this specific functionality should inhibit the service from
starting though. Because as I said I can use activateservice and it works
fine. Inside the init function I have a logging statement that logs if the
method is entered at all. Nothing shows up on startup but when I do the
activateservice call the logging also works. The logging method I use will
work even if the program crashes in my experience as long as the log
statements are before the line that crashes. But there is nothing on startup
so I'm thinking that init is never called. Thanks again for all your help. It
really seems bizarre to me that it doesn't work given activateservice's
realiability.

Jeremy T.

"John Spaith [MS]" wrote:

> You've stumped the guy that wrote services.exe :(. I built your DLL and
> used your registry settings and they loaded fine for me on startup. I'm on
> a different OS version and platform than you, so there must be some weird
> difference here at PPC bootup. But again, I don't see what that could
> possibly be.
>
> Here's some ideas to try and get this working.
> (1) Rename your DLL "MyService.dll" instead of "My Service.dll". Maybe the
> space is causing something weird to happen??
>
> (2) Go talk with your buddy who has his service working, copy and paste it
> and his reg settings, and only change the bare minimum of what you have to
> in order to get this working.
>
> If you ever have some flash of insight as to what's going wrong here please
> post to the newsgroup. There's oodles of services out there and this is the
> first time I've ever heard of what you're seeing happening. Sorry I can't
> give you a better answer here.
>
> --
> John Spaith
> Software Design Engineer, Windows CE
> Microsoft Corporation
>
> Check out the new CE Networking Team Blog at http://blogs.msdn.com/cenet/.
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
> You assume all risk for your use. © 2003 Microsoft Corporation. All rights
> reserved.
>
> "Jeremy T." <JeremyT@discussions.microsoft.com> wrote in message
> news:E380E9DE-D2A2-4583-82F5-B54310BC4AE5@microsoft.com...
> > The dll is definately in the windows dir. Yes it is PPC 2003 on a siemens
> > sx56 and hp 6132 I think is the number. The odd thing is, is a co-worker
> > also
> > has a service but his will auto start we've compared our services and they
> > seem identical. The thing that is baffling to me is ActivateService works
> > which goes off the settings in the registry. Any input you have will help,
> > thanks.
> >
> > "John Spaith [MS]" wrote:
> >
> >> Hmm... this is very strange. Is your service DLL in the \windows
> >> directory,
> >> or is it by any chance on a storage card or on some other filesystem?
> >> It's
> >> possible that a storage card filesystem will be slow in starting up and
> >> that
> >> when services.exe initializes and tries to load your service, the
> >> underlying
> >> filesystem isn't around yet. When you ActivateService later on, then the
> >> filesystem is up.
> >>
> >> Also I want to confirm this is on a PocketPC 2003, correct? Some 3rd
> >> party
> >> guys managed to emulate services.exe on pre-2003 devices, and while I
> >> think
> >> that's very cool it's not something I can support :).
> >>
> >> --
> >> John Spaith
> >> Software Design Engineer, Windows CE
> >> Microsoft Corporation
> >>
> >> Check out the new CE Networking Team Blog at
> >> http://blogs.msdn.com/cenet/.
> >>
> >> This posting is provided "AS IS" with no warranties, and confers no
> >> rights.
> >> You assume all risk for your use. © 2003 Microsoft Corporation. All
> >> rights
> >> reserved.
> >>
> >> "Jeremy T." <JeremyT@discussions.microsoft.com> wrote in message
> >> news:3577DF90-B304-4FBE-BCF1-829B73F29541@microsoft.com...
> >> >I cannot get my service to load automatically on startup. I can load it
> >> > manually using either registerservice or activateservice and I can
> >> > successfully unload it with deregister service. The service works great
> >> > when
> >> > I manually load it but not otherwise. Here is my basic service code
> >> > below:
> >> >
> >> > /**
> >> > * Required method by service.
> >> > */
> >> > extern "C" __declspec(dllexport) DWORD ADD_Close(DWORD dwData)
> >> > {
> >> > return 0;
> >> > }
> >> >
> >> > /**
> >> > * Required method by service. Called on destruction of the service.
> >> > */
> >> > extern "C" __declspec(dllexport) BOOL ADD_Deinit(DWORD dwData)
> >> > {
> >> > //basic unload code
> >> > return 1;
> >> > }
> >> >
> >> > /**
> >> > * Required method by service. Called on initialization of the service.
> >> > */
> >> > extern "C" __declspec(dllexport) DWORD ADD_Init(DWORD dwData)
> >> > {
> >> > //very minimal startup here
> >> > return 1;
> >> > }
> >> >
> >> > /**
> >> > * Required method by service.
> >> > */
> >> > extern "C" __declspec(dllexport) DWORD ADD_IOControl(
> >> > DWORD dwData,
> >> > DWORD dwCode,
> >> > PBYTE pBufIn,
> >> > DWORD dwLenIn,
> >> > PBYTE pBufOut,
> >> > DWORD dwLenOut,
> >> > PDWORD pdwActualOut)
> >> > {
> >> >
> >> > return 1;
> >> > }
> >> >
> >> > /**
> >> > * Required method by service.
> >> > */
> >> > extern "C" __declspec(dllexport) DWORD ADD_Open(
> >> > DWORD dwData,
> >> > DWORD dwAccess,
> >> > DWORD dwShareMode)
> >> > {
> >> > return 0;
> >> > }
> >> >
> >> > /**
> >> > * Required method by service.
> >> > */
> >> > extern "C" __declspec(dllexport) DWORD ADD_Read(
> >> > DWORD dwData,
> >> > LPVOID pBuf,
> >> > DWORD dwLen)
> >> > {
> >> >
> >> > return 0;
> >> > }
> >> >
> >> > /**
> >> > * Required method by service.
> >> > */
> >> > extern "C" __declspec(dllexport) DWORD ADD_Seek(
> >> > DWORD dwData,
> >> > long pos,
> >> > DWORD type)
> >> > {
> >> >
> >> > return 0;
> >> > }
> >> >
> >> > /**
> >> > * Required method by service.
> >> > */
> >> > extern "C" __declspec(dllexport) DWORD ADD_Write(
> >> > DWORD dwData,
> >> > LPCVOID pInBuf,
> >> > DWORD dwInLen)
> >> > {
> >> >
> >> > return 0;
> >> > }
> >> >
> >> > Here is the basic registry settings that correspond:
> >> >
> >> > in HKEY_LOCAL_MACHINE\Services\MyService
> >> > DWORD Order = 10 (also tried it at 8)
> >> > DWORD Flags = 0
> >> > String Description = My Service
> >> > String Display Name = My ServiceName
> >> > DWORD Context = 0
> >> > DWORD Index = 0
> >> > String Prefix = ADD
> >> > DWORD Keep = 1
> >> > String Dll = My Service.dll
> >> > --
> >> > Jeremy T.
> >> > Software Engineer
> >>
> >>
> >>
>
>
>



Relevant Pages

  • RE: applying computer settings and applications
    ... > Recently I rebooted my server and upon startup it took an extremely long time ... > to get past the applying computer settings... ... Then I tried logging off and it's been stuck on the ... Al my network services are still running ...
    (microsoft.public.windows.server.sbs)
  • Re: Service Auto Start Problems in PPC2003
    ... It appears that there is some sort of limitation somewhere on ... > startup is call ActivateServiceon a bunch of registry keys under ... > Another thought is maybe you're doing something strange in your DllMain() ... When you ActivateService() ...
    (microsoft.public.pocketpc.developer)
  • Re: Configuring start up on XP Pro
    ... HKEY_LOCAL_MACHINE applies to the whole machine and not to individual users. ... Use HKEY_CURRENT_USER startup program settings for per user settings. ... Startup Control Panel is another pretty good application. ...
    (microsoft.public.windowsxp.help_and_support)
  • RE: Same prob
    ... The first was the issue with the Watchguard Firewall settings, ... Watchguard Firewalls look at your SMTP filtering and set the max headers to ... I recommend the default format (W3C logging), ...
    (microsoft.public.exchange.admin)
  • Re: BLUE SCREEN OF DEATH ON BOOT
    ... red-flagged error records that correspond to the date and time of your ... Also open Control Panel - System - Advanced and click on the Settings ... button in the Startup and Recovery section. ... and Recovery window click on the checkbox for "automatically restart" ...
    (microsoft.public.windowsxp.setup_deployment)

Quantcast