Re: XXX_Init only being called once



IST means Interrupt Service Thread. It is function that you passed in by
calling CardRequestISR (I think).
According you description, it looks like it couldn't load your PCMCIA client
driver sucessfully for second time.
What you thought is correct, This is probably caused by some application
still using this driver stream interface even when this driver is
deactivated. I think it only could be caused by your PCMCIA client driver
blocks on stream interface IO Control, Read or Write call. All Driver's IO
call is synchronous call in Windows CE, I believe PB requirs all drivers
have to unblock all blocking IO during XXX_Deinit or XXX_PreDeinit.
When you remove the PCMCIA hardware, the pcc_serv.dll calls DeactivateDevice
on pcmcia.dll that calls DeactivateDevice on you PCMCIA client driver.
DeactiveDevice first calls either XXX_Deinit or XXX_PreDeinit. The DLL only
be unloaded when reference count to driver's interface to zero. So, If you
have blocking IO, the reference count to driver's interface will never reach
to zero. So, the DLL is never unloaded (Even the XXX_Deinit is called). So,
if you insert second time and if your driver is using same driver index (
specified in registry), The driver loading may fails because the old stream
interfaces is not released.
Secound possibilty is your client driver return fail on XXX_Init at secound
time because the previous instance has blocking IO on its interface or
unintialized driver's global variable.

Let me ask you more detail information.
When you insert your card secound time, does XXX_Init call for secound time?
After remove your PCMCIA card, does any other type of PCMCIA card continue
to work(like CF card, Bluetooth card)?
Does your PCMCIA client driver support multiple same hardware?

David Liao.

"Thomas Magma" <somewhere@xxxxxxxxxxxxxxxxxx> wrote in message
news:%23jZBVHm5FHA.724@xxxxxxxxxxxxxxxxxxxxxxx
> Hi David,
>
> I am using the Dell Axim X51 with Mobile 5.0. And yes I am using the old
> PCMCIA client model, but I have been playing around a bit with the new
> Bus-Agnostic implementation.
>
> pcc_serv.dll is always running under Device.exe, but when I plug my card
> in (the first time) pcmcia.dll and mydriver.dll then get loaded under
> Device.exe. Then I unplug my card and pcmcia.dll and mydriver.dll
> disappear. That is the way it should be, I think. But when I plug my card
> in a second time only pcmcia.dll gets loaded and not mydriver.dll. It's
> like mydriver.dll is being locked by another application. I can't even go
> into \windows\ and delete or write over mydriver.dll. I get a pop-up
> window that says "sharing violation". I have to do a hard reset.
>
> The Device Manager loaded it fine, why isn't it unloading it?
>
> What does "PCMCIA driver's IST " mean?
>
> Thomas
>
> "David Liao (MS)" <davli@xxxxxxxxxxxxxxxxxxxx> wrote in message
> news:erXTjrZ5FHA.884@xxxxxxxxxxxxxxxxxxxxxxx
>> Which platform are you using to testing your PCMCIA driver ?
>> You obviously are using old PCMCIA client driver model which is loaded by
>> PCMCIA.DLL. Is this correct?
>>
>> I think usually smart phone turn on security feature and PDA turns off
>> security feature.
>>
>> Can you tell me whether you can find pcc_serv.dll in the system used for
>> testing? If this device is using new PC Card Controller driver, it should
>> have pcc_serv.dll in the system. Otherwise, it is old PCMCIA controller
>> driver.
>>
>> I think the PCMCIA driver's IST is blocked somehow. It can't unload your
>> driver for some reason.
>>
>> David Liao
>>
>> "Thomas Magma" <somewhere@xxxxxxxxxxxxxxxxxx> wrote in message
>> news:OufYjZN5FHA.2552@xxxxxxxxxxxxxxxxxxxxxxx
>>> Steve,
>>>
>>> The previous was ignored thanks.
>>>
>>> I've looked at several peoples PCMCIA stream type interface code,
>>> including my own which I had functioning just fine on WM2002 and WM2003.
>>> The problem is with WM2005 and the fact it's not calling XXX_Init each
>>> insertion of the card. Only the first time after a PDA hard reset. It is
>>> like it's holding on the driver somehow yet not showing it as being
>>> loaded in Process Viewer. The reason I think this is because after I
>>> insert the card the first time and remove it, I can't go in through
>>> Active Sync and erase my driver. A pop-up says there is a sharing
>>> violation no matter if the card is in or out. Something is holding on to
>>> it. It this something to do with Persistence Storage? Perhaps a security
>>> feature due the fact my driver is not signed and the OS only want to
>>> display the Unknown Manufacture pop-up window once, not each time the
>>> driver is loaded when a card is inserted?
>>>
>>> Any ideas?
>>>
>>> Thomas
>>>
>>>
>>> "Steve Maillet (eMVP)" <nospam1@xxxxxxxxxxxxxxxxxxxxxxx> wrote in
>>> message news:%23T8i1uM5FHA.1252@xxxxxxxxxxxxxxxxxxxxxxx
>>>> "You must know that XXX_Init only be called once when system load. You
>>>> need
>>>> change your design."
>>>> Ignore that! For PCMCIA client drivers and any other PNP driver loaded
>>>> and unloaded when the device is inserted/removed that is not true.
>>>> You are correct in assuming the Init function should be called on each
>>>> insert. Well, sort of, there is a PNPunload delay registry value that
>>>> leaves things loaded for a period of time to allow you to re-insert the
>>>> same card after accidentally popping it out without unloading or
>>>> invalidating it. Rapid remove/insert cycles cause a problem for that.
>>>>
>>>> --
>>>> Steve Maillet
>>>> EmbeddedFusion
>>>> www.EmbeddedFusion.com
>>>> smaillet at EmbeddedFusion dot com
>>>>
>>>>
>>>
>>>
>>
>>
>
>


.



Relevant Pages

  • Re: XXX_Init only being called once
    ... > My stream interface driver has been stripped right back to try to solve ... > I plug my card in the first time. ... > There are two new active keys in the registry PCMCIA and myDriver. ... > No entry points are called in my driver. ...
    (microsoft.public.windowsce.platbuilder)
  • Re: CF card detection in WinCE 5.0
    ... We have taken the first or second PCMCIA slot from a Mainstone-type ... board and made that into a CF card slot previously, ... I've been trying to use a Compact Flash for some time, ... operation (no ATAPI driver, ...
    (microsoft.public.windowsce.platbuilder)
  • Re: XXX_Init only being called once
    ... One thing I have noticed in WM 5.0 is that when a driver (that is not ... >> My stream interface driver has been stripped right back to try to solve ... >> Here are my registry key settings for our card located under ... >> There are two new active keys in the registry PCMCIA and myDriver. ...
    (microsoft.public.windowsce.platbuilder)
  • Re: o2Micro PCMCIA Controller Not Working in Linux - Gentoo 2004.1 - Kernel 2.6.5 - Likely a driver
    ... tweaking to get things working just so and keeping my kernel ... > card and chipset), I got my Broadcom wireless card working with a ... > compile with PCMCIA bus support and yenta-cardbus compatibility since ... > controller) or which driver to use to operate that slot. ...
    (comp.os.linux.portable)
  • Re: o2Micro PCMCIA Controller Not Working in Linux - Gentoo 2004.1 - Kernel 2.6.5 - Likely a driver
    ... tweaking to get things working just so and keeping my kernel ... > card and chipset), I got my Broadcom wireless card working with a ... > compile with PCMCIA bus support and yenta-cardbus compatibility since ... > controller) or which driver to use to operate that slot. ...
    (comp.os.linux.setup)