Re: running a service/driver/application upon startup



Would it be possible for you to drop a debug services.exe and debug nk.exe
into your image? Hopefully these wouldn't put it over the maximum size.
I'm hoping if you can crank up full debugzones on these then they can tell
you where we're going wrong in this various scenarios.

Not being able to load Telnetd is a red herring. If telnetd detects it's
not being loaded under device.exe or services.exe, its DllEntry() returns
FALSE and that gets you ERROR_DLL_INIT_FAILED.

--
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.

"vernon hyde" <vhyde@xxxxxxxxxxxxxxx> wrote in message
news:%238AjM%23q1FHA.3180@xxxxxxxxxxxxxxxxxxxxxxx
> Hi John,
>
> Thanks again for your help. I am unable to use the debugger because the
> debug version of the image is too large to load onto the device. I tried
> attaching to the services.exe app to debug the dll, but the debugger
> requires an exe file.
>
> WRT your other suggestions:
>
> I ran dumpbin/exports on the finger dll and saw the required function
> names:
>
>
> 1 0 000010E2 FIN_Close
> 2 1 0000109A FIN_Deinit
> 3 2 000010E6 FIN_IOControl
> 4 3 0000103E FIN_Init
> 5 4 000010DE FIN_Open
>
> I took your advice and copied the dll to the device and ran the command
> services load finger (I also tried fingerserver)
>
> and got an "operation failed" message with error code 0x6e (110), which is
> an open failure.
>
> Again, my registry values for the ...\services\finger key are
>
> DLL FINGER.DLL
> Order 9
> Keep 1
> Prefix FIN
> Index 0
>
> I experimented with the DLL value by putting various pathnames. Nothing
> seems to work.
>
> I did write a skeletal app which successfully loaded the dll by calling
> LoadLibrary("finger.dll"). Interestingly, it was unable to load the
> telnetd.dll which services loads, even after I unloaded it. The error
> code
> was 1114 (ERROR_DLL_INIT_FAILED).
>
> Thanks again for your help. If you can suggest anything else I'd
> appreciate
> it.
>
> Verne
>
> "John Spaith [MS]" <jspaith@xxxxxxxxxxxxxxxxxxxx> wrote in message
> news:OiXmUVP1FHA.3864@xxxxxxxxxxxxxxxxxxxxxxx
>> The .pdb and .rel files are only needed for debugging. If you have a
> fully
>> debug version of CE, the best bet is to run it, hook it up to Platform
>> Builder, and turn on full debugzones for services.exe. This may help
>> pinpoint the issue very quickly. You can also turn on the loader debug
>> zones (I think this is via the process nk.exe debugzones) to get tons of
>> detailed information.
>>
>> I would also try running, from a "build" window on your XP host (in PB
>> 5.0
>> it's in Build Os->Open Release Directory, not sure if it's the same on CE
>> 4.1). Then run 'link /dump /exports fingerserver.dll'. You should see
>> something like FIN_Init, FIN_DeInit, and FIN_IOControl - those are the 3
>> required exports.
>>
>> Also try setting DLL name equal to the full path of your service DLL.
>>
>> Another common error is that your fingerServer.def file itself needs to
> have
>> "LIBRARY FingerServer" or something like that in it. I've seen people
> where
>> they have something like "LIBRARY
>> NameOfOldDllICopiedAndPastedThisDefFileFrom" and this will compile but
>> the
>> linker won't handle it.
>>
>> You can avoid constantly having to reboot the device to test different
>> theories as to why it's not getting loaded but just doing 'services load
>> Finger". That's the same code path (almost) as in system startup.
>>
>> --
>> John Spaith
>> Software Design Engineer, Windows CE
>> Microsoft Corporation
>>
>
> "John Spaith [MS]" <jspaith@xxxxxxxxxxxxxxxxxxxx> wrote in message
> news:OiXmUVP1FHA.3864@xxxxxxxxxxxxxxxxxxxxxxx
>> The .pdb and .rel files are only needed for debugging. If you have a
> fully
>> debug version of CE, the best bet is to run it, hook it up to Platform
>> Builder, and turn on full debugzones for services.exe. This may help
>> pinpoint the issue very quickly. You can also turn on the loader debug
>> zones (I think this is via the process nk.exe debugzones) to get tons of
>> detailed information.
>>
>> I would also try running, from a "build" window on your XP host (in PB
>> 5.0
>> it's in Build Os->Open Release Directory, not sure if it's the same on CE
>> 4.1). Then run 'link /dump /exports fingerserver.dll'. You should see
>> something like FIN_Init, FIN_DeInit, and FIN_IOControl - those are the 3
>> required exports.
>>
>> Also try setting DLL name equal to the full path of your service DLL.
>>
>> Another common error is that your fingerServer.def file itself needs to
> have
>> "LIBRARY FingerServer" or something like that in it. I've seen people
> where
>> they have something like "LIBRARY
>> NameOfOldDllICopiedAndPastedThisDefFileFrom" and this will compile but
>> the
>> linker won't handle it.
>>
>> You can avoid constantly having to reboot the device to test different
>> theories as to why it's not getting loaded but just doing 'services load
>> Finger". That's the same code path (almost) as in system startup.
>>
>> --
>> 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.
>>
>> "vernon hyde" <vhyde@xxxxxxxxxxxxxxx> wrote in message
>> news:O3TXwhO1FHA.1132@xxxxxxxxxxxxxxxxxxxxxxx
>> > Hi John,
>> >
>> > Thanks for your help. I still can't get it to work, but the problem
>> > appears
>> > to be something more basic, because I can't load the dll even when it
>> > is
>> > part of the image.
>> >
>> > I'm new to CE, so it might be something really obvious. I noticed that
>> > the
>> > other services store map, pdb, and rel files in the release directory.
>> > Are
>> > they necessary?
>> >
>> > My registry settings are as follows:
>> >
>> > ...\Services\FINGER
>> >
>> > DLL fingerserver.dll
>> > Order 9
>> > Keep 1
>> > Prefix FIN
>> > Index 0
>> >
>> > Any help you or anyone else out there can provide for a frustrated
> novice
>> > would be greatly appreciated.
>> >
>> > Thanks again, Verne
>> >
>> >
>>
>>
>
>



.



Relevant Pages

  • Re: How to connect to children process
    ... Main problem is amount of manual operations required per debug cycle. ... connection to DLL with debugger takes sensible amount of time and manual ... Is the main problem that the debugger keeps symbols file loaded ... AFAIK that's how VS2003 debugger works, but WinDbg should usually ...
    (microsoft.public.vsnet.debugging)
  • Re: technical/OS problem (windows xp?)
    ... Build a debug version of the ISAPI DLL. ... Create a virtual root with execute permissions in the IIS Management ... Add your ISAPI extension or filter DLL to the list. ...
    (alt.marketing.online.ebay)
  • Re: running a service/driver/application upon startup
    ... debug version of the image is too large to load onto the device. ... I ran dumpbin/exports on the finger dll and saw the required function names: ... > theories as to why it's not getting loaded but just doing 'services load ...
    (microsoft.public.windowsce.embedded)
  • Re: How to export a class that inherits from unmanaged exception class
    ... Static linking means your application is self standing and doesn't depend on any non-system DLL. ... Debug or release version. ... In a VC++ project you can't successfully mix debug and release units -- you have to compile all your units with either debugging enabled or disabled uniformly. ...
    (microsoft.public.dotnet.languages.vc)