ProviderType 複雜類型

定義提供者及其用來定義其事件的元數據。

<xs:complexType name="ProviderType">
    <xs:choice
        minOccurs="0"
        maxOccurs="unbounded"
    >
        <xs:element name="channels"
            type="ChannelListType"
         />
        <xs:element name="levels"
            type="LevelListType"
         />
        <xs:element name="tasks"
            type="TaskListType"
         />
        <xs:element name="opcodes"
            type="OpcodeListType"
         />
        <xs:element name="keywords"
            type="KeywordListType"
         />
        <xs:element name="maps"
            type="MapType"
         />
        <xs:element name="namedQueries"
            type="NamedQueryType"
         />
        <xs:element name="templates"
            type="TemplateListType"
         />
        <xs:element name="events"
            type="DefinitionType"
         />
        <xs:element name="filters"
            type="FilterListType"
         />
        <xs:any
            processContents="lax"
            namespace="##other"
         />
    </xs:choice>
    <xs:attribute name="name"
        type="anyURI"
        use="required"
     />
    <xs:attribute name="guid"
        type="GUIDType"
        use="required"
     />
    <xs:attribute name="resourceFileName"
        type="filePath"
        use="optional"
     />
    <xs:attribute name="messageFileName"
        type="filePath"
        use="optional"
     />
    <xs:attribute name="parameterFileName"
        type="filePath"
        use="optional"
     />
    <xs:attribute name="helpLink"
        type="anyURI"
        use="optional"
     />
    <xs:attribute name="symbol"
        type="CSymbolType"
        use="required"
     />
    <xs:attribute name="message"
        type="strTableRef"
        use="optional"
     />
    <xs:attribute name="source"
        use="optional"
        default="Xml"
    >
        <xs:simpleType>
            <xs:restriction
                base="xs:string"
            >
                <xs:enumeration
                    value="Xml"
                 />
                <xs:enumeration
                    value="Wbem"
                 />
            </xs:restriction>
        </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="warnOnApplicationCompatibilityError"
        type="xs:boolean"
        use="optional"
        default="false"
     />
    <xs:anyAttribute
        processContents="lax"
        namespace="##other"
     />
</xs:complexType>

子元素

元素 類型 描述
管道 ChannelListType 定義提供者可記錄事件的通道清單。
事件 DefinitionType 定義提供者可記錄之事件的事件定義清單。
過濾器 FilterListType 定義提供者支持的篩選清單。 您可以使用篩選條件,就像層級和關鍵詞一樣,來判斷是否要撰寫事件。
Windows Server 2008 和 Windows Vista: 直到 Windows 7 才支援。
關鍵 字 KeywordListType 定義分類事件的關鍵詞清單。
水準 LevelListType 定義指定事件嚴重性之層級的清單。
地圖 MapType 定義您可以在指令清單的範本區段中參考的名稱/值組清單。
namedQueries NamedQueryType 未使用。 定義具名查詢清單,以查詢值的事件消息字串,並在找到時執行指定的動作。
opcodes OpcodeListType 定義可用來將工作內事件分組的opcode清單。
任務 TaskListType 定義提供者可用來群組事件的工作清單。 一般而言,您會使用工作來群組提供者的功能或元件的事件。
templates TemplateListType 定義範本清單,以指定要包含在事件中的數據。

屬性

名稱 類型​​ 描述
guid GUIDType 可唯一識別提供者的 GUID。
helpLink anyURI URL 或 MS 說明連結至提供提供者所引發事件相關信息的內容。
message strTableRef 提供者的當地語系化顯示名稱。 訊息字串會參考指令清單之 stringTable 區段中的當地語系化字串。
messageFileName filePath 包含提供者當地語系化訊息資源之檔案的完整路徑。 檔案可以是可執行檔或 DLL 檔案。
NAME anyURI 提供者的名稱。 名稱應為公司-產品-元件表單。
名稱不能超過 255 個字元,而且不能包含字元:『>』、''、『<&』、』『|』、『\』、『:』、『31』的字元。 此外,名稱必須遵循檔案和登錄機碼名稱的一般條件約束。 您可以在命名檔案和登錄專案大小限制中找到這些條件約束
parameterFileName filePath 包含提供者參數位串資源之檔案的完整路徑。 檔案可以是可執行檔或 DLL 檔案。 您可以指定以分號分隔的多個參數檔案。 當事件的訊息字串包含參數位符串時,會搜尋檔案。 參數可讓您提供可本地化的插入字串。 如需詳細資訊,請參閱。
resourceFileName filePath 包含提供者元數據資源之檔案的完整路徑。 檔案可以是可執行檔或 DLL 檔案。
來源 僅限內部使用。
符號 CSymbolType 用來在應用程式中參考提供者 GUID 的符號。 訊息編譯程式 (MC.exe)使用 符號,為編譯程式產生的頭檔中提供者的 GUID 建立常數。
warnOnApplicationCompatibilityError xs:boolean 僅限內部使用。

備註

如果可用,Windows 事件檢視器 (Eventvwr.exe) 會使用本地化的訊息字串;否則,它會使用 name 屬性中的字串。

resourceFileName、messageFileName 和 parameterFileName 的路徑可以包含環境變數。 如果您定義要用於路徑的新環境變數,您必須重新啟動計算機,讓事件記錄服務可以挑選新的變數;否則,服務將無法找到提供者的資源。

事件的訊息字串可以包含插入字串和參數位符串。 插入字串的格式為 %n,其中 n 是一種基底索引,可從您要插入訊息的事件數據範本識別數據項。 參數位符串(請參閱 parameterFileName 屬性)的格式為 %%n,其中 n 是訊息數據表中的訊息識別碼。 如果事件的訊息字串包含 %1 %%11 = %2 %%12“ ,而 %1 和 %2 的數據項值分別為 8 和 2,而 %%11 和 %%12 的參數位符串分別是 ”quarts“ 和 ”gallons“,格式化字串會是 ”8 quarts = 2 加侖“。

需求

需求
最低支援的用戶端
Windows Vista [僅限傳統型應用程式]
最低支援的伺服器
Windows Server 2008 [僅限傳統型應用程式]