Re: how to load in a build in driver whose index is greater 10 in Windows CE



Steve's reply is perfect. You're trying to access a value that is not
present for devices numbered higher than 9, which yours is. The driver code
was clearly not intended to be used for devices which would have more than 9
instances and will have to be modified to work for your 60-instance case.
Simply making the failure to read the Name key a non-fatal error should be
all you need, unless the result of that call is used at some point. Search
for szName to see what, if anything, its purpose is.

Paul T.

<suqian99@xxxxxxxxxxx> wrote in message
news:1167248566.518656.88270@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Paul and all, here is my code,

lStatus = RegOpenKeyEx( HKEY_LOCAL_MACHINE, pContext, 0, 0, &hKey) ;
if ( ERROR_SUCCESS != lStatus )
{
SENDLOG((TEXT("Mux07_10::VCA_Init: RegOpenKeyEx Failed: GO
TO ERROR 1\r\n")));
goto error ;
}

// get Key
dwSize = MAX_SZKEY_SIZE ;
dwValType = REG_SZ ;
lStatus = RegQueryValueEx( hKey, TEXT("Key"), NULL, &dwValType,
(LPBYTE) szBuiltinKey, &dwSize) ;
if ( ERROR_SUCCESS != lStatus )
{
SENDLOG((TEXT("Mux07_10::VCA_Init: RegQueryValueEx Failed:
GO TO ERROR 2\r\n")));
goto error ;
}
// get Name
dwSize = MAX_SZKEY_SIZE ;
dwValType = REG_SZ ;
lStatus = RegQueryValueEx( hKey, TEXT("Name"), NULL, &dwValType,
(LPBYTE) szName, &dwSize) ;
if ( ERROR_SUCCESS != lStatus )
{
SENDLOG((TEXT("Mux07_10::VCA_Init: RegQueryValueEx Failed:
GO TO ERROR 3\r\n")));
goto error ;
}
RegCloseKey(hKey) ;


so to summary this topic,

the driver is loaded and can not use the "active" information.

thanks, guys.
Steve Maillet (eMVP) wrote:
Because the Device manager only creates the "name" value (which you
shouldn't rely on in your driver) for legacy device names.

--
Steve Maillet
EmbeddedFusion
www.EmbeddedFusion.com
smaillet at EmbeddedFusion dot com



.



Relevant Pages