Any input on this issue would be greatly appreciated. I'm trying to unload
my driver by using FreeIntChainHandler (after having successfully used
LoadIntChainHandler to load it) but it keeps giving me a failure and the
error code (87) says it's an invalid parameter, but the problem is that I
know it IS valid because I check it and print it right before passing it and
it's the same as when i get it from LoadIntChainHandler. And the HANLDE
variable is never reassigned in between load an unload. So I'm completely
lost as to why this is giving me a failure return. Any ideas?
Here's my code and output:
LOADING DRIVER CODE:
hIsr = LoadIntChainHandler((LPCWSTR)isr_dll, (LPCWSTR)isr_handler, IRQValue);
RETAILMSG( 1,(TEXT("%s Install_ISR : LoadIntChainHandler() passed. ISR
installed\r\n"), DRVR_NAME));
isrHandle = hIsr;
RETAILMSG( 1,(TEXT("DAQ Install_ISR : ISR handle: %u\r\n"),isrHandle ));
LOADING DRIVER OUTPUT:
569813 PID:67f57266 TID:7f4183a DAQ: Install_ISR : LoadIntChainHandler()
passed. ISR installed
3569813 PID:67f57266 TID:7f4183a DAQ Install_ISR : ISR handle: 2268934100
UNLOADING DRIVER CODE:
RETAILMSG(1,(TEXT("%s Deinit : ISR handle: %u\r\n"), DRVR_NAME,isrHandle));
ret = FreeIntChainHandler( isrHandle );
printf("Error code: %u and %d",GetLastError(),GetLastError());
UNLOADING DRIVER OUTPUT:
3587674 PID:67f57266 TID:2790b8ee DAQ: Deinit : ISR handle: 2268934100
Error Code: 87 and 87
"baj38" <u55805@uwe> ha scritto nel messaggio news:9e45c7d89c01c@uwe...
It turns out that the kdriver.c file is not in that location in my path and I
searched other places and can't find it. Is there another place where I can
locate it?
Thanks,
Brian
Luca Calligaris [eMVP] wrote:
>Looking at the implementation of FreeIntChainHandler and the functions it
>call (it's in then shared source code
>%_WINCEROTO%\PRIVATE\WINCEOS\COREOS\NK\KERNEL\kdriver.c) the only reason I
>see for that
>error is the fact that the ISR routine associated with that handle is no
>longer in the interrupt chain.
>Look for 'UnhookIntChain' in the file i mentined for the details
>> Hey all,
>>
>[quoted text clipped - 37 lines]
baj38 wrote:
>Luca, Thanks for your help.
>
>It turns out that the kdriver.c file is not in that location in my path and I
>searched other places and can't find it. Is there another place where I can
>locate it?
>
>Thanks,
>
>Brian
>
>>Looking at the implementation of FreeIntChainHandler and the functions it
>>call (it's in then shared source code
>[quoted text clipped - 8 lines]
This may mean that you haven't installed the shared source. You can
install it by restarting Windows CE setup.
Are you sure that FreeIntChainHandler isn't called twice?
In this case the first call will work and the second one will fail.
--
Valter Minute (eMVP)
Training, support and development for Windows CE:
www.fortechembeddedlabs.it
My embedded programming and cooking blog:
www.geekswithblogs.net/WindowsEmbeddedCookbook
Windows Embedded support forums in Italian:
http://social.msdn.microsoft.com/Forums/it-IT/windowsembeddedit/threads
(the reply address of this message is invalid)
Thanks,
Brian
Thanks.
baj38 wrote:
>I'm totally sure. Is there another way that it can get unloaded that maybe
>i'm overlooking?
>
>Thanks,
>
>Brian
>
>>> Luca, Thanks for your help.
>>>
>[quoted text clipped - 6 lines]
>>Are you sure that FreeIntChainHandler isn't called twice?
>>In this case the first call will work and the second one will fail.
--
Message posted via PocketPCJunkies.com
http://www.pocketpcjunkies.com/Uwe/Forums.aspx/wince-programming/200910/1
--
Luca Calligaris (MVP-Windows Embedded)
l.calliga...@eurotech.it.nospam
www.eurotech.it
"baj38 via PocketPCJunkies.com" <u55805@uwe> ha scritto nel messaggio
news:9e49cf7502b34@uwe...
You're right, the DestroyInstance function is neither exported in def file
nor is it implemented in the ISR. I'm new to this project (and CE) and I'm
trying to get up to speed on the previous programmer's code. In fact, there
is no exports at all for the ISR. What implications would that have? Also,
can you tell me when the CreateInstance and DestroyInstance functions get
called and exactly what calls them? I'm trying to understand how things
"should" work.
Thanks, Brian
Luca Calligaris [eMVP] wrote:
>Does your ISR DLL exports and implements the DestroyInstance function
>(http://msdn.microsoft.com/en-us/library/ms904005.aspx) ?
>The function is called during FreeIntChainHandler processing.
>
>> Ok, I think that this problem has something to do with the fact that the
>> driver is initially loaded into kernel memory space because of the K flag
>[quoted text clipped - 22 lines]
>>>>Are you sure that FreeIntChainHandler isn't called twice?
>>>>In this case the first call will work and the second one will fail.
--
Message posted via http://www.pocketpcjunkies.com