ActivateDevice fails with errno 2 
Author Message
 ActivateDevice fails with errno 2

I have a problem where ActivateDevice() consistently fails with
errno 2, "File Not Found", on the casio E-200.

When I try loading the driver DLL with LoadLibrary() it works
fine.  And I have also tried hardcoding the full path of the
DLL in the "Dll" value of the key given to ActivateDevice(),
but it still does not work.

It works fine on the iPAQ and the HP Jornada.

Is this a known problem?  Is there a work around?

Thanks.

- edward



Thu, 10 Jun 2004 03:28:34 GMT  
 ActivateDevice fails with errno 2
Just a hint , it's not obliged function so OEM have possibility set not to
set it or maybe Casio set dummy function instead with 2 return code opposite
maybe device.exe did it on start so from that moment concurrent calls
rejects by system in
Casio winCE.

Arkady


Quote:
> I have a problem where ActivateDevice() consistently fails with
> errno 2, "File Not Found", on the casio E-200.

> When I try loading the driver DLL with LoadLibrary() it works
> fine.  And I have also tried hardcoding the full path of the
> DLL in the "Dll" value of the key given to ActivateDevice(),
> but it still does not work.

> It works fine on the iPAQ and the HP Jornada.

> Is this a known problem?  Is there a work around?

> Thanks.

> - edward



Thu, 10 Jun 2004 15:47:10 GMT  
 ActivateDevice fails with errno 2
ActivateDevice is NOT an optional API. It's part of the device manager. Are you sure that all files and DLLs the driver
requires during the INIT function are included on the image. If you load with LoadLibrary and GetProcAddress on the
xxx_Init function then call the function what does it return? If that fails I'd go back and step through the call to
find out why.

--
Steve Maillet - [Microsoft Windows Embedded MVP]
Entelechy Software Consulting
smaillet 'AT' EntelechyConsulting 'DOT' com
http://www.EntelechyConsulting.com

Quote:

> Just a hint , it's not obliged function so OEM have possibility set not to
> set it or maybe Casio set dummy function instead with 2 return code opposite
> maybe device.exe did it on start so from that moment concurrent calls
> rejects by system in
> Casio winCE.

> Arkady



> > I have a problem where ActivateDevice() consistently fails with
> > errno 2, "File Not Found", on the casio E-200.

> > When I try loading the driver DLL with LoadLibrary() it works
> > fine.  And I have also tried hardcoding the full path of the
> > DLL in the "Dll" value of the key given to ActivateDevice(),
> > but it still does not work.

> > It works fine on the iPAQ and the HP Jornada.

> > Is this a known problem?  Is there a work around?

> > Thanks.

> > - edward



Fri, 11 Jun 2004 00:04:04 GMT  
 ActivateDevice fails with errno 2
You are correct but as I see Edward wrote his own device manager ( his
parallel device.exe ) because he do LoadLibrary so he try to call
ActivateDevice() in it or I miss something , otherwise why are you do
LoadLibrary and GetProcAddress  in it , Edward ?
Arkady



Quote:
> ActivateDevice is NOT an optional API. It's part of the device manager.

Are you sure that all files and DLLs the driver
Quote:
> requires during the INIT function are included on the image. If you load

with LoadLibrary and GetProcAddress on the
Quote:
> xxx_Init function then call the function what does it return? If that

fails I'd go back and step through the call to
Quote:
> find out why.

> --
> Steve Maillet - [Microsoft Windows Embedded MVP]
> Entelechy Software Consulting
> smaillet 'AT' EntelechyConsulting 'DOT' com
> http://www.EntelechyConsulting.com



Quote:
> > Just a hint , it's not obliged function so OEM have possibility set not
to
> > set it or maybe Casio set dummy function instead with 2 return code
opposite
> > maybe device.exe did it on start so from that moment concurrent calls
> > rejects by system in
> > Casio winCE.

> > Arkady



> > > I have a problem where ActivateDevice() consistently fails with
> > > errno 2, "File Not Found", on the casio E-200.

> > > When I try loading the driver DLL with LoadLibrary() it works
> > > fine.  And I have also tried hardcoding the full path of the
> > > DLL in the "Dll" value of the key given to ActivateDevice(),
> > > but it still does not work.

> > > It works fine on the iPAQ and the HP Jornada.

> > > Is this a known problem?  Is there a work around?

> > > Thanks.

> > > - edward



Fri, 11 Jun 2004 15:38:07 GMT  
 ActivateDevice fails with errno 2
You call LoadLibrary to load the Driver manually into an application for debugging purposes. There is nothing magic
about device.exe except for how it connects the Win32 File I/O APIs (and ActivateDevice) to it's own internal
functionality. You can load a driver from any application with LoadLibrary (Or more appropriately with LoadDriver() )
This is useful for debugging with eVC on retail devices.

--
Steve Maillet - [Microsoft Windows Embedded MVP]
Entelechy Software Consulting
smaillet 'AT' EntelechyConsulting 'DOT' com
http://www.EntelechyConsulting.com

Quote:

> You are correct but as I see Edward wrote his own device manager ( his
> parallel device.exe ) because he do LoadLibrary so he try to call
> ActivateDevice() in it or I miss something , otherwise why are you do
> LoadLibrary and GetProcAddress  in it , Edward ?
> Arkady



> > ActivateDevice is NOT an optional API. It's part of the device manager.
> Are you sure that all files and DLLs the driver
> > requires during the INIT function are included on the image. If you load
> with LoadLibrary and GetProcAddress on the
> > xxx_Init function then call the function what does it return? If that
> fails I'd go back and step through the call to
> > find out why.

> > --
> > Steve Maillet - [Microsoft Windows Embedded MVP]
> > Entelechy Software Consulting
> > smaillet 'AT' EntelechyConsulting 'DOT' com
> > http://www.EntelechyConsulting.com


> > > Just a hint , it's not obliged function so OEM have possibility set not
> to
> > > set it or maybe Casio set dummy function instead with 2 return code
> opposite
> > > maybe device.exe did it on start so from that moment concurrent calls
> > > rejects by system in
> > > Casio winCE.

> > > Arkady



> > > > I have a problem where ActivateDevice() consistently fails with
> > > > errno 2, "File Not Found", on the casio E-200.

> > > > When I try loading the driver DLL with LoadLibrary() it works
> > > > fine.  And I have also tried hardcoding the full path of the
> > > > DLL in the "Dll" value of the key given to ActivateDevice(),
> > > > but it still does not work.

> > > > It works fine on the iPAQ and the HP Jornada.

> > > > Is this a known problem?  Is there a work around?

> > > > Thanks.

> > > > - edward



Fri, 11 Jun 2004 21:51:11 GMT  
 ActivateDevice fails with errno 2
This is exactly what I mean that Edward's app is device.exe because inside
he did LoadLibrary , but when he did ActivateDevice() if fail , as msdn
state that including this function in Exported SDK is a good will of OEM ,
as OS builder he have it , but not as application designer.
The best way to hear from Edward about his work but he forgot about his
question
Arkady


Quote:
> You call LoadLibrary to load the Driver manually into an application for debugging purposes. There is nothing magic
> about device.exe except for how it connects the Win32 File I/O APIs (and ActivateDevice) to it's own internal
> functionality. You can load a driver from any application with LoadLibrary (Or more appropriately with LoadDriver() )
> This is useful for debugging with eVC on retail devices.

> --
> Steve Maillet - [Microsoft Windows Embedded MVP]
> Entelechy Software Consulting
> smaillet 'AT' EntelechyConsulting 'DOT' com
> http://www.EntelechyConsulting.com



Sat, 12 Jun 2004 15:46:03 GMT  
 ActivateDevice fails with errno 2
You don't have to be running device.exe to use loadLibrary on a device driver. And no useful system will exclude the
device manager. Therefore, ActivateDevice can be considered available in all devices. (Whether you have an SDK that
includes it prototyped in the headers or not it's still in the OS)

Perhaps after the Holidays Edward will have a chance to try the tests I recommended.

--
Steve Maillet - [Microsoft Windows Embedded MVP]
Entelechy Software Consulting
smaillet 'AT' EntelechyConsulting 'DOT' com
http://www.EntelechyConsulting.com

Quote:

> This is exactly what I mean that Edward's app is device.exe because inside
> he did LoadLibrary , but when he did ActivateDevice() if fail , as msdn
> state that including this function in Exported SDK is a good will of OEM ,
> as OS builder he have it , but not as application designer.
> The best way to hear from Edward about his work but he forgot about his
> question
> Arkady


> > You call LoadLibrary to load the Driver manually into an application for debugging purposes. There is nothing magic
> > about device.exe except for how it connects the Win32 File I/O APIs (and ActivateDevice) to it's own internal
> > functionality. You can load a driver from any application with LoadLibrary (Or more appropriately with
LoadDriver() )
> > This is useful for debugging with eVC on retail devices.

> > --
> > Steve Maillet - [Microsoft Windows Embedded MVP]
> > Entelechy Software Consulting
> > smaillet 'AT' EntelechyConsulting 'DOT' com
> > http://www.EntelechyConsulting.com



Sun, 13 Jun 2004 12:09:36 GMT  
 ActivateDevice fails with errno 2
Hi,

Sorry for the late response.  I have been having troubles posting
from ISP for the last 2 days.

To follow up, the problem seems to be in the LoadDriver() API
which ActivateDevice() calls.  ActivateDevice() just returns a
"catch-all" errno when it fails: "ERROR_FILE_NOT_FOUND".  Which
isn't exactly right.  Because looking at the source, it appears to
be a memory problem.  LoadDriver() expects to allocate and lock
memory for the drivers it wants to load.  If it fails it returns
with errno 2.

Does anyone know how many drivers can device.exe load?  Is there
a work-around besides deactivating already active devices to free up
memory for the ActivateDevice() to succeed.

- edward


Quote:
> You don't have to be running device.exe to use loadLibrary on a device driver. And no useful system will exclude the
> device manager. Therefore, ActivateDevice can be considered available in all devices. (Whether you have an SDK that
> includes it prototyped in the headers or not it's still in the OS)

> Perhaps after the Holidays Edward will have a chance to try the tests I recommended.

> --
> Steve Maillet - [Microsoft Windows Embedded MVP]
> Entelechy Software Consulting
> smaillet 'AT' EntelechyConsulting 'DOT' com
> http://www.EntelechyConsulting.com

> > This is exactly what I mean that Edward's app is device.exe because inside
> > he did LoadLibrary , but when he did ActivateDevice() if fail , as msdn
> > state that including this function in Exported SDK is a good will of OEM ,
> > as OS builder he have it , but not as application designer.
> > The best way to hear from Edward about his work but he forgot about his
> > question
> > Arkady


> > > You call LoadLibrary to load the Driver manually into an application for debugging purposes. There is nothing magic
> > > about device.exe except for how it connects the Win32 File I/O APIs (and ActivateDevice) to it's own internal
> > > functionality. You can load a driver from any application with LoadLibrary (Or more appropriately with
>  LoadDriver() )
> > > This is useful for debugging with eVC on retail devices.

> > > --
> > > Steve Maillet - [Microsoft Windows Embedded MVP]
> > > Entelechy Software Consulting
> > > smaillet 'AT' EntelechyConsulting 'DOT' com
> > > http://www.EntelechyConsulting.com



Mon, 14 Jun 2004 01:05:59 GMT  
 ActivateDevice fails with errno 2
There isn't so much a limit on the number of Drivers (DLLs) that it can load but on the total mount of memory available
to the device manager process. Like all other processes in Windows CE it is restricted to a maximum amount of 32M
allocated in it's virtual space. (Note it need not all be committed to physical memory to cause problems)

--
Steve Maillet - [Microsoft Windows Embedded MVP]
Entelechy Software Consulting
smaillet 'AT' EntelechyConsulting 'DOT' com
http://www.EntelechyConsulting.com

Quote:

> Hi,

> Sorry for the late response.  I have been having troubles posting
> from ISP for the last 2 days.

> To follow up, the problem seems to be in the LoadDriver() API
> which ActivateDevice() calls.  ActivateDevice() just returns a
> "catch-all" errno when it fails: "ERROR_FILE_NOT_FOUND".  Which
> isn't exactly right.  Because looking at the source, it appears to
> be a memory problem.  LoadDriver() expects to allocate and lock
> memory for the drivers it wants to load.  If it fails it returns
> with errno 2.

> Does anyone know how many drivers can device.exe load?  Is there
> a work-around besides deactivating already active devices to free up
> memory for the ActivateDevice() to succeed.

> - edward


> > You don't have to be running device.exe to use loadLibrary on a device driver. And no useful system will exclude the
> > device manager. Therefore, ActivateDevice can be considered available in all devices. (Whether you have an SDK that
> > includes it prototyped in the headers or not it's still in the OS)

> > Perhaps after the Holidays Edward will have a chance to try the tests I recommended.

> > --
> > Steve Maillet - [Microsoft Windows Embedded MVP]
> > Entelechy Software Consulting
> > smaillet 'AT' EntelechyConsulting 'DOT' com
> > http://www.EntelechyConsulting.com

> > > This is exactly what I mean that Edward's app is device.exe because inside
> > > he did LoadLibrary , but when he did ActivateDevice() if fail , as msdn
> > > state that including this function in Exported SDK is a good will of OEM ,
> > > as OS builder he have it , but not as application designer.
> > > The best way to hear from Edward about his work but he forgot about his
> > > question
> > > Arkady


> > > > You call LoadLibrary to load the Driver manually into an application for debugging purposes. There is nothing
magic
> > > > about device.exe except for how it connects the Win32 File I/O APIs (and ActivateDevice) to it's own internal
> > > > functionality. You can load a driver from any application with LoadLibrary (Or more appropriately with
> >  LoadDriver() )
> > > > This is useful for debugging with eVC on retail devices.

> > > > --
> > > > Steve Maillet - [Microsoft Windows Embedded MVP]
> > > > Entelechy Software Consulting
> > > > smaillet 'AT' EntelechyConsulting 'DOT' com
> > > > http://www.EntelechyConsulting.com



Mon, 14 Jun 2004 11:39:12 GMT  
 ActivateDevice fails with errno 2
I too few days send messages through goups.google because my ISP
cannot connect to any news server :(
I heard about limit of 10 devices , is it not correct , Steve ?
Up to now I cannot understand why you do ActivateDevice() it's job of
Device.exe ?
Arkady


Quote:
> There isn't so much a limit on the number of Drivers (DLLs) that it can load but on the total mount of memory available
> to the device manager process. Like all other processes in Windows CE it is restricted to a maximum amount of 32M
> allocated in it's virtual space. (Note it need not all be committed to physical memory to cause problems)



Mon, 14 Jun 2004 20:39:58 GMT  
 ActivateDevice fails with errno 2
There can only be 10 devices with the same prefix (eg. "FOO1:" - "FOO9:", "FOO0:") There is no limit on the total number
of drivers. You can just use another prefix if you run out.

--
Steve Maillet - [Microsoft Windows Embedded MVP]
Entelechy Software Consulting
smaillet 'AT' EntelechyConsulting 'DOT' com
http://www.EntelechyConsulting.com

Quote:

> I too few days send messages through goups.google because my ISP
> cannot connect to any news server :(
> I heard about limit of 10 devices , is it not correct , Steve ?
> Up to now I cannot understand why you do ActivateDevice() it's job of
> Device.exe ?
> Arkady


> > There isn't so much a limit on the number of Drivers (DLLs) that it can load but on the total mount of memory
available
> > to the device manager process. Like all other processes in Windows CE it is restricted to a maximum amount of 32M
> > allocated in it's virtual space. (Note it need not all be committed to physical memory to cause problems)



Mon, 14 Jun 2004 21:03:16 GMT  
 
 [ 11 post ] 

 Relevant Pages 

1. how to use ActivateDevice function?

2. How to set up registry before calling ActivateDevice()

3. ActivateDevice

4. ActivateDevice vs RegisterDevice

5. fopen and errno

6. Printing errno value macro.

7. strtoul(3), errno, and EINVAL

8. atof and errno

9. atoi, errno

10. Error when attempting to use strerror() and errno....

11. Reserved Words and errno

12. errno thread safe?

 

 
Powered by phpBB® Forum Software