(Original) Dynamic Loading and debugging of Wince stream driver

Source: Internet
Author: User

This eliminates the trouble of re-generating NK images.ProgramThe debugging flow driver is efficient, fast, and transparent.

1. Compile the driver source file under EVC to generate the driver DLL.

Note: Pay attention to project setting during compilation. To add the driver's export file, add/DEF: "IR. def ", this step is very important, otherwise the driver cannot be called by the application.

2. Use EVC to compile a dynamic driver program, for example:

// Dynamically load the stream driver;

Handle m_hir;

M_hir = registerdevice (text ("irc"), 1, text ("irc. dll"), 1 );
If (m_hir = NULL ){
Dwerr = getlasterror ();
Strerr. Format (L "error code = % d \ n", dwerr );
: MessageBox (null, strerr, _ T ("irc device test program"), mb_ OK );

}

// Uninstall the stream driver;

Deregisterdevice (m_hir );
M_hir = NULL;

3. Copy the DLL file generated by the driver project to the Windows directory of the target platform, and then use the application to dynamically load the driver.

In the driver, you can use retailmsg to track and debug the driver. The debugging information is printed from the serial port of the platform.

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.