Condividi tramite


Tipo complesso DataDefinitionType

Definisce un elemento di dati che si vuole includere con l'evento.

<xs:complexType name="DataDefinitionType"
    mixed="true"
>
    <xs:simpleContent>
        <xs:extension
            base="string"
        >
            <xs:attribute name="name"
                type="string"
                use="required"
             />
            <xs:attribute name="inType"
                type="QName"
                use="required"
             />
            <xs:attribute name="outType"
                type="QName"
                use="optional"
             />
            <xs:attribute name="map"
                type="string"
                use="optional"
             />
            <xs:attribute name="length"
                type="LengthType"
                use="optional"
             />
            <xs:attribute name="count"
                type="CountType"
                use="optional"
             />
            <xs:anyAttribute
                processContents="lax"
                namespace="##other"
             />
        </xs:extension>
    </xs:simpleContent>
</xs:complexType>

Attributi

Nome Tipo Descrizione
count CountType Numero di elementi nella matrice se l'elemento di dati è una matrice. È possibile specificare il conteggio effettivo o il nome di un altro elemento di dati contenente il conteggio.
inType QName Tipo di dati per questo elemento di dati. Per un elenco di tipi di dati di input predefiniti, vedere il tipo complesso InputType .
length LengthType Lunghezza di un elemento dati di lunghezza variabile, ad esempio un BLOB binario. Per i dati binari, specificare la lunghezza in byte e per i dati stringa, specificare la lunghezza in caratteri. È possibile specificare la lunghezza effettiva o il nome di un altro elemento di dati contenente la lunghezza.
Se si usa l'attributo length per specificare una stringa di lunghezza fissa, è necessario inserire la stringa nella lunghezza fissa che consente il carattere di terminazione null alla fine, ad esempio se la lunghezza è 5, la stringa "abc" deve essere riempita come "abc". La lunghezza della stringa deve includere il carattere null-terminatore.
map string Nome della mappa nome/valore da usare per eseguire il mapping dei valori integer alle stringhe. Il tipo di dati dell'elemento di dati deve essere di uno dei tipi seguenti:
  • win:UInt8
  • win:UInt16
  • win:UInt32
name string Nome dell'elemento dati. È possibile usare il nome per fare riferimento a questo elemento di dati nel frammento XML se si specifica una sezione UserData nel modello. È anche possibile fare riferimento a questo nome in un attributo di lunghezza o conteggio di un altro elemento di dati se questo elemento di dati contiene il relativo valore di lunghezza o conteggio.
Windows Vista: Questo attributo è facoltativo.
outType QName Tipo di dati da usare durante il rendering di questo elemento di dati. Per un elenco di tipi di dati di output predefiniti, vedere il tipo complesso OutputType .
Windows Vista: Il tipo di output viene ignorato e il servizio determina il tipo in base al tipo di input.

Commenti

Per i tipi di input a lunghezza variabile, ad esempio BLOB binari, è necessario usare l'attributo length per specificare in modo esplicito le dimensioni dei dati. Per le stringhe, specificare l'attributo di lunghezza solo se le stringhe sono di lunghezza fissa.

Esempio

Di seguito sono riportati alcuni esempi delle definizioni degli elementi di dati.

<!-- The data item is an 8-bit integer -->
<data name="binaryChar" inType="win:UInt8">
 
<!-- The data item is a single ANSI character -->
<data name="ansiChar" inType="win:UInt8" outtype="xs:string">
 
<!-- The data item is a single Unicode character -->
<data name="unicodeChar" inType="win:UInt16" outtype="xs:string">
 
<!-- The data item is an IP address that is rendered as a dot separated list of interger values -->
<data name="ipAddress" inType="win:UInt32" outtype="win:IPv4">
 
<!-- The data item is a Boolean value -->
<data name="success" inType="win:boolean">
 
<!-- The data item is a null-terminated ANSI string -->
<data name="string" inType="win:AnsiString"> 

<!-- The data item is a fixed length ANSI string -->
<data name="string" inType="win:AnsiString" length="42"> 
 
<!-- The data item is a fixed length array of null-terminated ANSI strings -->
<data name="strings" inType="win:AnsiString" count="20">
 
<!-- The data item is a fixed length array of fixed length ANSI strings -->
<data name="strings" inType="win:AnsiString" length="42" count="20">
 
<!-- The data item is a variable length array of same sized ANSI strings -->
<data name="stringLength" inType="win:UInt16">
<data name="arrayCount" inType="win:Uint16">
<data name="strings" inType="win:AnsiString" length="stringLength" count="arrayCount"> 
 
<!-- For binary data, you must specify the size.
<!-- The data item is a fixed length array of fixed length binary blobs -->
<data name="blobs" inType="win:Binary" length="42" count="20">

<!-- The data item is a fixed length binary blob -->
<data name="blob" inType="win:Binary" length="42">

<!-- The following are illegal binary data definitions -->
<!-- This definition is illegal because no length is specified -->
<data name="blob" inType="win:Binary"> 
 
<!-- This definition is illegal because you cannot determine the length of each binary blob -->
<data name="blob" inType="win:Binary" count="20"> 
 
<!-- The data item is a variable length array of structures. Each structure -->
<!-- contains an array of same sized ANSI strings --> 
<data name="arrayStructCount" inType="win:UInt16">
<struct name="countedStrings" count="arrayStructCount">
      <data name="stringLength" inType="win:UInt16">
      <data name="string" inType="win:AnsiString" length="stringLength">
</struct>
 
<!-- The data item is a time stamp that is rendered in 100ns units -->
<data name="timestamp" inType="win:UInt32" outType="win:ETWTIME">

<!-- The data item is a fixed length array of integers --> 
<data name="integers" inType="win:UInt32" count="20">

<!-- The data item is a variable length array of integers -->
<data name="arrayCount" inType="win:UInt16"> 
<data name="integers" inType="win:UInt32" count="arrayCount"> 

<!-- The following is illegal because you cannot assign a length value to a data type of a known size -->
<data name="integer" inType="win:UInt32" length="42">

Requisiti

Requisito Valore
Client minimo supportato
Windows Vista [solo app desktop]
Server minimo supportato
Windows Server 2008 [solo app desktop]