Sample Code

Windows Driver Samples/ Sample KMDF Function Driver for OSR USB-FX2/ C++/ driver/ osrusbfx2.man/

<?xml version='1.0' encoding='utf-8' standalone='yes'?>
<instrumentationManifest
    xmlns="http://schemas.microsoft.com/win/2004/08/events"
    xmlns:win="http://manifests.microsoft.com/win/2004/08/windows/events"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://schemas.microsoft.com/win/2004/08/events eventman.xsd"
    >
  <instrumentation>
    <events>
      <provider
          guid="{69cd60e3-430f-4da4-b1b3-e3bdaf945875}"
          messageFileName="%Systemroot%\System32\drivers\osrusbfx2.SYS"
          name="OSRUSBFX2"
          resourceFileName="%SystemRoot%\System32\drivers\osrusbfx2.SYS"
          symbol="OSRUSBFX2_PROVIDER"
          >
        <channels>
          <channel
              chid="Analytic"
              enabled="false"
              name="OsrUsbfx2/Analytic"
              symbol="OSRUSBFX2_ANALYTIC"
              type="Analytic"
              />
          <channel
              chid="operational"
              enabled="true"
              isolation="System"
              message="$(string.OSRUSBFX2_OPERATIONAL.Name)"
              name="OsrUsbFx2/Operational"
              symbol="OSRUSBFX2_OPERATIONAL"
              type="Operational"
              />
        </channels>
        <keywords>
          <keyword
              mask="0x0000000000000010"
              message="$(string.OSRUSBFX2_DEVICE_INFO_KEYWORD.message)"
              name="deviceinfo"
              symbol="OSRUSBFX2_DEVICE_INFO_KEYWORD"
              />
          <keyword
              mask="0x0000000000000040"
              message="$(string.OSRUSBFX2_READ_WRITE_KEYWORD.message)"
              name="readwrite"
              symbol="OSRUSBFX2_READ_WRITE_KEYWORD"
              />
        </keywords>
        <opcodes>
          <!-- Defining our own custom opcode instead of using standard opcodes defined by winmeta.xml -->
          <opcode
              name="add"
              symbol="OSRUSBFX2_DEVICE_ADD"
              value="10"
              />
          <opcode
              name="fail"
              symbol="OSRUSBFX2_FAIL"
              value="11"
              />
        </opcodes>
        <tasks>
          <!-- Support for XP and W2K3 : MC.exe will create a MOF file -->
          <!--  Requires an associated eventGUID attribute for each task that is defined  -->
          <!--  For the MOF file : -->
          <!--  Semantically, the event GUID represents a set of logical events that are logged by the provider. -->
          <task
              eventGUID="{872c3c43-6899-4f1d-89b8-51a82f6db657}"
              name="deviceInit"
              symbol="OSRUSBFX2_DEVICE_INIT"
              value="1"
              />
          <task
              eventGUID="{872c3c45-6899-4f1d-89b8-51a82f6db657}"
              name="read"
              symbol="OSRUSBFX2_READ"
              value="2"
              />
          <task
              eventGUID="{872c3c46-6899-4f1d-89b8-51a82f6db657}"
              name="write"
              symbol="OSRUSBFX2_WRITE"
              value="3"
              />
        </tasks>
        <templates>
          <template tid="tid_DeviceStatus">
              <data
                  inType="win:UnicodeString"
                  name="FriendlyName"
                  outType="xs:string"
                  />
              <data
                  inType="win:UnicodeString"
                  name="Location"
                  outType="xs:string"
                  />
              <data
                  inType="win:UInt32"
                  name="NTStatus"
                  outType="xs:HexInt32"
                  />
          </template>
          <template tid="tid_ReadWrite">
            <data
                inType="win:Pointer"
                name="Device"
                outType="win:HexInt64"
                />
            <data
                inType="win:UInt32"
                name="Length"
                outType="xs:unsignedInt"
                />
          </template>
          <template tid="tid_ReadWriteFail">
            <data
                inType="win:Pointer"
                name="Device"
                outType="win:HexInt64"
                />
            <data
                inType="win:UInt32"
                name="NTStatus"
                outType="xs:HexInt32"
                />
          </template>
          <template tid="tid_ReadWriteCompletion">
            <data
                inType="win:Pointer"
                name="Device"
                outType="win:HexInt64"
                />
            <data
                inType="win:UInt32"
                name="Length"
                outType="xs:unsignedInt"
                />
            <data
                inType="win:UInt32"
                name="NTStatus"
                outType="xs:HexInt32"
                />
            <data
                inType="win:UInt32"
                name="UsbdStatus"
                outType="xs:unsignedInt"
                />
          </template>
        </templates>
        <events>
           <event
              channel="Analytic"
              keywords="readwrite"
              message="$(string.ReadStart.EventMessage)"
              level="win:Informational"
              opcode="win:Start"
              symbol="ReadStart"
              task="read"
              template="tid_ReadWrite"
              value="1"
              />
           <event
              channel="Analytic"
              keywords="readwrite"
              message="$(string.ReadStop.EventMessage)"
              level="win:Informational"
              opcode="win:Stop"
              symbol="ReadStop"
              task="read"
              template="tid_ReadWriteCompletion"
              value="2"
              />
           <event
              channel="Analytic"
              keywords="readwrite"
              message="$(string.ReadFail.EventMessage)"
              level="win:Error"
              opcode="fail"
              symbol="ReadFail"
              task="read"
              template="tid_ReadWriteFail"
              value="3"
              />
           <event
              channel="Analytic"
              keywords="readwrite"
              message="$(string.WriteStart.EventMessage)"
              level="win:Informational"
              opcode="win:Start"
              symbol="WriteStart"
              task="write"
              template="tid_ReadWrite"
              value="4"
              />
           <event
              channel="Analytic"
              keywords="readwrite"
              message="$(string.WriteStop.EventMessage)"
              level="win:Informational"
              opcode="win:Stop"
              symbol="WriteStop"
              task="write"
              template="tid_ReadWriteCompletion"
              value="5"
              />
           <event
              channel="Analytic"
              keywords="readwrite"
              message="$(string.WriteFail.EventMessage)"
              level="win:Error"
              opcode="fail"
              symbol="WriteFail"
              task="write"
              template="tid_ReadWriteFail"
              value="6"
              />
           <event
              channel="operational"
              keywords="deviceinfo"
              level="win:Error"
              message="$(string.DeviceFailAdd.EventMessage)"
              opcode="add"
              symbol="FailAddDevice"
              task="deviceInit"
              template="tid_DeviceStatus"
              value="100"
              />
           <event
              channel="operational"
              keywords="deviceinfo"
              message="$(string.DeviceReenumerated.EventMessage)"
              opcode="win:Start"
              symbol="DeviceReenumerated"
              task="deviceInit"
              template="tid_DeviceStatus"
              value="101"
              />
            <event
              channel="operational"
              keywords="deviceinfo"
              level="win:Error"
              message="$(string.SelectConfigFailure.Message)"
              opcode="fail"
              symbol="SelectConfigFailure"
              task="deviceInit"
              template="tid_DeviceStatus"
              value="102"
              />
        </events>
      </provider>
    </events>
  </instrumentation>
  <localization xmlns="http://schemas.microsoft.com/win/2004/08/events">
    <resources culture="en-US">
      <stringTable>
        <string
            id="OSRUSBFX2_DEVICE_INFO_KEYWORD.message"
            value="Device events: fail to load, reenumerate"
            />
        <string
            id="OSRUSBFX2_READ_WRITE_KEYWORD.message"
            value="Read, Write events"
            />
        <string
            id="OSRUSBFX2_OPERATIONAL.Name"
            value="Operational channel eventlog"
            />
        <string
            id="ReadStart.EventMessage"
            value="Read.  Device = %1, Length = %2"
            />
        <string
            id="ReadStop.EventMessage"
            value="Read complete.  Device = %1, Length = %2, Status = %3, UsbStatus = %4"
            />
        <string
            id="ReadFail.EventMessage"
            value="Read error.  Device = %1, Status = %2"
            />
        <string
            id="WriteStart.EventMessage"
            value="Write.  Device = %1, Length = %2"
            />
        <string
            id="WriteStop.EventMessage"
            value="Write complete.  Device = %1, Length = %2, Status = %3, UsbStatus = %4"
            />
        <string
            id="WriteFail.EventMessage"
            value="Write error.  Device = %1, Status = %2"
            />
        <string
            id="DeviceReenumerated.EventMessage"
            value="Device %1 (location %2) was reenumerated"
            />
        <string
            id="DeviceFailAdd.EventMessage"
            value="Fail to add device %1 (location %2), status %3"
            />
        <string
            id="SelectConfigFailure.Message"
            value="This error occurs when an OSR USB Fx2 board is attached to a USB 1.1 port on a machine running Windows Vista.  This error occurs because the OSR USB Fx2 board's Interrupt end-point descriptor does not conform to the USB specification.  Windows Vista detects this and returns an error.  You should plug the device into a USB 2.0 (or higher) port."
            />
      </stringTable>
    </resources>
  </localization>
</instrumentationManifest>

Our Services

  • What our customers say about us?

© 2011-2024 All Rights Reserved. Joya Systems. 4425 South Mopac Building II Suite 101 Austin, TX 78735 Tel: 800-DEV-KERNEL

Privacy Policy. Terms of use. Valid XHTML & CSS