Re: XXX_Open not being called !! by Paul
Paul
Mon Apr 25 16:39:42 CDT 2005
I don't see any problems with that. It would be good, generally, not to
count on a read of platform.reg for what's actually in the registry. As a
check, you should export that section of the registry via Remote Registry
Editor, as I assume you did with the Active branch.
If you change your first DEBUGMSG in the Open routine so that you'll always
get the text out, does that make any difference (you're building a DEBUG
build, right?)? RETAILMSG( 1, (TEXT(...) ) ); is what I'd try to be sure.
The Init function is returning a non-zero value?
You might try having the power functions declared in your driver: PowerUp
and PowerDown.
Paul T.
"jamestheDork" <jamesevangelos@yahoo.com> wrote in message
news:c99396a769beb920e4578235588c00de@localhost.talkaboutsoftware.com...
> Thanks so much Paul, ok here is the info:
>
> 1. Registry entries (in project.reg file)
>
> [HKEY_LOCAL_MACHINE\Drivers\USB\LoadClients\5844_4098\Default\Default\SRT_DEVICE]
> "DLL"="TxRx.dll"
> "Prefix"="TRC"
>
> [HKEY_LOCAL_MACHINE\Drivers\USB\SRT_DEVICE]
> "Index"=dword:1
> "DeviceArrayIndex"=dword:0
> "Prefix"="TRC"
> "Dll"="TxRx.dll"
>
> It seems DllMain and TRC_Init are returning the proper values.
>
> 2. TRC_Open function:
>
> PUSBTRC_CONTEXT TRC_Open( PUSBTRC_CONTEXT Context, // context
> returned by TRC_Init.
> DWORD AccessCode, // @parm access code
> DWORD ShareMode // @parm share mode
> )
> {
> PUSBTRC_CONTEXT pUsbTrc = Context;
> BOOL bRc = TRUE;
>
> UNREFERENCED_PARAMETER(ShareMode);
> UNREFERENCED_PARAMETER(AccessCode);
>
> DEBUGMSG(ZONE_TRC_INIT,(TEXT(">TRC_Open(0x%x, 0x%x, 0x%x)\n"),pUsbTrc,
> AccessCode, ShareMode));
>
> if ( VALID_CONTEXT( pUsbTrc ) )
> {
> EnterCriticalSection(&pUsbTrc->Lock);
> if ( !pUsbTrc->Flags.Open && !pUsbTrc->Flags.UnloadPending )
> {
> pUsbTrc->Flags.Open = TRUE;
> ResetEvent( pUsbTrc->hCloseEvent ); // non-signaled
> }
> else
> {
> DEBUGMSG( ZONE_ERR,(TEXT("TRC_Open: ERROR_ACCESS_DENIED\n")));
> SetLastError(ERROR_ACCESS_DENIED);
> bRc = FALSE;
> }
> LeaveCriticalSection(&pUsbTrc->Lock);
> }
> else
> {
> DEBUGMSG( ZONE_ERR,(TEXT("TRC_Open: ERROR_FILE_NOT_FOUND\n")));
> SetLastError(ERROR_FILE_NOT_FOUND);
> bRc = FALSE;
> }
>
> DEBUGMSG(ZONE_TRC_INIT,(TEXT("<TRC_Open:%d\n"), bRc ));
>
> return (bRc ? pUsbTrc : NULL);
> }
>
> 3. Contents of *.def file:
> LIBRARY TXRX_LIB
>
> EXPORTS
> DllMain
> TRC_Init
> TRC_Deinit
> TRC_Open
> TRC_Close
> TRC_Read
> TRC_Write
> USBDeviceAttach
> USBInstallDriver
> USBUnInstallDriver
>
>
>