Re: Service Auto Start Problems in PPC2003

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

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


Date: Tue, 16 Nov 2004 10:03:01 -0800

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: registry code sample
    ... const BYTE* data ... DWORD dwData ... because i use DWORD types on my registry values. ... _Tmacro expands to L prefix for Unicode builds and to nothing for ANSI ...
    (microsoft.public.vc.language)
  • RE: Sleep in driver worker thread?
    ... worker thread runs fine for the 10s that the Init function sleeps. ... Sleepworks fine in the driver Init ... BOOL WINAPI DllEntry(HANDLE hInstDll, DWORD dwReason, LPVOID lpvReserved) ... DWORD BSD_Open (DWORD dwData, DWORD dwAccess, DWORD dwShareMode) ...
    (microsoft.public.windowsce.embedded)
  • Re: Sleep in driver worker thread?
    ... the driver Init function by placing a Sleepprior to the return, ... worker thread runs fine for the 10s that the Init function sleeps. ... BOOL WINAPI DllEntry(HANDLE hInstDll, DWORD dwReason, LPVOID ... DWORD BSD_Open (DWORD dwData, DWORD dwAccess, DWORD dwShareMode) {return ...
    (microsoft.public.windowsce.embedded)
  • Re: Auto start a service on windows mobile 5.0
    ... it Using Visual Studio 2005 using Windows Mobile 5 Smartphone. ... DWORD ul_reason_for_call, ... DWORD dwData, ...
    (microsoft.public.pocketpc.wireless)
  • Sleep in driver worker thread?
    ... I am writing a stream driver on a Cirrus EP9302 under Windows CE 6.0 where I ... would like to have a worker thread that runs periodically to sample some ... BOOL WINAPI DllEntry(HANDLE hInstDll, DWORD dwReason, LPVOID lpvReserved) ... DWORD BSD_Open (DWORD dwData, DWORD dwAccess, DWORD dwShareMode) ...
    (microsoft.public.windowsce.embedded)