Partager via


Update the Driver Source Code (Compact 7)

3/12/2014

Before you build and run tests on the sample stream driver, customize the driver source code to return useful values by using the following procedure.

To update the driver source code

  1. In Platform Builder, open your OS design project.

  2. In Solution Explorer, navigate to the following path:

    %_WINCE700%\platform\<Your BSP>\src\drivers\streamdriver

  3. Expand the Source files node, and then open streamdriver.cpp.

  4. Modify the functions SDT_Init and SDT_Open to return values other than 0 (zero is the default value and indicates failure), as shown in the following example.

    extern "C" DWORD SDT_Init(LPCTSTR pContext, DWORD dwBusContext)
    {
      // Fill in initialization code here
      return 1;
    } 
    
    extern "C" DWORD SDT_Open(
      DWORD hDeviceContext, DWORD AccessCode, DWORD ShareMode
    )
    {
      // Fill in open code here
      return 1;
    }
    
  5. Save streamdriver.cpp.

You can now use this sample driver for testing, or you can modify it further to create a fully featured device driver.

See Also

Concepts

Add and Build a Device Driver