/*** Autogenerated by WIDL 6.0-rc3 from include/sapi53.idl - Do not edit ***/

#ifdef _WIN32
#ifndef __REQUIRED_RPCNDR_H_VERSION__
#define __REQUIRED_RPCNDR_H_VERSION__ 475
#endif
#include <rpc.h>
#include <rpcndr.h>
#endif

#ifndef COM_NO_WINDOWS_H
#include <windows.h>
#include <ole2.h>
#endif

#ifndef __sapi53_h__
#define __sapi53_h__

/* Forward declarations */

#ifndef __ISpNotifySource_FWD_DEFINED__
#define __ISpNotifySource_FWD_DEFINED__
typedef interface ISpNotifySource ISpNotifySource;
#ifdef __cplusplus
interface ISpNotifySource;
#endif /* __cplusplus */
#endif

#ifndef __ISpNotifySink_FWD_DEFINED__
#define __ISpNotifySink_FWD_DEFINED__
typedef interface ISpNotifySink ISpNotifySink;
#ifdef __cplusplus
interface ISpNotifySink;
#endif /* __cplusplus */
#endif

#ifndef __ISpNotifyTranslator_FWD_DEFINED__
#define __ISpNotifyTranslator_FWD_DEFINED__
typedef interface ISpNotifyTranslator ISpNotifyTranslator;
#ifdef __cplusplus
interface ISpNotifyTranslator;
#endif /* __cplusplus */
#endif

#ifndef __ISpDataKey_FWD_DEFINED__
#define __ISpDataKey_FWD_DEFINED__
typedef interface ISpDataKey ISpDataKey;
#ifdef __cplusplus
interface ISpDataKey;
#endif /* __cplusplus */
#endif

#ifndef __ISpObjectWithToken_FWD_DEFINED__
#define __ISpObjectWithToken_FWD_DEFINED__
typedef interface ISpObjectWithToken ISpObjectWithToken;
#ifdef __cplusplus
interface ISpObjectWithToken;
#endif /* __cplusplus */
#endif

#ifndef __IEnumSpObjectTokens_FWD_DEFINED__
#define __IEnumSpObjectTokens_FWD_DEFINED__
typedef interface IEnumSpObjectTokens IEnumSpObjectTokens;
#ifdef __cplusplus
interface IEnumSpObjectTokens;
#endif /* __cplusplus */
#endif

#ifndef __ISpRegDataKey_FWD_DEFINED__
#define __ISpRegDataKey_FWD_DEFINED__
typedef interface ISpRegDataKey ISpRegDataKey;
#ifdef __cplusplus
interface ISpRegDataKey;
#endif /* __cplusplus */
#endif

#ifndef __ISpObjectTokenCategory_FWD_DEFINED__
#define __ISpObjectTokenCategory_FWD_DEFINED__
typedef interface ISpObjectTokenCategory ISpObjectTokenCategory;
#ifdef __cplusplus
interface ISpObjectTokenCategory;
#endif /* __cplusplus */
#endif

#ifndef __ISpObjectToken_FWD_DEFINED__
#define __ISpObjectToken_FWD_DEFINED__
typedef interface ISpObjectToken ISpObjectToken;
#ifdef __cplusplus
interface ISpObjectToken;
#endif /* __cplusplus */
#endif

#ifndef __ISpObjectTokenInit_FWD_DEFINED__
#define __ISpObjectTokenInit_FWD_DEFINED__
typedef interface ISpObjectTokenInit ISpObjectTokenInit;
#ifdef __cplusplus
interface ISpObjectTokenInit;
#endif /* __cplusplus */
#endif

#ifndef __ISpResourceManager_FWD_DEFINED__
#define __ISpResourceManager_FWD_DEFINED__
typedef interface ISpResourceManager ISpResourceManager;
#ifdef __cplusplus
interface ISpResourceManager;
#endif /* __cplusplus */
#endif

#ifndef __ISpEventSource_FWD_DEFINED__
#define __ISpEventSource_FWD_DEFINED__
typedef interface ISpEventSource ISpEventSource;
#ifdef __cplusplus
interface ISpEventSource;
#endif /* __cplusplus */
#endif

#ifndef __ISpEventSource2_FWD_DEFINED__
#define __ISpEventSource2_FWD_DEFINED__
typedef interface ISpEventSource2 ISpEventSource2;
#ifdef __cplusplus
interface ISpEventSource2;
#endif /* __cplusplus */
#endif

#ifndef __ISpEventSink_FWD_DEFINED__
#define __ISpEventSink_FWD_DEFINED__
typedef interface ISpEventSink ISpEventSink;
#ifdef __cplusplus
interface ISpEventSink;
#endif /* __cplusplus */
#endif

#ifndef __ISpStreamFormat_FWD_DEFINED__
#define __ISpStreamFormat_FWD_DEFINED__
typedef interface ISpStreamFormat ISpStreamFormat;
#ifdef __cplusplus
interface ISpStreamFormat;
#endif /* __cplusplus */
#endif

#ifndef __ISpStream_FWD_DEFINED__
#define __ISpStream_FWD_DEFINED__
typedef interface ISpStream ISpStream;
#ifdef __cplusplus
interface ISpStream;
#endif /* __cplusplus */
#endif

#ifndef __ISpStreamFormatConverter_FWD_DEFINED__
#define __ISpStreamFormatConverter_FWD_DEFINED__
typedef interface ISpStreamFormatConverter ISpStreamFormatConverter;
#ifdef __cplusplus
interface ISpStreamFormatConverter;
#endif /* __cplusplus */
#endif

#ifndef __ISpAudio_FWD_DEFINED__
#define __ISpAudio_FWD_DEFINED__
typedef interface ISpAudio ISpAudio;
#ifdef __cplusplus
interface ISpAudio;
#endif /* __cplusplus */
#endif

#ifndef __ISpMMSysAudio_FWD_DEFINED__
#define __ISpMMSysAudio_FWD_DEFINED__
typedef interface ISpMMSysAudio ISpMMSysAudio;
#ifdef __cplusplus
interface ISpMMSysAudio;
#endif /* __cplusplus */
#endif

#ifndef __ISpTranscript_FWD_DEFINED__
#define __ISpTranscript_FWD_DEFINED__
typedef interface ISpTranscript ISpTranscript;
#ifdef __cplusplus
interface ISpTranscript;
#endif /* __cplusplus */
#endif

#ifndef __ISpLexicon_FWD_DEFINED__
#define __ISpLexicon_FWD_DEFINED__
typedef interface ISpLexicon ISpLexicon;
#ifdef __cplusplus
interface ISpLexicon;
#endif /* __cplusplus */
#endif

#ifndef __ISpContainerLexicon_FWD_DEFINED__
#define __ISpContainerLexicon_FWD_DEFINED__
typedef interface ISpContainerLexicon ISpContainerLexicon;
#ifdef __cplusplus
interface ISpContainerLexicon;
#endif /* __cplusplus */
#endif

#ifndef __ISpShortcut_FWD_DEFINED__
#define __ISpShortcut_FWD_DEFINED__
typedef interface ISpShortcut ISpShortcut;
#ifdef __cplusplus
interface ISpShortcut;
#endif /* __cplusplus */
#endif

#ifndef __ISpPhoneConverter_FWD_DEFINED__
#define __ISpPhoneConverter_FWD_DEFINED__
typedef interface ISpPhoneConverter ISpPhoneConverter;
#ifdef __cplusplus
interface ISpPhoneConverter;
#endif /* __cplusplus */
#endif

#ifndef __ISpPhoneticAlphabetConverter_FWD_DEFINED__
#define __ISpPhoneticAlphabetConverter_FWD_DEFINED__
typedef interface ISpPhoneticAlphabetConverter ISpPhoneticAlphabetConverter;
#ifdef __cplusplus
interface ISpPhoneticAlphabetConverter;
#endif /* __cplusplus */
#endif

#ifndef __ISpPhoneticAlphabetSelection_FWD_DEFINED__
#define __ISpPhoneticAlphabetSelection_FWD_DEFINED__
typedef interface ISpPhoneticAlphabetSelection ISpPhoneticAlphabetSelection;
#ifdef __cplusplus
interface ISpPhoneticAlphabetSelection;
#endif /* __cplusplus */
#endif

#ifndef __ISpVoice_FWD_DEFINED__
#define __ISpVoice_FWD_DEFINED__
typedef interface ISpVoice ISpVoice;
#ifdef __cplusplus
interface ISpVoice;
#endif /* __cplusplus */
#endif

#ifndef __ISpPhrase_FWD_DEFINED__
#define __ISpPhrase_FWD_DEFINED__
typedef interface ISpPhrase ISpPhrase;
#ifdef __cplusplus
interface ISpPhrase;
#endif /* __cplusplus */
#endif

#ifndef __ISpPhraseAlt_FWD_DEFINED__
#define __ISpPhraseAlt_FWD_DEFINED__
typedef interface ISpPhraseAlt ISpPhraseAlt;
#ifdef __cplusplus
interface ISpPhraseAlt;
#endif /* __cplusplus */
#endif

#ifndef __ISpPhrase2_FWD_DEFINED__
#define __ISpPhrase2_FWD_DEFINED__
typedef interface ISpPhrase2 ISpPhrase2;
#ifdef __cplusplus
interface ISpPhrase2;
#endif /* __cplusplus */
#endif

#ifndef __ISpRecoResult_FWD_DEFINED__
#define __ISpRecoResult_FWD_DEFINED__
typedef interface ISpRecoResult ISpRecoResult;
#ifdef __cplusplus
interface ISpRecoResult;
#endif /* __cplusplus */
#endif

#ifndef __ISpRecoResult2_FWD_DEFINED__
#define __ISpRecoResult2_FWD_DEFINED__
typedef interface ISpRecoResult2 ISpRecoResult2;
#ifdef __cplusplus
interface ISpRecoResult2;
#endif /* __cplusplus */
#endif

#ifndef __ISpXMLRecoResult_FWD_DEFINED__
#define __ISpXMLRecoResult_FWD_DEFINED__
typedef interface ISpXMLRecoResult ISpXMLRecoResult;
#ifdef __cplusplus
interface ISpXMLRecoResult;
#endif /* __cplusplus */
#endif

#ifndef __ISpGrammarBuilder_FWD_DEFINED__
#define __ISpGrammarBuilder_FWD_DEFINED__
typedef interface ISpGrammarBuilder ISpGrammarBuilder;
#ifdef __cplusplus
interface ISpGrammarBuilder;
#endif /* __cplusplus */
#endif

#ifndef __ISpRecoGrammar_FWD_DEFINED__
#define __ISpRecoGrammar_FWD_DEFINED__
typedef interface ISpRecoGrammar ISpRecoGrammar;
#ifdef __cplusplus
interface ISpRecoGrammar;
#endif /* __cplusplus */
#endif

#ifndef __ISpGrammarBuilder2_FWD_DEFINED__
#define __ISpGrammarBuilder2_FWD_DEFINED__
typedef interface ISpGrammarBuilder2 ISpGrammarBuilder2;
#ifdef __cplusplus
interface ISpGrammarBuilder2;
#endif /* __cplusplus */
#endif

#ifndef __ISpRecoGrammar2_FWD_DEFINED__
#define __ISpRecoGrammar2_FWD_DEFINED__
typedef interface ISpRecoGrammar2 ISpRecoGrammar2;
#ifdef __cplusplus
interface ISpRecoGrammar2;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechResourceLoader_FWD_DEFINED__
#define __ISpeechResourceLoader_FWD_DEFINED__
typedef interface ISpeechResourceLoader ISpeechResourceLoader;
#ifdef __cplusplus
interface ISpeechResourceLoader;
#endif /* __cplusplus */
#endif

#ifndef __ISpRecoContext_FWD_DEFINED__
#define __ISpRecoContext_FWD_DEFINED__
typedef interface ISpRecoContext ISpRecoContext;
#ifdef __cplusplus
interface ISpRecoContext;
#endif /* __cplusplus */
#endif

#ifndef __ISpRecoContext2_FWD_DEFINED__
#define __ISpRecoContext2_FWD_DEFINED__
typedef interface ISpRecoContext2 ISpRecoContext2;
#ifdef __cplusplus
interface ISpRecoContext2;
#endif /* __cplusplus */
#endif

#ifndef __ISpProperties_FWD_DEFINED__
#define __ISpProperties_FWD_DEFINED__
typedef interface ISpProperties ISpProperties;
#ifdef __cplusplus
interface ISpProperties;
#endif /* __cplusplus */
#endif

#ifndef __ISpRecognizer_FWD_DEFINED__
#define __ISpRecognizer_FWD_DEFINED__
typedef interface ISpRecognizer ISpRecognizer;
#ifdef __cplusplus
interface ISpRecognizer;
#endif /* __cplusplus */
#endif

#ifndef __ISpSerializeState_FWD_DEFINED__
#define __ISpSerializeState_FWD_DEFINED__
typedef interface ISpSerializeState ISpSerializeState;
#ifdef __cplusplus
interface ISpSerializeState;
#endif /* __cplusplus */
#endif

#ifndef __ISpRecognizer2_FWD_DEFINED__
#define __ISpRecognizer2_FWD_DEFINED__
typedef interface ISpRecognizer2 ISpRecognizer2;
#ifdef __cplusplus
interface ISpRecognizer2;
#endif /* __cplusplus */
#endif

#ifndef __ISpEnginePronunciation_FWD_DEFINED__
#define __ISpEnginePronunciation_FWD_DEFINED__
typedef interface ISpEnginePronunciation ISpEnginePronunciation;
#ifdef __cplusplus
interface ISpEnginePronunciation;
#endif /* __cplusplus */
#endif

#ifndef __ISpDisplayAlternates_FWD_DEFINED__
#define __ISpDisplayAlternates_FWD_DEFINED__
typedef interface ISpDisplayAlternates ISpDisplayAlternates;
#ifdef __cplusplus
interface ISpDisplayAlternates;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechDataKey_FWD_DEFINED__
#define __ISpeechDataKey_FWD_DEFINED__
typedef interface ISpeechDataKey ISpeechDataKey;
#ifdef __cplusplus
interface ISpeechDataKey;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechObjectToken_FWD_DEFINED__
#define __ISpeechObjectToken_FWD_DEFINED__
typedef interface ISpeechObjectToken ISpeechObjectToken;
#ifdef __cplusplus
interface ISpeechObjectToken;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechObjectTokens_FWD_DEFINED__
#define __ISpeechObjectTokens_FWD_DEFINED__
typedef interface ISpeechObjectTokens ISpeechObjectTokens;
#ifdef __cplusplus
interface ISpeechObjectTokens;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechObjectTokenCategory_FWD_DEFINED__
#define __ISpeechObjectTokenCategory_FWD_DEFINED__
typedef interface ISpeechObjectTokenCategory ISpeechObjectTokenCategory;
#ifdef __cplusplus
interface ISpeechObjectTokenCategory;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechAudioFormat_FWD_DEFINED__
#define __ISpeechAudioFormat_FWD_DEFINED__
typedef interface ISpeechAudioFormat ISpeechAudioFormat;
#ifdef __cplusplus
interface ISpeechAudioFormat;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechBaseStream_FWD_DEFINED__
#define __ISpeechBaseStream_FWD_DEFINED__
typedef interface ISpeechBaseStream ISpeechBaseStream;
#ifdef __cplusplus
interface ISpeechBaseStream;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechAudio_FWD_DEFINED__
#define __ISpeechAudio_FWD_DEFINED__
typedef interface ISpeechAudio ISpeechAudio;
#ifdef __cplusplus
interface ISpeechAudio;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechMMSysAudio_FWD_DEFINED__
#define __ISpeechMMSysAudio_FWD_DEFINED__
typedef interface ISpeechMMSysAudio ISpeechMMSysAudio;
#ifdef __cplusplus
interface ISpeechMMSysAudio;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechFileStream_FWD_DEFINED__
#define __ISpeechFileStream_FWD_DEFINED__
typedef interface ISpeechFileStream ISpeechFileStream;
#ifdef __cplusplus
interface ISpeechFileStream;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechCustomStream_FWD_DEFINED__
#define __ISpeechCustomStream_FWD_DEFINED__
typedef interface ISpeechCustomStream ISpeechCustomStream;
#ifdef __cplusplus
interface ISpeechCustomStream;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechMemoryStream_FWD_DEFINED__
#define __ISpeechMemoryStream_FWD_DEFINED__
typedef interface ISpeechMemoryStream ISpeechMemoryStream;
#ifdef __cplusplus
interface ISpeechMemoryStream;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechAudioStatus_FWD_DEFINED__
#define __ISpeechAudioStatus_FWD_DEFINED__
typedef interface ISpeechAudioStatus ISpeechAudioStatus;
#ifdef __cplusplus
interface ISpeechAudioStatus;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechAudioBufferInfo_FWD_DEFINED__
#define __ISpeechAudioBufferInfo_FWD_DEFINED__
typedef interface ISpeechAudioBufferInfo ISpeechAudioBufferInfo;
#ifdef __cplusplus
interface ISpeechAudioBufferInfo;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechWaveFormatEx_FWD_DEFINED__
#define __ISpeechWaveFormatEx_FWD_DEFINED__
typedef interface ISpeechWaveFormatEx ISpeechWaveFormatEx;
#ifdef __cplusplus
interface ISpeechWaveFormatEx;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechVoice_FWD_DEFINED__
#define __ISpeechVoice_FWD_DEFINED__
typedef interface ISpeechVoice ISpeechVoice;
#ifdef __cplusplus
interface ISpeechVoice;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechVoiceStatus_FWD_DEFINED__
#define __ISpeechVoiceStatus_FWD_DEFINED__
typedef interface ISpeechVoiceStatus ISpeechVoiceStatus;
#ifdef __cplusplus
interface ISpeechVoiceStatus;
#endif /* __cplusplus */
#endif

#ifndef ___ISpeechVoiceEvents_FWD_DEFINED__
#define ___ISpeechVoiceEvents_FWD_DEFINED__
typedef interface _ISpeechVoiceEvents _ISpeechVoiceEvents;
#ifdef __cplusplus
interface _ISpeechVoiceEvents;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechRecognizer_FWD_DEFINED__
#define __ISpeechRecognizer_FWD_DEFINED__
typedef interface ISpeechRecognizer ISpeechRecognizer;
#ifdef __cplusplus
interface ISpeechRecognizer;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechRecognizerStatus_FWD_DEFINED__
#define __ISpeechRecognizerStatus_FWD_DEFINED__
typedef interface ISpeechRecognizerStatus ISpeechRecognizerStatus;
#ifdef __cplusplus
interface ISpeechRecognizerStatus;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechRecoContext_FWD_DEFINED__
#define __ISpeechRecoContext_FWD_DEFINED__
typedef interface ISpeechRecoContext ISpeechRecoContext;
#ifdef __cplusplus
interface ISpeechRecoContext;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechRecoGrammar_FWD_DEFINED__
#define __ISpeechRecoGrammar_FWD_DEFINED__
typedef interface ISpeechRecoGrammar ISpeechRecoGrammar;
#ifdef __cplusplus
interface ISpeechRecoGrammar;
#endif /* __cplusplus */
#endif

#ifndef ___ISpeechRecoContextEvents_FWD_DEFINED__
#define ___ISpeechRecoContextEvents_FWD_DEFINED__
typedef interface _ISpeechRecoContextEvents _ISpeechRecoContextEvents;
#ifdef __cplusplus
interface _ISpeechRecoContextEvents;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechGrammarRule_FWD_DEFINED__
#define __ISpeechGrammarRule_FWD_DEFINED__
typedef interface ISpeechGrammarRule ISpeechGrammarRule;
#ifdef __cplusplus
interface ISpeechGrammarRule;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechGrammarRules_FWD_DEFINED__
#define __ISpeechGrammarRules_FWD_DEFINED__
typedef interface ISpeechGrammarRules ISpeechGrammarRules;
#ifdef __cplusplus
interface ISpeechGrammarRules;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechGrammarRuleState_FWD_DEFINED__
#define __ISpeechGrammarRuleState_FWD_DEFINED__
typedef interface ISpeechGrammarRuleState ISpeechGrammarRuleState;
#ifdef __cplusplus
interface ISpeechGrammarRuleState;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechGrammarRuleStateTransitions_FWD_DEFINED__
#define __ISpeechGrammarRuleStateTransitions_FWD_DEFINED__
typedef interface ISpeechGrammarRuleStateTransitions ISpeechGrammarRuleStateTransitions;
#ifdef __cplusplus
interface ISpeechGrammarRuleStateTransitions;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechGrammarRuleStateTransition_FWD_DEFINED__
#define __ISpeechGrammarRuleStateTransition_FWD_DEFINED__
typedef interface ISpeechGrammarRuleStateTransition ISpeechGrammarRuleStateTransition;
#ifdef __cplusplus
interface ISpeechGrammarRuleStateTransition;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechTextSelectionInformation_FWD_DEFINED__
#define __ISpeechTextSelectionInformation_FWD_DEFINED__
typedef interface ISpeechTextSelectionInformation ISpeechTextSelectionInformation;
#ifdef __cplusplus
interface ISpeechTextSelectionInformation;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechRecoResult_FWD_DEFINED__
#define __ISpeechRecoResult_FWD_DEFINED__
typedef interface ISpeechRecoResult ISpeechRecoResult;
#ifdef __cplusplus
interface ISpeechRecoResult;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechXMLRecoResult_FWD_DEFINED__
#define __ISpeechXMLRecoResult_FWD_DEFINED__
typedef interface ISpeechXMLRecoResult ISpeechXMLRecoResult;
#ifdef __cplusplus
interface ISpeechXMLRecoResult;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechRecoResult2_FWD_DEFINED__
#define __ISpeechRecoResult2_FWD_DEFINED__
typedef interface ISpeechRecoResult2 ISpeechRecoResult2;
#ifdef __cplusplus
interface ISpeechRecoResult2;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechRecoResultDispatch_FWD_DEFINED__
#define __ISpeechRecoResultDispatch_FWD_DEFINED__
typedef interface ISpeechRecoResultDispatch ISpeechRecoResultDispatch;
#ifdef __cplusplus
interface ISpeechRecoResultDispatch;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechPhraseInfoBuilder_FWD_DEFINED__
#define __ISpeechPhraseInfoBuilder_FWD_DEFINED__
typedef interface ISpeechPhraseInfoBuilder ISpeechPhraseInfoBuilder;
#ifdef __cplusplus
interface ISpeechPhraseInfoBuilder;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechRecoResultTimes_FWD_DEFINED__
#define __ISpeechRecoResultTimes_FWD_DEFINED__
typedef interface ISpeechRecoResultTimes ISpeechRecoResultTimes;
#ifdef __cplusplus
interface ISpeechRecoResultTimes;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechPhraseAlternate_FWD_DEFINED__
#define __ISpeechPhraseAlternate_FWD_DEFINED__
typedef interface ISpeechPhraseAlternate ISpeechPhraseAlternate;
#ifdef __cplusplus
interface ISpeechPhraseAlternate;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechPhraseAlternates_FWD_DEFINED__
#define __ISpeechPhraseAlternates_FWD_DEFINED__
typedef interface ISpeechPhraseAlternates ISpeechPhraseAlternates;
#ifdef __cplusplus
interface ISpeechPhraseAlternates;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechPhraseInfo_FWD_DEFINED__
#define __ISpeechPhraseInfo_FWD_DEFINED__
typedef interface ISpeechPhraseInfo ISpeechPhraseInfo;
#ifdef __cplusplus
interface ISpeechPhraseInfo;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechPhraseElement_FWD_DEFINED__
#define __ISpeechPhraseElement_FWD_DEFINED__
typedef interface ISpeechPhraseElement ISpeechPhraseElement;
#ifdef __cplusplus
interface ISpeechPhraseElement;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechPhraseElements_FWD_DEFINED__
#define __ISpeechPhraseElements_FWD_DEFINED__
typedef interface ISpeechPhraseElements ISpeechPhraseElements;
#ifdef __cplusplus
interface ISpeechPhraseElements;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechPhraseReplacement_FWD_DEFINED__
#define __ISpeechPhraseReplacement_FWD_DEFINED__
typedef interface ISpeechPhraseReplacement ISpeechPhraseReplacement;
#ifdef __cplusplus
interface ISpeechPhraseReplacement;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechPhraseReplacements_FWD_DEFINED__
#define __ISpeechPhraseReplacements_FWD_DEFINED__
typedef interface ISpeechPhraseReplacements ISpeechPhraseReplacements;
#ifdef __cplusplus
interface ISpeechPhraseReplacements;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechPhraseProperty_FWD_DEFINED__
#define __ISpeechPhraseProperty_FWD_DEFINED__
typedef interface ISpeechPhraseProperty ISpeechPhraseProperty;
#ifdef __cplusplus
interface ISpeechPhraseProperty;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechPhraseProperties_FWD_DEFINED__
#define __ISpeechPhraseProperties_FWD_DEFINED__
typedef interface ISpeechPhraseProperties ISpeechPhraseProperties;
#ifdef __cplusplus
interface ISpeechPhraseProperties;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechPhraseRule_FWD_DEFINED__
#define __ISpeechPhraseRule_FWD_DEFINED__
typedef interface ISpeechPhraseRule ISpeechPhraseRule;
#ifdef __cplusplus
interface ISpeechPhraseRule;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechPhraseRules_FWD_DEFINED__
#define __ISpeechPhraseRules_FWD_DEFINED__
typedef interface ISpeechPhraseRules ISpeechPhraseRules;
#ifdef __cplusplus
interface ISpeechPhraseRules;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechLexiconWords_FWD_DEFINED__
#define __ISpeechLexiconWords_FWD_DEFINED__
typedef interface ISpeechLexiconWords ISpeechLexiconWords;
#ifdef __cplusplus
interface ISpeechLexiconWords;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechLexicon_FWD_DEFINED__
#define __ISpeechLexicon_FWD_DEFINED__
typedef interface ISpeechLexicon ISpeechLexicon;
#ifdef __cplusplus
interface ISpeechLexicon;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechLexiconWord_FWD_DEFINED__
#define __ISpeechLexiconWord_FWD_DEFINED__
typedef interface ISpeechLexiconWord ISpeechLexiconWord;
#ifdef __cplusplus
interface ISpeechLexiconWord;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechLexiconPronunciations_FWD_DEFINED__
#define __ISpeechLexiconPronunciations_FWD_DEFINED__
typedef interface ISpeechLexiconPronunciations ISpeechLexiconPronunciations;
#ifdef __cplusplus
interface ISpeechLexiconPronunciations;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechLexiconPronunciation_FWD_DEFINED__
#define __ISpeechLexiconPronunciation_FWD_DEFINED__
typedef interface ISpeechLexiconPronunciation ISpeechLexiconPronunciation;
#ifdef __cplusplus
interface ISpeechLexiconPronunciation;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechPhoneConverter_FWD_DEFINED__
#define __ISpeechPhoneConverter_FWD_DEFINED__
typedef interface ISpeechPhoneConverter ISpeechPhoneConverter;
#ifdef __cplusplus
interface ISpeechPhoneConverter;
#endif /* __cplusplus */
#endif

#ifndef __SpNotifyTranslator_FWD_DEFINED__
#define __SpNotifyTranslator_FWD_DEFINED__
#ifdef __cplusplus
typedef class SpNotifyTranslator SpNotifyTranslator;
#else
typedef struct SpNotifyTranslator SpNotifyTranslator;
#endif /* defined __cplusplus */
#endif /* defined __SpNotifyTranslator_FWD_DEFINED__ */

#ifndef __SpObjectTokenCategory_FWD_DEFINED__
#define __SpObjectTokenCategory_FWD_DEFINED__
#ifdef __cplusplus
typedef class SpObjectTokenCategory SpObjectTokenCategory;
#else
typedef struct SpObjectTokenCategory SpObjectTokenCategory;
#endif /* defined __cplusplus */
#endif /* defined __SpObjectTokenCategory_FWD_DEFINED__ */

#ifndef __SpObjectToken_FWD_DEFINED__
#define __SpObjectToken_FWD_DEFINED__
#ifdef __cplusplus
typedef class SpObjectToken SpObjectToken;
#else
typedef struct SpObjectToken SpObjectToken;
#endif /* defined __cplusplus */
#endif /* defined __SpObjectToken_FWD_DEFINED__ */

#ifndef __SpResourceManager_FWD_DEFINED__
#define __SpResourceManager_FWD_DEFINED__
#ifdef __cplusplus
typedef class SpResourceManager SpResourceManager;
#else
typedef struct SpResourceManager SpResourceManager;
#endif /* defined __cplusplus */
#endif /* defined __SpResourceManager_FWD_DEFINED__ */

#ifndef __SpStreamFormatConverter_FWD_DEFINED__
#define __SpStreamFormatConverter_FWD_DEFINED__
#ifdef __cplusplus
typedef class SpStreamFormatConverter SpStreamFormatConverter;
#else
typedef struct SpStreamFormatConverter SpStreamFormatConverter;
#endif /* defined __cplusplus */
#endif /* defined __SpStreamFormatConverter_FWD_DEFINED__ */

#ifndef __SpMMAudioEnum_FWD_DEFINED__
#define __SpMMAudioEnum_FWD_DEFINED__
#ifdef __cplusplus
typedef class SpMMAudioEnum SpMMAudioEnum;
#else
typedef struct SpMMAudioEnum SpMMAudioEnum;
#endif /* defined __cplusplus */
#endif /* defined __SpMMAudioEnum_FWD_DEFINED__ */

#ifndef __SpMMAudioIn_FWD_DEFINED__
#define __SpMMAudioIn_FWD_DEFINED__
#ifdef __cplusplus
typedef class SpMMAudioIn SpMMAudioIn;
#else
typedef struct SpMMAudioIn SpMMAudioIn;
#endif /* defined __cplusplus */
#endif /* defined __SpMMAudioIn_FWD_DEFINED__ */

#ifndef __SpMMAudioOut_FWD_DEFINED__
#define __SpMMAudioOut_FWD_DEFINED__
#ifdef __cplusplus
typedef class SpMMAudioOut SpMMAudioOut;
#else
typedef struct SpMMAudioOut SpMMAudioOut;
#endif /* defined __cplusplus */
#endif /* defined __SpMMAudioOut_FWD_DEFINED__ */

#ifndef __SpStream_FWD_DEFINED__
#define __SpStream_FWD_DEFINED__
#ifdef __cplusplus
typedef class SpStream SpStream;
#else
typedef struct SpStream SpStream;
#endif /* defined __cplusplus */
#endif /* defined __SpStream_FWD_DEFINED__ */

#ifndef __SpVoice_FWD_DEFINED__
#define __SpVoice_FWD_DEFINED__
#ifdef __cplusplus
typedef class SpVoice SpVoice;
#else
typedef struct SpVoice SpVoice;
#endif /* defined __cplusplus */
#endif /* defined __SpVoice_FWD_DEFINED__ */

#ifndef __SpSharedRecoContext_FWD_DEFINED__
#define __SpSharedRecoContext_FWD_DEFINED__
#ifdef __cplusplus
typedef class SpSharedRecoContext SpSharedRecoContext;
#else
typedef struct SpSharedRecoContext SpSharedRecoContext;
#endif /* defined __cplusplus */
#endif /* defined __SpSharedRecoContext_FWD_DEFINED__ */

#ifndef __SpInprocRecognizer_FWD_DEFINED__
#define __SpInprocRecognizer_FWD_DEFINED__
#ifdef __cplusplus
typedef class SpInprocRecognizer SpInprocRecognizer;
#else
typedef struct SpInprocRecognizer SpInprocRecognizer;
#endif /* defined __cplusplus */
#endif /* defined __SpInprocRecognizer_FWD_DEFINED__ */

#ifndef __SpSharedRecognizer_FWD_DEFINED__
#define __SpSharedRecognizer_FWD_DEFINED__
#ifdef __cplusplus
typedef class SpSharedRecognizer SpSharedRecognizer;
#else
typedef struct SpSharedRecognizer SpSharedRecognizer;
#endif /* defined __cplusplus */
#endif /* defined __SpSharedRecognizer_FWD_DEFINED__ */

#ifndef __SpLexicon_FWD_DEFINED__
#define __SpLexicon_FWD_DEFINED__
#ifdef __cplusplus
typedef class SpLexicon SpLexicon;
#else
typedef struct SpLexicon SpLexicon;
#endif /* defined __cplusplus */
#endif /* defined __SpLexicon_FWD_DEFINED__ */

#ifndef __SpUnCompressedLexicon_FWD_DEFINED__
#define __SpUnCompressedLexicon_FWD_DEFINED__
#ifdef __cplusplus
typedef class SpUnCompressedLexicon SpUnCompressedLexicon;
#else
typedef struct SpUnCompressedLexicon SpUnCompressedLexicon;
#endif /* defined __cplusplus */
#endif /* defined __SpUnCompressedLexicon_FWD_DEFINED__ */

#ifndef __SpCompressedLexicon_FWD_DEFINED__
#define __SpCompressedLexicon_FWD_DEFINED__
#ifdef __cplusplus
typedef class SpCompressedLexicon SpCompressedLexicon;
#else
typedef struct SpCompressedLexicon SpCompressedLexicon;
#endif /* defined __cplusplus */
#endif /* defined __SpCompressedLexicon_FWD_DEFINED__ */

#ifndef __SpShortcut_FWD_DEFINED__
#define __SpShortcut_FWD_DEFINED__
#ifdef __cplusplus
typedef class SpShortcut SpShortcut;
#else
typedef struct SpShortcut SpShortcut;
#endif /* defined __cplusplus */
#endif /* defined __SpShortcut_FWD_DEFINED__ */

#ifndef __SpPhoneConverter_FWD_DEFINED__
#define __SpPhoneConverter_FWD_DEFINED__
#ifdef __cplusplus
typedef class SpPhoneConverter SpPhoneConverter;
#else
typedef struct SpPhoneConverter SpPhoneConverter;
#endif /* defined __cplusplus */
#endif /* defined __SpPhoneConverter_FWD_DEFINED__ */

#ifndef __SpPhoneticAlphabetConverter_FWD_DEFINED__
#define __SpPhoneticAlphabetConverter_FWD_DEFINED__
#ifdef __cplusplus
typedef class SpPhoneticAlphabetConverter SpPhoneticAlphabetConverter;
#else
typedef struct SpPhoneticAlphabetConverter SpPhoneticAlphabetConverter;
#endif /* defined __cplusplus */
#endif /* defined __SpPhoneticAlphabetConverter_FWD_DEFINED__ */

#ifndef __SpNullPhoneConverter_FWD_DEFINED__
#define __SpNullPhoneConverter_FWD_DEFINED__
#ifdef __cplusplus
typedef class SpNullPhoneConverter SpNullPhoneConverter;
#else
typedef struct SpNullPhoneConverter SpNullPhoneConverter;
#endif /* defined __cplusplus */
#endif /* defined __SpNullPhoneConverter_FWD_DEFINED__ */

#ifndef __SpTextSelectionInformation_FWD_DEFINED__
#define __SpTextSelectionInformation_FWD_DEFINED__
#ifdef __cplusplus
typedef class SpTextSelectionInformation SpTextSelectionInformation;
#else
typedef struct SpTextSelectionInformation SpTextSelectionInformation;
#endif /* defined __cplusplus */
#endif /* defined __SpTextSelectionInformation_FWD_DEFINED__ */

#ifndef __SpPhraseInfoBuilder_FWD_DEFINED__
#define __SpPhraseInfoBuilder_FWD_DEFINED__
#ifdef __cplusplus
typedef class SpPhraseInfoBuilder SpPhraseInfoBuilder;
#else
typedef struct SpPhraseInfoBuilder SpPhraseInfoBuilder;
#endif /* defined __cplusplus */
#endif /* defined __SpPhraseInfoBuilder_FWD_DEFINED__ */

#ifndef __SpAudioFormat_FWD_DEFINED__
#define __SpAudioFormat_FWD_DEFINED__
#ifdef __cplusplus
typedef class SpAudioFormat SpAudioFormat;
#else
typedef struct SpAudioFormat SpAudioFormat;
#endif /* defined __cplusplus */
#endif /* defined __SpAudioFormat_FWD_DEFINED__ */

#ifndef __SpWaveFormatEx_FWD_DEFINED__
#define __SpWaveFormatEx_FWD_DEFINED__
#ifdef __cplusplus
typedef class SpWaveFormatEx SpWaveFormatEx;
#else
typedef struct SpWaveFormatEx SpWaveFormatEx;
#endif /* defined __cplusplus */
#endif /* defined __SpWaveFormatEx_FWD_DEFINED__ */

#ifndef __SpInProcRecoContext_FWD_DEFINED__
#define __SpInProcRecoContext_FWD_DEFINED__
#ifdef __cplusplus
typedef class SpInProcRecoContext SpInProcRecoContext;
#else
typedef struct SpInProcRecoContext SpInProcRecoContext;
#endif /* defined __cplusplus */
#endif /* defined __SpInProcRecoContext_FWD_DEFINED__ */

#ifndef __SpCustomStream_FWD_DEFINED__
#define __SpCustomStream_FWD_DEFINED__
#ifdef __cplusplus
typedef class SpCustomStream SpCustomStream;
#else
typedef struct SpCustomStream SpCustomStream;
#endif /* defined __cplusplus */
#endif /* defined __SpCustomStream_FWD_DEFINED__ */

#ifndef __SpFileStream_FWD_DEFINED__
#define __SpFileStream_FWD_DEFINED__
#ifdef __cplusplus
typedef class SpFileStream SpFileStream;
#else
typedef struct SpFileStream SpFileStream;
#endif /* defined __cplusplus */
#endif /* defined __SpFileStream_FWD_DEFINED__ */

#ifndef __SpMemoryStream_FWD_DEFINED__
#define __SpMemoryStream_FWD_DEFINED__
#ifdef __cplusplus
typedef class SpMemoryStream SpMemoryStream;
#else
typedef struct SpMemoryStream SpMemoryStream;
#endif /* defined __cplusplus */
#endif /* defined __SpMemoryStream_FWD_DEFINED__ */

/* Headers for imported files */

#include <oaidl.h>
#include <ocidl.h>

#ifdef __cplusplus
extern "C" {
#endif

#ifndef _SAPI_VER
#error "you have to include <sapi.h> header before this."
#endif
#if 0
typedef struct WAVEFORMATEX {
    WORD wFormatTag;
    WORD nChannels;
    DWORD nSamplesPerSec;
    DWORD nAvgBytesPerSec;
    WORD nBlockAlign;
    WORD wBitsPerSample;
    WORD cbSize;
} WAVEFORMATEX;
#endif
#ifndef __ISpNotifySource_FWD_DEFINED__
#define __ISpNotifySource_FWD_DEFINED__
typedef interface ISpNotifySource ISpNotifySource;
#ifdef __cplusplus
interface ISpNotifySource;
#endif /* __cplusplus */
#endif

#ifndef __ISpNotifySink_FWD_DEFINED__
#define __ISpNotifySink_FWD_DEFINED__
typedef interface ISpNotifySink ISpNotifySink;
#ifdef __cplusplus
interface ISpNotifySink;
#endif /* __cplusplus */
#endif

#ifndef __ISpNotifyTranslator_FWD_DEFINED__
#define __ISpNotifyTranslator_FWD_DEFINED__
typedef interface ISpNotifyTranslator ISpNotifyTranslator;
#ifdef __cplusplus
interface ISpNotifyTranslator;
#endif /* __cplusplus */
#endif

#ifndef __ISpDataKey_FWD_DEFINED__
#define __ISpDataKey_FWD_DEFINED__
typedef interface ISpDataKey ISpDataKey;
#ifdef __cplusplus
interface ISpDataKey;
#endif /* __cplusplus */
#endif

#ifndef __ISpObjectTokenCategory_FWD_DEFINED__
#define __ISpObjectTokenCategory_FWD_DEFINED__
typedef interface ISpObjectTokenCategory ISpObjectTokenCategory;
#ifdef __cplusplus
interface ISpObjectTokenCategory;
#endif /* __cplusplus */
#endif

#ifndef __ISpObjectToken_FWD_DEFINED__
#define __ISpObjectToken_FWD_DEFINED__
typedef interface ISpObjectToken ISpObjectToken;
#ifdef __cplusplus
interface ISpObjectToken;
#endif /* __cplusplus */
#endif

#ifndef __IEnumSpObjectTokens_FWD_DEFINED__
#define __IEnumSpObjectTokens_FWD_DEFINED__
typedef interface IEnumSpObjectTokens IEnumSpObjectTokens;
#ifdef __cplusplus
interface IEnumSpObjectTokens;
#endif /* __cplusplus */
#endif

#ifndef __ISpObjectWithToken_FWD_DEFINED__
#define __ISpObjectWithToken_FWD_DEFINED__
typedef interface ISpObjectWithToken ISpObjectWithToken;
#ifdef __cplusplus
interface ISpObjectWithToken;
#endif /* __cplusplus */
#endif

#ifndef __ISpResourceManager_FWD_DEFINED__
#define __ISpResourceManager_FWD_DEFINED__
typedef interface ISpResourceManager ISpResourceManager;
#ifdef __cplusplus
interface ISpResourceManager;
#endif /* __cplusplus */
#endif

#ifndef __ISpEventSource_FWD_DEFINED__
#define __ISpEventSource_FWD_DEFINED__
typedef interface ISpEventSource ISpEventSource;
#ifdef __cplusplus
interface ISpEventSource;
#endif /* __cplusplus */
#endif

#ifndef __ISpEventSink_FWD_DEFINED__
#define __ISpEventSink_FWD_DEFINED__
typedef interface ISpEventSink ISpEventSink;
#ifdef __cplusplus
interface ISpEventSink;
#endif /* __cplusplus */
#endif

#ifndef __ISpStreamFormat_FWD_DEFINED__
#define __ISpStreamFormat_FWD_DEFINED__
typedef interface ISpStreamFormat ISpStreamFormat;
#ifdef __cplusplus
interface ISpStreamFormat;
#endif /* __cplusplus */
#endif

#ifndef __ISpStream_FWD_DEFINED__
#define __ISpStream_FWD_DEFINED__
typedef interface ISpStream ISpStream;
#ifdef __cplusplus
interface ISpStream;
#endif /* __cplusplus */
#endif

#ifndef __ISpStreamFormatConverter_FWD_DEFINED__
#define __ISpStreamFormatConverter_FWD_DEFINED__
typedef interface ISpStreamFormatConverter ISpStreamFormatConverter;
#ifdef __cplusplus
interface ISpStreamFormatConverter;
#endif /* __cplusplus */
#endif

#ifndef __ISpAudio_FWD_DEFINED__
#define __ISpAudio_FWD_DEFINED__
typedef interface ISpAudio ISpAudio;
#ifdef __cplusplus
interface ISpAudio;
#endif /* __cplusplus */
#endif

#ifndef __ISpMMSysAudio_FWD_DEFINED__
#define __ISpMMSysAudio_FWD_DEFINED__
typedef interface ISpMMSysAudio ISpMMSysAudio;
#ifdef __cplusplus
interface ISpMMSysAudio;
#endif /* __cplusplus */
#endif

#ifndef __ISpTranscript_FWD_DEFINED__
#define __ISpTranscript_FWD_DEFINED__
typedef interface ISpTranscript ISpTranscript;
#ifdef __cplusplus
interface ISpTranscript;
#endif /* __cplusplus */
#endif

#ifndef __ISpVoice_FWD_DEFINED__
#define __ISpVoice_FWD_DEFINED__
typedef interface ISpVoice ISpVoice;
#ifdef __cplusplus
interface ISpVoice;
#endif /* __cplusplus */
#endif

#ifndef __ISpRecoResult_FWD_DEFINED__
#define __ISpRecoResult_FWD_DEFINED__
typedef interface ISpRecoResult ISpRecoResult;
#ifdef __cplusplus
interface ISpRecoResult;
#endif /* __cplusplus */
#endif

#ifndef __ISpRecoContext_FWD_DEFINED__
#define __ISpRecoContext_FWD_DEFINED__
typedef interface ISpRecoContext ISpRecoContext;
#ifdef __cplusplus
interface ISpRecoContext;
#endif /* __cplusplus */
#endif

#ifndef __ISpRecognizer_FWD_DEFINED__
#define __ISpRecognizer_FWD_DEFINED__
typedef interface ISpRecognizer ISpRecognizer;
#ifdef __cplusplus
interface ISpRecognizer;
#endif /* __cplusplus */
#endif

#ifndef __ISpProperties_FWD_DEFINED__
#define __ISpProperties_FWD_DEFINED__
typedef interface ISpProperties ISpProperties;
#ifdef __cplusplus
interface ISpProperties;
#endif /* __cplusplus */
#endif

#ifndef __ISpLexicon_FWD_DEFINED__
#define __ISpLexicon_FWD_DEFINED__
typedef interface ISpLexicon ISpLexicon;
#ifdef __cplusplus
interface ISpLexicon;
#endif /* __cplusplus */
#endif

#ifndef __ISpPhoneConverter_FWD_DEFINED__
#define __ISpPhoneConverter_FWD_DEFINED__
typedef interface ISpPhoneConverter ISpPhoneConverter;
#ifdef __cplusplus
interface ISpPhoneConverter;
#endif /* __cplusplus */
#endif

#ifndef __ISpPhrase_FWD_DEFINED__
#define __ISpPhrase_FWD_DEFINED__
typedef interface ISpPhrase ISpPhrase;
#ifdef __cplusplus
interface ISpPhrase;
#endif /* __cplusplus */
#endif

#ifndef __ISpRecoContext2_FWD_DEFINED__
#define __ISpRecoContext2_FWD_DEFINED__
typedef interface ISpRecoContext2 ISpRecoContext2;
#ifdef __cplusplus
interface ISpRecoContext2;
#endif /* __cplusplus */
#endif

#ifndef __ISpRecognizer2_FWD_DEFINED__
#define __ISpRecognizer2_FWD_DEFINED__
typedef interface ISpRecognizer2 ISpRecognizer2;
#ifdef __cplusplus
interface ISpRecognizer2;
#endif /* __cplusplus */
#endif

#ifndef __ISpShortcut_FWD_DEFINED__
#define __ISpShortcut_FWD_DEFINED__
typedef interface ISpShortcut ISpShortcut;
#ifdef __cplusplus
interface ISpShortcut;
#endif /* __cplusplus */
#endif

#ifndef __ISpPhoneticAlphabetConverter_FWD_DEFINED__
#define __ISpPhoneticAlphabetConverter_FWD_DEFINED__
typedef interface ISpPhoneticAlphabetConverter ISpPhoneticAlphabetConverter;
#ifdef __cplusplus
interface ISpPhoneticAlphabetConverter;
#endif /* __cplusplus */
#endif

#ifndef __ISpPhoneticAlphabetSelection_FWD_DEFINED__
#define __ISpPhoneticAlphabetSelection_FWD_DEFINED__
typedef interface ISpPhoneticAlphabetSelection ISpPhoneticAlphabetSelection;
#ifdef __cplusplus
interface ISpPhoneticAlphabetSelection;
#endif /* __cplusplus */
#endif

#ifndef __ISpRecoGrammar2_FWD_DEFINED__
#define __ISpRecoGrammar2_FWD_DEFINED__
typedef interface ISpRecoGrammar2 ISpRecoGrammar2;
#ifdef __cplusplus
interface ISpRecoGrammar2;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechResourceLoader_FWD_DEFINED__
#define __ISpeechResourceLoader_FWD_DEFINED__
typedef interface ISpeechResourceLoader ISpeechResourceLoader;
#ifdef __cplusplus
interface ISpeechResourceLoader;
#endif /* __cplusplus */
#endif

typedef enum SPDATAKEYLOCATION {
    SPDKL_DefaultLocation = 0,
    SPDKL_CurrentUser = 1,
    SPDKL_LocalMachine = 2,
    SPDKL_CurrentConfig = 5
} SPDATAKEYLOCATION;
typedef enum SPSTREAMFORMAT {
    SPSF_Default = -1,
    SPSF_NoAssignedFormat = 0,
    SPSF_Text = 1,
    SPSF_NonStandardFormat = 2,
    SPSF_ExtendedAudioFormat = 3,
    SPSF_8kHz8BitMono = 4,
    SPSF_8kHz8BitStereo = 5,
    SPSF_8kHz16BitMono = 6,
    SPSF_8kHz16BitStereo = 7,
    SPSF_11kHz8BitMono = 8,
    SPSF_11kHz8BitStereo = 9,
    SPSF_11kHz16BitMono = 10,
    SPSF_11kHz16BitStereo = 11,
    SPSF_12kHz8BitMono = 12,
    SPSF_12kHz8BitStereo = 13,
    SPSF_12kHz16BitMono = 14,
    SPSF_12kHz16BitStereo = 15,
    SPSF_16kHz8BitMono = 16,
    SPSF_16kHz8BitStereo = 17,
    SPSF_16kHz16BitMono = 18,
    SPSF_16kHz16BitStereo = 19,
    SPSF_22kHz8BitMono = 20,
    SPSF_22kHz8BitStereo = 21,
    SPSF_22kHz16BitMono = 22,
    SPSF_22kHz16BitStereo = 23,
    SPSF_24kHz8BitMono = 24,
    SPSF_24kHz8BitStereo = 25,
    SPSF_24kHz16BitMono = 26,
    SPSF_24kHz16BitStereo = 27,
    SPSF_32kHz8BitMono = 28,
    SPSF_32kHz8BitStereo = 29,
    SPSF_32kHz16BitMono = 30,
    SPSF_32kHz16BitStereo = 31,
    SPSF_44kHz8BitMono = 32,
    SPSF_44kHz8BitStereo = 33,
    SPSF_44kHz16BitMono = 34,
    SPSF_44kHz16BitStereo = 35,
    SPSF_48kHz8BitMono = 36,
    SPSF_48kHz8BitStereo = 37,
    SPSF_48kHz16BitMono = 38,
    SPSF_48kHz16BitStereo = 39,
    SPSF_TrueSpeech_8kHz1BitMono = 40,
    SPSF_CCITT_ALaw_8kHzMono = 41,
    SPSF_CCITT_ALaw_8kHzStereo = 42,
    SPSF_CCITT_ALaw_11kHzMono = 43,
    SPSF_CCITT_ALaw_11kHzStereo = 44,
    SPSF_CCITT_ALaw_22kHzMono = 45,
    SPSF_CCITT_ALaw_22kHzStereo = 46,
    SPSF_CCITT_ALaw_44kHzMono = 47,
    SPSF_CCITT_ALaw_44kHzStereo = 48,
    SPSF_CCITT_uLaw_8kHzMono = 49,
    SPSF_CCITT_uLaw_8kHzStereo = 50,
    SPSF_CCITT_uLaw_11kHzMono = 51,
    SPSF_CCITT_uLaw_11kHzStereo = 52,
    SPSF_CCITT_uLaw_22kHzMono = 53,
    SPSF_CCITT_uLaw_22kHzStereo = 54,
    SPSF_CCITT_uLaw_44kHzMono = 55,
    SPSF_CCITT_uLaw_44kHzStereo = 56,
    SPSF_ADPCM_8kHzMono = 57,
    SPSF_ADPCM_8kHzStereo = 58,
    SPSF_ADPCM_11kHzMono = 59,
    SPSF_ADPCM_11kHzStereo = 60,
    SPSF_ADPCM_22kHzMono = 61,
    SPSF_ADPCM_22kHzStereo = 62,
    SPSF_ADPCM_44kHzMono = 63,
    SPSF_ADPCM_44kHzStereo = 64,
    SPSF_GSM610_8kHzMono = 65,
    SPSF_GSM610_11kHzMono = 66,
    SPSF_GSM610_22kHzMono = 67,
    SPSF_GSM610_44kHzMono = 68,
    SPSF_NUM_FORMATS = 69
} SPSTREAMFORMAT;
typedef enum SPEVENTLPARAMTYPE {
    SPET_LPARAM_IS_UNDEFINED = 0,
    SPET_LPARAM_IS_TOKEN = 1,
    SPET_LPARAM_IS_OBJECT = 2,
    SPET_LPARAM_IS_POINTER = 3,
    SPET_LPARAM_IS_STRING = 4
} SPEVENTLPARAMTYPE;
typedef enum SPEVENTENUM {
    SPEI_UNDEFINED = 0,
    SPEI_START_INPUT_STREAM = 1,
    SPEI_END_INPUT_STREAM = 2,
    SPEI_VOICE_CHANGE = 3,
    SPEI_TTS_BOOKMARK = 4,
    SPEI_WORD_BOUNDARY = 5,
    SPEI_PHONEME = 6,
    SPEI_SENTENCE_BOUNDARY = 7,
    SPEI_VISEME = 8,
    SPEI_TTS_AUDIO_LEVEL = 9,
    SPEI_TTS_PRIVATE = 15,
    SPEI_MIN_TTS = 1,
    SPEI_MAX_TTS = 15,
    SPEI_END_SR_STREAM = 34,
    SPEI_SOUND_START = 35,
    SPEI_SOUND_END = 36,
    SPEI_PHRASE_START = 37,
    SPEI_RECOGNITION = 38,
    SPEI_HYPOTHESIS = 39,
    SPEI_SR_BOOKMARK = 40,
    SPEI_PROPERTY_NUM_CHANGE = 41,
    SPEI_PROPERTY_STRING_CHANGE = 42,
    SPEI_FALSE_RECOGNITION = 43,
    SPEI_INTERFERENCE = 44,
    SPEI_REQUEST_UI = 45,
    SPEI_RECO_STATE_CHANGE = 46,
    SPEI_ADAPTATION = 47,
    SPEI_START_SR_STREAM = 48,
    SPEI_RECO_OTHER_CONTEXT = 49,
    SPEI_SR_AUDIO_LEVEL = 50,
    SPEI_SR_RETAINEDAUDIO = 51,
    SPEI_SR_PRIVATE = 52,
    SPEI_RESERVED4 = 53,
    SPEI_RESERVED5 = 54,
    SPEI_RESERVED6 = 55,
    SPEI_MIN_SR = 34,
    SPEI_MAX_SR = 55,
    SPEI_RESERVED1 = 30,
    SPEI_RESERVED2 = 33,
    SPEI_RESERVED3 = 63
} SPEVENTENUM;
typedef enum SPINTERFERENCE {
    SPINTERFERENCE_NONE = 0,
    SPINTERFERENCE_NOISE = 1,
    SPINTERFERENCE_NOSIGNAL = 2,
    SPINTERFERENCE_TOOLOUD = 3,
    SPINTERFERENCE_TOOQUIET = 4,
    SPINTERFERENCE_TOOFAST = 5,
    SPINTERFERENCE_TOOSLOW = 6,
    SPINTERFERENCE_LATENCY_WARNING = 7,
    SPINTERFERENCE_LATENCY_TRUNCATE_BEGIN = 8,
    SPINTERFERENCE_LATENCY_TRUNCATE_END = 9
} SPINTERFERENCE;
typedef enum SPENDSRSTREAMFLAGS {
    SPESF_NONE = 0,
    SPESF_STREAM_RELEASED = 1,
    SPESF_EMULATED = 2
} SPENDSRSTREAMFLAGS;
typedef enum SPVFEATURE {
    SPVFEATURE_STRESSED = 1,
    SPVFEATURE_EMPHASIS = 2
} SPVFEATURE;
typedef enum SPVISEMES {
    SP_VISEME_0 = 0,
    SP_VISEME_1 = 1,
    SP_VISEME_2 = 2,
    SP_VISEME_3 = 3,
    SP_VISEME_4 = 4,
    SP_VISEME_5 = 5,
    SP_VISEME_6 = 6,
    SP_VISEME_7 = 7,
    SP_VISEME_8 = 8,
    SP_VISEME_9 = 9,
    SP_VISEME_10 = 10,
    SP_VISEME_11 = 11,
    SP_VISEME_12 = 12,
    SP_VISEME_13 = 13,
    SP_VISEME_14 = 14,
    SP_VISEME_15 = 15,
    SP_VISEME_16 = 16,
    SP_VISEME_17 = 17,
    SP_VISEME_18 = 18,
    SP_VISEME_19 = 19,
    SP_VISEME_20 = 20,
    SP_VISEME_21 = 21
} SPVISEMES;
typedef enum SPFILEMODE {
    SPFM_OPEN_READONLY = 0,
    SPFM_OPEN_READWRITE = 1,
    SPFM_CREATE = 2,
    SPFM_CREATE_ALWAYS = 3,
    SPFM_NUM_MODES = 4
} SPFILEMODE;
typedef enum _SPAUDIOSTATE {
    SPAS_CLOSED = 0,
    SPAS_STOP = 1,
    SPAS_PAUSE = 2,
    SPAS_RUN = 3
} SPAUDIOSTATE;
typedef enum SPDISPLYATTRIBUTES {
    SPAF_ONE_TRAILING_SPACE = 0x2,
    SPAF_TWO_TRAILING_SPACES = 0x4,
    SPAF_CONSUME_LEADING_SPACES = 0x8,
    SPAF_BUFFER_POSITION = 0x10,
    SPAF_ALL = 0x1f,
    SPAF_USER_SPECIFIED = 0x80
} SPDISPLAYATTRIBUTES;
typedef enum SPPHRASEPROPERTYUNIONTYPE {
    SPPPUT_UNUSED = 0,
    SPPPUT_ARRAY_INDEX = 1
} SPPHRASEPROPERTYUNIONTYPE;
typedef enum SPSEMANTICFORMAT {
    SPSMF_SAPI_PROPERTIES = 0,
    SPSMF_SRGS_SEMANTICINTERPRETATION_MS = 1,
    SPSMF_SRGS_SAPIPROPERTIES = 2,
    SPSMF_UPS = 4,
    SPSMF_SRGS_SEMANTICINTERPRETATION_W3C = 8
} SPSEMANTICFORMAT;
typedef enum SPRECOEVENTFLAGS {
    SPREF_AutoPause = 0x1,
    SPREF_Emulated = 0x2,
    SPREF_SMLTimeout = 0x4,
    SPREF_ExtendableParse = 0x8,
    SPREF_ReSent = 0x10,
    SPREF_Hypothesis = 0x20,
    SPREF_FalseRecognition = 0x40
} SPRECOEVENTFLAGS;
typedef enum SPPARTOFSPEECH {
    SPPS_NotOverriden = -1,
    SPPS_Unknown = 0,
    SPPS_Noun = 0x1000,
    SPPS_Verb = 0x2000,
    SPPS_Modifier = 0x3000,
    SPPS_Function = 0x4000,
    SPPS_Interjection = 0x5000,
    SPPS_Noncontent = 0x6000,
    SPPS_LMA = 0x7000,
    SPPS_SuppressWord = 0xf000
} SPPARTOFSPEECH;
typedef enum SPLEXICONTYPE {
    eLEXTYPE_USER = 0x1,
    eLEXTYPE_APP = 0x2,
    eLEXTYPE_VENDORLEXICON = 0x4,
    eLEXTYPE_LETTERTOSOUND = 0x8,
    eLEXTYPE_MORPHOLOGY = 0x10,
    eLEXTYPE_RESERVED4 = 0x20,
    eLEXTYPE_USER_SHORTCUT = 0x40,
    eLEXTYPE_RESERVED6 = 0x80,
    eLEXTYPE_RESERVED7 = 0x100,
    eLEXTYPE_RESERVED8 = 0x200,
    eLEXTYPE_RESERVED9 = 0x400,
    eLEXTYPE_RESERVED10 = 0x800,
    eLEXTYPE_PRIVATE1 = 0x1000,
    eLEXTYPE_PRIVATE2 = 0x2000,
    eLEXTYPE_PRIVATE3 = 0x4000,
    eLEXTYPE_PRIVATE4 = 0x8000,
    eLEXTYPE_PRIVATE5 = 0x10000,
    eLEXTYPE_PRIVATE6 = 0x20000,
    eLEXTYPE_PRIVATE7 = 0x40000,
    eLEXTYPE_PRIVATE8 = 0x80000,
    eLEXTYPE_PRIVATE9 = 0x100000,
    eLEXTYPE_PRIVATE10 = 0x200000,
    eLEXTYPE_PRIVATE11 = 0x400000,
    eLEXTYPE_PRIVATE12 = 0x800000,
    eLEXTYPE_PRIVATE13 = 0x1000000,
    eLEXTYPE_PRIVATE14 = 0x2000000,
    eLEXTYPE_PRIVATE15 = 0x4000000,
    eLEXTYPE_PRIVATE16 = 0x8000000,
    eLEXTYPE_PRIVATE17 = 0x10000000,
    eLEXTYPE_PRIVATE18 = 0x20000000,
    eLEXTYPE_PRIVATE19 = 0x40000000,
    eLEXTYPE_PRIVATE20 = 0x80000000
} SPLEXICONTYPE;
typedef enum SPWORDTYPE {
    eWORDTYPE_ADDED = 1,
    eWORDTYPE_DELETED = 2
} SPWORDTYPE;
typedef enum SPPRONUNCIATIONFLAGS {
    ePRONFLAG_USED = 1
} SPPRONUNCIATIONFLAGS;
typedef enum SPSHORTCUTTYPE {
    SPSHT_NotOverriden = -1,
    SPSHT_Unknown = 0,
    SPSHT_EMAIL = 0x1000,
    SPSHT_OTHER = 0x2000,
    SPPS_RESERVED1 = 0x3000,
    SPPS_RESERVED2 = 0x4000,
    SPPS_RESERVED3 = 0x5000,
    SPPS_RESERVED4 = 0xf000
} SPSHORTCUTTYPE;
typedef enum SPVALUETYPE {
    SPDF_PROPERTY = 0x1,
    SPDF_REPLACEMENT = 0x2,
    SPDF_RULE = 0x4,
    SPDF_DISPLAYTEXT = 0x8,
    SPDF_LEXICALFORM = 0x10,
    SPDF_PRONUNCIATION = 0x20,
    SPDF_AUDIO = 0x40,
    SPDF_ALTERNATES = 0x80,
    SPDF_ALL = 0xff
} SPVALUETYPE;
typedef enum SPPHRASERNG {
    SPPR_ALL_ELEMENTS = -1
} SPPHRASERNG;
typedef enum SPVACTIONS {
    SPVA_Speak = 0,
    SPVA_Silence = 1,
    SPVA_Pronounce = 2,
    SPVA_Bookmark = 3,
    SPVA_SpellOut = 4,
    SPVA_Section = 5,
    SPVA_ParseUnknownTag = 6
} SPVACTIONS;
typedef enum SPRUNSTATE {
    SPRS_DONE = 1,
    SPRS_IS_SPEAKING = 2
} SPRUNSTATE;
typedef enum SPVLIMITS {
    SPMIN_VOLUME = 0,
    SPMAX_VOLUME = 100,
    SPMIN_RATE = -10,
    SPMAX_RATE = 10
} SPVLIMITS;
typedef enum SPVPRIORITY {
    SPVPRI_NORMAL = 0,
    SPVPRI_ALERT = 1,
    SPVPRI_OVER = 2
} SPVPRIORITY;
EXTERN_C const GUID SPDFID_Text;
EXTERN_C const GUID SPDFID_WaveFormatEx;

#define SP_LOW_CONFIDENCE (-1)

#define SP_NORMAL_CONFIDENCE (0)

#define SP_HIGH_CONFIDENCE (+1)

#define DEFAULT_WEIGHT (1)

#define SP_MAX_WORD_LENGTH (128)

#define SP_MAX_PRON_LENGTH (384)

#define SP_EMULATE_RESULT (0x40000000)


#ifdef __cplusplus
interface ISpNotifyCallback {
  virtual HRESULT STDMETHODCALLTYPE NotifyCallback(WPARAM wParam, LPARAM lParam) = 0;
};
#else
typedef void *ISpNotifyCallback;
#endif
#if 0
typedef void *SPNOTIFYCALLBACK;
#else
typedef void __stdcall SPNOTIFYCALLBACK(WPARAM wParam, LPARAM lParam);
#endif
/*****************************************************************************
 * ISpNotifySource interface
 */
#ifndef __ISpNotifySource_INTERFACE_DEFINED__
#define __ISpNotifySource_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpNotifySource, 0x5eff4aef, 0x8487, 0x11d2, 0x96,0x1c, 0x00,0xc0,0x4f,0x8e,0xe6,0x28);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("5eff4aef-8487-11d2-961c-00c04f8ee628")
ISpNotifySource : public IUnknown
{
    virtual HRESULT STDMETHODCALLTYPE SetNotifySink(
        ISpNotifySink *pNotifySink) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetNotifyWindowMessage(
        HWND hWnd,
        UINT Msg,
        WPARAM wParam,
        LPARAM lParam) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetNotifyCallbackFunction(
        SPNOTIFYCALLBACK *pfnCallback,
        WPARAM wParam,
        LPARAM lParam) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetNotifyCallbackInterface(
        ISpNotifyCallback *pSpCallback,
        WPARAM wParam,
        LPARAM lParam) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetNotifyWin32Event(
        ) = 0;

    virtual HRESULT STDMETHODCALLTYPE WaitForNotifyEvent(
        DWORD dwMilliseconds) = 0;

    virtual HANDLE STDMETHODCALLTYPE GetNotifyEventHandle(
        ) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpNotifySource, 0x5eff4aef, 0x8487, 0x11d2, 0x96,0x1c, 0x00,0xc0,0x4f,0x8e,0xe6,0x28)
#endif
#else
typedef struct ISpNotifySourceVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpNotifySource *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpNotifySource *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpNotifySource *This);

    /*** ISpNotifySource methods ***/
    HRESULT (STDMETHODCALLTYPE *SetNotifySink)(
        ISpNotifySource *This,
        ISpNotifySink *pNotifySink);

    HRESULT (STDMETHODCALLTYPE *SetNotifyWindowMessage)(
        ISpNotifySource *This,
        HWND hWnd,
        UINT Msg,
        WPARAM wParam,
        LPARAM lParam);

    HRESULT (STDMETHODCALLTYPE *SetNotifyCallbackFunction)(
        ISpNotifySource *This,
        SPNOTIFYCALLBACK *pfnCallback,
        WPARAM wParam,
        LPARAM lParam);

    HRESULT (STDMETHODCALLTYPE *SetNotifyCallbackInterface)(
        ISpNotifySource *This,
        ISpNotifyCallback *pSpCallback,
        WPARAM wParam,
        LPARAM lParam);

    HRESULT (STDMETHODCALLTYPE *SetNotifyWin32Event)(
        ISpNotifySource *This);

    HRESULT (STDMETHODCALLTYPE *WaitForNotifyEvent)(
        ISpNotifySource *This,
        DWORD dwMilliseconds);

    HANDLE (STDMETHODCALLTYPE *GetNotifyEventHandle)(
        ISpNotifySource *This);

    END_INTERFACE
} ISpNotifySourceVtbl;

interface ISpNotifySource {
    CONST_VTBL ISpNotifySourceVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpNotifySource_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpNotifySource_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpNotifySource_Release(This) (This)->lpVtbl->Release(This)
/*** ISpNotifySource methods ***/
#define ISpNotifySource_SetNotifySink(This,pNotifySink) (This)->lpVtbl->SetNotifySink(This,pNotifySink)
#define ISpNotifySource_SetNotifyWindowMessage(This,hWnd,Msg,wParam,lParam) (This)->lpVtbl->SetNotifyWindowMessage(This,hWnd,Msg,wParam,lParam)
#define ISpNotifySource_SetNotifyCallbackFunction(This,pfnCallback,wParam,lParam) (This)->lpVtbl->SetNotifyCallbackFunction(This,pfnCallback,wParam,lParam)
#define ISpNotifySource_SetNotifyCallbackInterface(This,pSpCallback,wParam,lParam) (This)->lpVtbl->SetNotifyCallbackInterface(This,pSpCallback,wParam,lParam)
#define ISpNotifySource_SetNotifyWin32Event(This) (This)->lpVtbl->SetNotifyWin32Event(This)
#define ISpNotifySource_WaitForNotifyEvent(This,dwMilliseconds) (This)->lpVtbl->WaitForNotifyEvent(This,dwMilliseconds)
#define ISpNotifySource_GetNotifyEventHandle(This) (This)->lpVtbl->GetNotifyEventHandle(This)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpNotifySource_QueryInterface(ISpNotifySource* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpNotifySource_AddRef(ISpNotifySource* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpNotifySource_Release(ISpNotifySource* This) {
    return This->lpVtbl->Release(This);
}
/*** ISpNotifySource methods ***/
static FORCEINLINE HRESULT ISpNotifySource_SetNotifySink(ISpNotifySource* This,ISpNotifySink *pNotifySink) {
    return This->lpVtbl->SetNotifySink(This,pNotifySink);
}
static FORCEINLINE HRESULT ISpNotifySource_SetNotifyWindowMessage(ISpNotifySource* This,HWND hWnd,UINT Msg,WPARAM wParam,LPARAM lParam) {
    return This->lpVtbl->SetNotifyWindowMessage(This,hWnd,Msg,wParam,lParam);
}
static FORCEINLINE HRESULT ISpNotifySource_SetNotifyCallbackFunction(ISpNotifySource* This,SPNOTIFYCALLBACK *pfnCallback,WPARAM wParam,LPARAM lParam) {
    return This->lpVtbl->SetNotifyCallbackFunction(This,pfnCallback,wParam,lParam);
}
static FORCEINLINE HRESULT ISpNotifySource_SetNotifyCallbackInterface(ISpNotifySource* This,ISpNotifyCallback *pSpCallback,WPARAM wParam,LPARAM lParam) {
    return This->lpVtbl->SetNotifyCallbackInterface(This,pSpCallback,wParam,lParam);
}
static FORCEINLINE HRESULT ISpNotifySource_SetNotifyWin32Event(ISpNotifySource* This) {
    return This->lpVtbl->SetNotifyWin32Event(This);
}
static FORCEINLINE HRESULT ISpNotifySource_WaitForNotifyEvent(ISpNotifySource* This,DWORD dwMilliseconds) {
    return This->lpVtbl->WaitForNotifyEvent(This,dwMilliseconds);
}
static FORCEINLINE HANDLE ISpNotifySource_GetNotifyEventHandle(ISpNotifySource* This) {
    return This->lpVtbl->GetNotifyEventHandle(This);
}
#endif
#endif

#endif


#endif  /* __ISpNotifySource_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpNotifySink interface
 */
#ifndef __ISpNotifySink_INTERFACE_DEFINED__
#define __ISpNotifySink_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpNotifySink, 0x259684dc, 0x37c3, 0x11d2, 0x96,0x03, 0x00,0xc0,0x4f,0x8e,0xe6,0x28);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("259684dc-37c3-11d2-9603-00c04f8ee628")
ISpNotifySink : public IUnknown
{
    virtual HRESULT STDMETHODCALLTYPE Notify(
        ) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpNotifySink, 0x259684dc, 0x37c3, 0x11d2, 0x96,0x03, 0x00,0xc0,0x4f,0x8e,0xe6,0x28)
#endif
#else
typedef struct ISpNotifySinkVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpNotifySink *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpNotifySink *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpNotifySink *This);

    /*** ISpNotifySink methods ***/
    HRESULT (STDMETHODCALLTYPE *Notify)(
        ISpNotifySink *This);

    END_INTERFACE
} ISpNotifySinkVtbl;

interface ISpNotifySink {
    CONST_VTBL ISpNotifySinkVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpNotifySink_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpNotifySink_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpNotifySink_Release(This) (This)->lpVtbl->Release(This)
/*** ISpNotifySink methods ***/
#define ISpNotifySink_Notify(This) (This)->lpVtbl->Notify(This)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpNotifySink_QueryInterface(ISpNotifySink* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpNotifySink_AddRef(ISpNotifySink* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpNotifySink_Release(ISpNotifySink* This) {
    return This->lpVtbl->Release(This);
}
/*** ISpNotifySink methods ***/
static FORCEINLINE HRESULT ISpNotifySink_Notify(ISpNotifySink* This) {
    return This->lpVtbl->Notify(This);
}
#endif
#endif

#endif


#endif  /* __ISpNotifySink_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpNotifyTranslator interface
 */
#ifndef __ISpNotifyTranslator_INTERFACE_DEFINED__
#define __ISpNotifyTranslator_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpNotifyTranslator, 0xaca16614, 0x5d3d, 0x11d2, 0x96,0x0e, 0x00,0xc0,0x4f,0x8e,0xe6,0x28);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("aca16614-5d3d-11d2-960e-00c04f8ee628")
ISpNotifyTranslator : public ISpNotifySink
{
    virtual HRESULT STDMETHODCALLTYPE InitWindowMessage(
        HWND hWnd,
        UINT Msg,
        WPARAM wParam,
        LPARAM lParam) = 0;

    virtual HRESULT STDMETHODCALLTYPE InitCallback(
        SPNOTIFYCALLBACK *pfnCallback,
        WPARAM wParam,
        LPARAM lParam) = 0;

    virtual HRESULT STDMETHODCALLTYPE InitSpNotifyCallback(
        ISpNotifyCallback *pSpCallback,
        WPARAM wParam,
        LPARAM lParam) = 0;

    virtual HRESULT STDMETHODCALLTYPE InitWin32Event(
        HANDLE hEvent,
        WINBOOL fCloseHandleOnRelease) = 0;

    virtual HRESULT STDMETHODCALLTYPE Wait(
        DWORD dwMilliseconds) = 0;

    virtual HANDLE STDMETHODCALLTYPE GetEventHandle(
        ) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpNotifyTranslator, 0xaca16614, 0x5d3d, 0x11d2, 0x96,0x0e, 0x00,0xc0,0x4f,0x8e,0xe6,0x28)
#endif
#else
typedef struct ISpNotifyTranslatorVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpNotifyTranslator *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpNotifyTranslator *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpNotifyTranslator *This);

    /*** ISpNotifySink methods ***/
    HRESULT (STDMETHODCALLTYPE *Notify)(
        ISpNotifyTranslator *This);

    /*** ISpNotifyTranslator methods ***/
    HRESULT (STDMETHODCALLTYPE *InitWindowMessage)(
        ISpNotifyTranslator *This,
        HWND hWnd,
        UINT Msg,
        WPARAM wParam,
        LPARAM lParam);

    HRESULT (STDMETHODCALLTYPE *InitCallback)(
        ISpNotifyTranslator *This,
        SPNOTIFYCALLBACK *pfnCallback,
        WPARAM wParam,
        LPARAM lParam);

    HRESULT (STDMETHODCALLTYPE *InitSpNotifyCallback)(
        ISpNotifyTranslator *This,
        ISpNotifyCallback *pSpCallback,
        WPARAM wParam,
        LPARAM lParam);

    HRESULT (STDMETHODCALLTYPE *InitWin32Event)(
        ISpNotifyTranslator *This,
        HANDLE hEvent,
        WINBOOL fCloseHandleOnRelease);

    HRESULT (STDMETHODCALLTYPE *Wait)(
        ISpNotifyTranslator *This,
        DWORD dwMilliseconds);

    HANDLE (STDMETHODCALLTYPE *GetEventHandle)(
        ISpNotifyTranslator *This);

    END_INTERFACE
} ISpNotifyTranslatorVtbl;

interface ISpNotifyTranslator {
    CONST_VTBL ISpNotifyTranslatorVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpNotifyTranslator_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpNotifyTranslator_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpNotifyTranslator_Release(This) (This)->lpVtbl->Release(This)
/*** ISpNotifySink methods ***/
#define ISpNotifyTranslator_Notify(This) (This)->lpVtbl->Notify(This)
/*** ISpNotifyTranslator methods ***/
#define ISpNotifyTranslator_InitWindowMessage(This,hWnd,Msg,wParam,lParam) (This)->lpVtbl->InitWindowMessage(This,hWnd,Msg,wParam,lParam)
#define ISpNotifyTranslator_InitCallback(This,pfnCallback,wParam,lParam) (This)->lpVtbl->InitCallback(This,pfnCallback,wParam,lParam)
#define ISpNotifyTranslator_InitSpNotifyCallback(This,pSpCallback,wParam,lParam) (This)->lpVtbl->InitSpNotifyCallback(This,pSpCallback,wParam,lParam)
#define ISpNotifyTranslator_InitWin32Event(This,hEvent,fCloseHandleOnRelease) (This)->lpVtbl->InitWin32Event(This,hEvent,fCloseHandleOnRelease)
#define ISpNotifyTranslator_Wait(This,dwMilliseconds) (This)->lpVtbl->Wait(This,dwMilliseconds)
#define ISpNotifyTranslator_GetEventHandle(This) (This)->lpVtbl->GetEventHandle(This)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpNotifyTranslator_QueryInterface(ISpNotifyTranslator* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpNotifyTranslator_AddRef(ISpNotifyTranslator* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpNotifyTranslator_Release(ISpNotifyTranslator* This) {
    return This->lpVtbl->Release(This);
}
/*** ISpNotifySink methods ***/
static FORCEINLINE HRESULT ISpNotifyTranslator_Notify(ISpNotifyTranslator* This) {
    return This->lpVtbl->Notify(This);
}
/*** ISpNotifyTranslator methods ***/
static FORCEINLINE HRESULT ISpNotifyTranslator_InitWindowMessage(ISpNotifyTranslator* This,HWND hWnd,UINT Msg,WPARAM wParam,LPARAM lParam) {
    return This->lpVtbl->InitWindowMessage(This,hWnd,Msg,wParam,lParam);
}
static FORCEINLINE HRESULT ISpNotifyTranslator_InitCallback(ISpNotifyTranslator* This,SPNOTIFYCALLBACK *pfnCallback,WPARAM wParam,LPARAM lParam) {
    return This->lpVtbl->InitCallback(This,pfnCallback,wParam,lParam);
}
static FORCEINLINE HRESULT ISpNotifyTranslator_InitSpNotifyCallback(ISpNotifyTranslator* This,ISpNotifyCallback *pSpCallback,WPARAM wParam,LPARAM lParam) {
    return This->lpVtbl->InitSpNotifyCallback(This,pSpCallback,wParam,lParam);
}
static FORCEINLINE HRESULT ISpNotifyTranslator_InitWin32Event(ISpNotifyTranslator* This,HANDLE hEvent,WINBOOL fCloseHandleOnRelease) {
    return This->lpVtbl->InitWin32Event(This,hEvent,fCloseHandleOnRelease);
}
static FORCEINLINE HRESULT ISpNotifyTranslator_Wait(ISpNotifyTranslator* This,DWORD dwMilliseconds) {
    return This->lpVtbl->Wait(This,dwMilliseconds);
}
static FORCEINLINE HANDLE ISpNotifyTranslator_GetEventHandle(ISpNotifyTranslator* This) {
    return This->lpVtbl->GetEventHandle(This);
}
#endif
#endif

#endif


#endif  /* __ISpNotifyTranslator_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpDataKey interface
 */
#ifndef __ISpDataKey_INTERFACE_DEFINED__
#define __ISpDataKey_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpDataKey, 0x14056581, 0xe16c, 0x11d2, 0xbb,0x90, 0x00,0xc0,0x4f,0x8e,0xe6,0xc0);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("14056581-e16c-11d2-bb90-00c04f8ee6c0")
ISpDataKey : public IUnknown
{
    virtual HRESULT STDMETHODCALLTYPE SetData(
        LPCWSTR pszValueName,
        ULONG cbData,
        const BYTE *pData) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetData(
        LPCWSTR pszValueName,
        ULONG *pcbData,
        BYTE *pData) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetStringValue(
        LPCWSTR pszValueName,
        LPCWSTR pszValue) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetStringValue(
        LPCWSTR pszValueName,
        LPWSTR *ppszValue) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetDWORD(
        LPCWSTR pszValueName,
        DWORD dwValue) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetDWORD(
        LPCWSTR pszValueName,
        DWORD *pdwValue) = 0;

    virtual HRESULT STDMETHODCALLTYPE OpenKey(
        LPCWSTR pszSubKeyName,
        ISpDataKey **ppSubKey) = 0;

    virtual HRESULT STDMETHODCALLTYPE CreateKey(
        LPCWSTR pszSubKey,
        ISpDataKey **ppSubKey) = 0;

    virtual HRESULT STDMETHODCALLTYPE DeleteKey(
        LPCWSTR pszSubKey) = 0;

    virtual HRESULT STDMETHODCALLTYPE DeleteValue(
        LPCWSTR pszValueName) = 0;

    virtual HRESULT STDMETHODCALLTYPE EnumKeys(
        ULONG Index,
        LPWSTR *ppszSubKeyName) = 0;

    virtual HRESULT STDMETHODCALLTYPE EnumValues(
        ULONG Index,
        LPWSTR *ppszValueName) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpDataKey, 0x14056581, 0xe16c, 0x11d2, 0xbb,0x90, 0x00,0xc0,0x4f,0x8e,0xe6,0xc0)
#endif
#else
typedef struct ISpDataKeyVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpDataKey *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpDataKey *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpDataKey *This);

    /*** ISpDataKey methods ***/
    HRESULT (STDMETHODCALLTYPE *SetData)(
        ISpDataKey *This,
        LPCWSTR pszValueName,
        ULONG cbData,
        const BYTE *pData);

    HRESULT (STDMETHODCALLTYPE *GetData)(
        ISpDataKey *This,
        LPCWSTR pszValueName,
        ULONG *pcbData,
        BYTE *pData);

    HRESULT (STDMETHODCALLTYPE *SetStringValue)(
        ISpDataKey *This,
        LPCWSTR pszValueName,
        LPCWSTR pszValue);

    HRESULT (STDMETHODCALLTYPE *GetStringValue)(
        ISpDataKey *This,
        LPCWSTR pszValueName,
        LPWSTR *ppszValue);

    HRESULT (STDMETHODCALLTYPE *SetDWORD)(
        ISpDataKey *This,
        LPCWSTR pszValueName,
        DWORD dwValue);

    HRESULT (STDMETHODCALLTYPE *GetDWORD)(
        ISpDataKey *This,
        LPCWSTR pszValueName,
        DWORD *pdwValue);

    HRESULT (STDMETHODCALLTYPE *OpenKey)(
        ISpDataKey *This,
        LPCWSTR pszSubKeyName,
        ISpDataKey **ppSubKey);

    HRESULT (STDMETHODCALLTYPE *CreateKey)(
        ISpDataKey *This,
        LPCWSTR pszSubKey,
        ISpDataKey **ppSubKey);

    HRESULT (STDMETHODCALLTYPE *DeleteKey)(
        ISpDataKey *This,
        LPCWSTR pszSubKey);

    HRESULT (STDMETHODCALLTYPE *DeleteValue)(
        ISpDataKey *This,
        LPCWSTR pszValueName);

    HRESULT (STDMETHODCALLTYPE *EnumKeys)(
        ISpDataKey *This,
        ULONG Index,
        LPWSTR *ppszSubKeyName);

    HRESULT (STDMETHODCALLTYPE *EnumValues)(
        ISpDataKey *This,
        ULONG Index,
        LPWSTR *ppszValueName);

    END_INTERFACE
} ISpDataKeyVtbl;

interface ISpDataKey {
    CONST_VTBL ISpDataKeyVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpDataKey_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpDataKey_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpDataKey_Release(This) (This)->lpVtbl->Release(This)
/*** ISpDataKey methods ***/
#define ISpDataKey_SetData(This,pszValueName,cbData,pData) (This)->lpVtbl->SetData(This,pszValueName,cbData,pData)
#define ISpDataKey_GetData(This,pszValueName,pcbData,pData) (This)->lpVtbl->GetData(This,pszValueName,pcbData,pData)
#define ISpDataKey_SetStringValue(This,pszValueName,pszValue) (This)->lpVtbl->SetStringValue(This,pszValueName,pszValue)
#define ISpDataKey_GetStringValue(This,pszValueName,ppszValue) (This)->lpVtbl->GetStringValue(This,pszValueName,ppszValue)
#define ISpDataKey_SetDWORD(This,pszValueName,dwValue) (This)->lpVtbl->SetDWORD(This,pszValueName,dwValue)
#define ISpDataKey_GetDWORD(This,pszValueName,pdwValue) (This)->lpVtbl->GetDWORD(This,pszValueName,pdwValue)
#define ISpDataKey_OpenKey(This,pszSubKeyName,ppSubKey) (This)->lpVtbl->OpenKey(This,pszSubKeyName,ppSubKey)
#define ISpDataKey_CreateKey(This,pszSubKey,ppSubKey) (This)->lpVtbl->CreateKey(This,pszSubKey,ppSubKey)
#define ISpDataKey_DeleteKey(This,pszSubKey) (This)->lpVtbl->DeleteKey(This,pszSubKey)
#define ISpDataKey_DeleteValue(This,pszValueName) (This)->lpVtbl->DeleteValue(This,pszValueName)
#define ISpDataKey_EnumKeys(This,Index,ppszSubKeyName) (This)->lpVtbl->EnumKeys(This,Index,ppszSubKeyName)
#define ISpDataKey_EnumValues(This,Index,ppszValueName) (This)->lpVtbl->EnumValues(This,Index,ppszValueName)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpDataKey_QueryInterface(ISpDataKey* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpDataKey_AddRef(ISpDataKey* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpDataKey_Release(ISpDataKey* This) {
    return This->lpVtbl->Release(This);
}
/*** ISpDataKey methods ***/
static FORCEINLINE HRESULT ISpDataKey_SetData(ISpDataKey* This,LPCWSTR pszValueName,ULONG cbData,const BYTE *pData) {
    return This->lpVtbl->SetData(This,pszValueName,cbData,pData);
}
static FORCEINLINE HRESULT ISpDataKey_GetData(ISpDataKey* This,LPCWSTR pszValueName,ULONG *pcbData,BYTE *pData) {
    return This->lpVtbl->GetData(This,pszValueName,pcbData,pData);
}
static FORCEINLINE HRESULT ISpDataKey_SetStringValue(ISpDataKey* This,LPCWSTR pszValueName,LPCWSTR pszValue) {
    return This->lpVtbl->SetStringValue(This,pszValueName,pszValue);
}
static FORCEINLINE HRESULT ISpDataKey_GetStringValue(ISpDataKey* This,LPCWSTR pszValueName,LPWSTR *ppszValue) {
    return This->lpVtbl->GetStringValue(This,pszValueName,ppszValue);
}
static FORCEINLINE HRESULT ISpDataKey_SetDWORD(ISpDataKey* This,LPCWSTR pszValueName,DWORD dwValue) {
    return This->lpVtbl->SetDWORD(This,pszValueName,dwValue);
}
static FORCEINLINE HRESULT ISpDataKey_GetDWORD(ISpDataKey* This,LPCWSTR pszValueName,DWORD *pdwValue) {
    return This->lpVtbl->GetDWORD(This,pszValueName,pdwValue);
}
static FORCEINLINE HRESULT ISpDataKey_OpenKey(ISpDataKey* This,LPCWSTR pszSubKeyName,ISpDataKey **ppSubKey) {
    return This->lpVtbl->OpenKey(This,pszSubKeyName,ppSubKey);
}
static FORCEINLINE HRESULT ISpDataKey_CreateKey(ISpDataKey* This,LPCWSTR pszSubKey,ISpDataKey **ppSubKey) {
    return This->lpVtbl->CreateKey(This,pszSubKey,ppSubKey);
}
static FORCEINLINE HRESULT ISpDataKey_DeleteKey(ISpDataKey* This,LPCWSTR pszSubKey) {
    return This->lpVtbl->DeleteKey(This,pszSubKey);
}
static FORCEINLINE HRESULT ISpDataKey_DeleteValue(ISpDataKey* This,LPCWSTR pszValueName) {
    return This->lpVtbl->DeleteValue(This,pszValueName);
}
static FORCEINLINE HRESULT ISpDataKey_EnumKeys(ISpDataKey* This,ULONG Index,LPWSTR *ppszSubKeyName) {
    return This->lpVtbl->EnumKeys(This,Index,ppszSubKeyName);
}
static FORCEINLINE HRESULT ISpDataKey_EnumValues(ISpDataKey* This,ULONG Index,LPWSTR *ppszValueName) {
    return This->lpVtbl->EnumValues(This,Index,ppszValueName);
}
#endif
#endif

#endif


#endif  /* __ISpDataKey_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpObjectWithToken interface
 */
#ifndef __ISpObjectWithToken_INTERFACE_DEFINED__
#define __ISpObjectWithToken_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpObjectWithToken, 0x5b559f40, 0xe952, 0x11d2, 0xbb,0x91, 0x00,0xc0,0x4f,0x8e,0xe6,0xc0);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("5b559f40-e952-11d2-bb91-00c04f8ee6c0")
ISpObjectWithToken : public IUnknown
{
    virtual HRESULT STDMETHODCALLTYPE SetObjectToken(
        ISpObjectToken *pToken) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetObjectToken(
        ISpObjectToken **ppToken) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpObjectWithToken, 0x5b559f40, 0xe952, 0x11d2, 0xbb,0x91, 0x00,0xc0,0x4f,0x8e,0xe6,0xc0)
#endif
#else
typedef struct ISpObjectWithTokenVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpObjectWithToken *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpObjectWithToken *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpObjectWithToken *This);

    /*** ISpObjectWithToken methods ***/
    HRESULT (STDMETHODCALLTYPE *SetObjectToken)(
        ISpObjectWithToken *This,
        ISpObjectToken *pToken);

    HRESULT (STDMETHODCALLTYPE *GetObjectToken)(
        ISpObjectWithToken *This,
        ISpObjectToken **ppToken);

    END_INTERFACE
} ISpObjectWithTokenVtbl;

interface ISpObjectWithToken {
    CONST_VTBL ISpObjectWithTokenVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpObjectWithToken_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpObjectWithToken_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpObjectWithToken_Release(This) (This)->lpVtbl->Release(This)
/*** ISpObjectWithToken methods ***/
#define ISpObjectWithToken_SetObjectToken(This,pToken) (This)->lpVtbl->SetObjectToken(This,pToken)
#define ISpObjectWithToken_GetObjectToken(This,ppToken) (This)->lpVtbl->GetObjectToken(This,ppToken)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpObjectWithToken_QueryInterface(ISpObjectWithToken* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpObjectWithToken_AddRef(ISpObjectWithToken* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpObjectWithToken_Release(ISpObjectWithToken* This) {
    return This->lpVtbl->Release(This);
}
/*** ISpObjectWithToken methods ***/
static FORCEINLINE HRESULT ISpObjectWithToken_SetObjectToken(ISpObjectWithToken* This,ISpObjectToken *pToken) {
    return This->lpVtbl->SetObjectToken(This,pToken);
}
static FORCEINLINE HRESULT ISpObjectWithToken_GetObjectToken(ISpObjectWithToken* This,ISpObjectToken **ppToken) {
    return This->lpVtbl->GetObjectToken(This,ppToken);
}
#endif
#endif

#endif


#endif  /* __ISpObjectWithToken_INTERFACE_DEFINED__ */

/*****************************************************************************
 * IEnumSpObjectTokens interface
 */
#ifndef __IEnumSpObjectTokens_INTERFACE_DEFINED__
#define __IEnumSpObjectTokens_INTERFACE_DEFINED__

DEFINE_GUID(IID_IEnumSpObjectTokens, 0x06b64f9e, 0x7fda, 0x11d2, 0xb4,0xf2, 0x00,0xc0,0x4f,0x79,0x73,0x96);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("06b64f9e-7fda-11d2-b4f2-00c04f797396")
IEnumSpObjectTokens : public IUnknown
{
    virtual HRESULT STDMETHODCALLTYPE Next(
        ULONG celt,
        ISpObjectToken **pelt,
        ULONG *pceltFetched) = 0;

    virtual HRESULT STDMETHODCALLTYPE Skip(
        ULONG celt) = 0;

    virtual HRESULT STDMETHODCALLTYPE Reset(
        ) = 0;

    virtual HRESULT STDMETHODCALLTYPE Clone(
        IEnumSpObjectTokens **ppEnum) = 0;

    virtual HRESULT STDMETHODCALLTYPE Item(
        ULONG Index,
        ISpObjectToken **ppToken) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetCount(
        ULONG *pCount) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(IEnumSpObjectTokens, 0x06b64f9e, 0x7fda, 0x11d2, 0xb4,0xf2, 0x00,0xc0,0x4f,0x79,0x73,0x96)
#endif
#else
typedef struct IEnumSpObjectTokensVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        IEnumSpObjectTokens *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        IEnumSpObjectTokens *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        IEnumSpObjectTokens *This);

    /*** IEnumSpObjectTokens methods ***/
    HRESULT (STDMETHODCALLTYPE *Next)(
        IEnumSpObjectTokens *This,
        ULONG celt,
        ISpObjectToken **pelt,
        ULONG *pceltFetched);

    HRESULT (STDMETHODCALLTYPE *Skip)(
        IEnumSpObjectTokens *This,
        ULONG celt);

    HRESULT (STDMETHODCALLTYPE *Reset)(
        IEnumSpObjectTokens *This);

    HRESULT (STDMETHODCALLTYPE *Clone)(
        IEnumSpObjectTokens *This,
        IEnumSpObjectTokens **ppEnum);

    HRESULT (STDMETHODCALLTYPE *Item)(
        IEnumSpObjectTokens *This,
        ULONG Index,
        ISpObjectToken **ppToken);

    HRESULT (STDMETHODCALLTYPE *GetCount)(
        IEnumSpObjectTokens *This,
        ULONG *pCount);

    END_INTERFACE
} IEnumSpObjectTokensVtbl;

interface IEnumSpObjectTokens {
    CONST_VTBL IEnumSpObjectTokensVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define IEnumSpObjectTokens_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define IEnumSpObjectTokens_AddRef(This) (This)->lpVtbl->AddRef(This)
#define IEnumSpObjectTokens_Release(This) (This)->lpVtbl->Release(This)
/*** IEnumSpObjectTokens methods ***/
#define IEnumSpObjectTokens_Next(This,celt,pelt,pceltFetched) (This)->lpVtbl->Next(This,celt,pelt,pceltFetched)
#define IEnumSpObjectTokens_Skip(This,celt) (This)->lpVtbl->Skip(This,celt)
#define IEnumSpObjectTokens_Reset(This) (This)->lpVtbl->Reset(This)
#define IEnumSpObjectTokens_Clone(This,ppEnum) (This)->lpVtbl->Clone(This,ppEnum)
#define IEnumSpObjectTokens_Item(This,Index,ppToken) (This)->lpVtbl->Item(This,Index,ppToken)
#define IEnumSpObjectTokens_GetCount(This,pCount) (This)->lpVtbl->GetCount(This,pCount)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT IEnumSpObjectTokens_QueryInterface(IEnumSpObjectTokens* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG IEnumSpObjectTokens_AddRef(IEnumSpObjectTokens* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG IEnumSpObjectTokens_Release(IEnumSpObjectTokens* This) {
    return This->lpVtbl->Release(This);
}
/*** IEnumSpObjectTokens methods ***/
static FORCEINLINE HRESULT IEnumSpObjectTokens_Next(IEnumSpObjectTokens* This,ULONG celt,ISpObjectToken **pelt,ULONG *pceltFetched) {
    return This->lpVtbl->Next(This,celt,pelt,pceltFetched);
}
static FORCEINLINE HRESULT IEnumSpObjectTokens_Skip(IEnumSpObjectTokens* This,ULONG celt) {
    return This->lpVtbl->Skip(This,celt);
}
static FORCEINLINE HRESULT IEnumSpObjectTokens_Reset(IEnumSpObjectTokens* This) {
    return This->lpVtbl->Reset(This);
}
static FORCEINLINE HRESULT IEnumSpObjectTokens_Clone(IEnumSpObjectTokens* This,IEnumSpObjectTokens **ppEnum) {
    return This->lpVtbl->Clone(This,ppEnum);
}
static FORCEINLINE HRESULT IEnumSpObjectTokens_Item(IEnumSpObjectTokens* This,ULONG Index,ISpObjectToken **ppToken) {
    return This->lpVtbl->Item(This,Index,ppToken);
}
static FORCEINLINE HRESULT IEnumSpObjectTokens_GetCount(IEnumSpObjectTokens* This,ULONG *pCount) {
    return This->lpVtbl->GetCount(This,pCount);
}
#endif
#endif

#endif


#endif  /* __IEnumSpObjectTokens_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpRegDataKey interface
 */
#ifndef __ISpRegDataKey_INTERFACE_DEFINED__
#define __ISpRegDataKey_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpRegDataKey, 0x92a66e2b, 0xc830, 0x4149, 0x83,0xdf, 0x6f,0xc2,0xba,0x1e,0x7a,0x5b);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("92a66e2b-c830-4149-83df-6fc2ba1e7a5b")
ISpRegDataKey : public ISpDataKey
{
    virtual HRESULT STDMETHODCALLTYPE SetKey(
        HKEY hkey,
        WINBOOL fReadOnly) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpRegDataKey, 0x92a66e2b, 0xc830, 0x4149, 0x83,0xdf, 0x6f,0xc2,0xba,0x1e,0x7a,0x5b)
#endif
#else
typedef struct ISpRegDataKeyVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpRegDataKey *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpRegDataKey *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpRegDataKey *This);

    /*** ISpDataKey methods ***/
    HRESULT (STDMETHODCALLTYPE *SetData)(
        ISpRegDataKey *This,
        LPCWSTR pszValueName,
        ULONG cbData,
        const BYTE *pData);

    HRESULT (STDMETHODCALLTYPE *GetData)(
        ISpRegDataKey *This,
        LPCWSTR pszValueName,
        ULONG *pcbData,
        BYTE *pData);

    HRESULT (STDMETHODCALLTYPE *SetStringValue)(
        ISpRegDataKey *This,
        LPCWSTR pszValueName,
        LPCWSTR pszValue);

    HRESULT (STDMETHODCALLTYPE *GetStringValue)(
        ISpRegDataKey *This,
        LPCWSTR pszValueName,
        LPWSTR *ppszValue);

    HRESULT (STDMETHODCALLTYPE *SetDWORD)(
        ISpRegDataKey *This,
        LPCWSTR pszValueName,
        DWORD dwValue);

    HRESULT (STDMETHODCALLTYPE *GetDWORD)(
        ISpRegDataKey *This,
        LPCWSTR pszValueName,
        DWORD *pdwValue);

    HRESULT (STDMETHODCALLTYPE *OpenKey)(
        ISpRegDataKey *This,
        LPCWSTR pszSubKeyName,
        ISpDataKey **ppSubKey);

    HRESULT (STDMETHODCALLTYPE *CreateKey)(
        ISpRegDataKey *This,
        LPCWSTR pszSubKey,
        ISpDataKey **ppSubKey);

    HRESULT (STDMETHODCALLTYPE *DeleteKey)(
        ISpRegDataKey *This,
        LPCWSTR pszSubKey);

    HRESULT (STDMETHODCALLTYPE *DeleteValue)(
        ISpRegDataKey *This,
        LPCWSTR pszValueName);

    HRESULT (STDMETHODCALLTYPE *EnumKeys)(
        ISpRegDataKey *This,
        ULONG Index,
        LPWSTR *ppszSubKeyName);

    HRESULT (STDMETHODCALLTYPE *EnumValues)(
        ISpRegDataKey *This,
        ULONG Index,
        LPWSTR *ppszValueName);

    /*** ISpRegDataKey methods ***/
    HRESULT (STDMETHODCALLTYPE *SetKey)(
        ISpRegDataKey *This,
        HKEY hkey,
        WINBOOL fReadOnly);

    END_INTERFACE
} ISpRegDataKeyVtbl;

interface ISpRegDataKey {
    CONST_VTBL ISpRegDataKeyVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpRegDataKey_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpRegDataKey_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpRegDataKey_Release(This) (This)->lpVtbl->Release(This)
/*** ISpDataKey methods ***/
#define ISpRegDataKey_SetData(This,pszValueName,cbData,pData) (This)->lpVtbl->SetData(This,pszValueName,cbData,pData)
#define ISpRegDataKey_GetData(This,pszValueName,pcbData,pData) (This)->lpVtbl->GetData(This,pszValueName,pcbData,pData)
#define ISpRegDataKey_SetStringValue(This,pszValueName,pszValue) (This)->lpVtbl->SetStringValue(This,pszValueName,pszValue)
#define ISpRegDataKey_GetStringValue(This,pszValueName,ppszValue) (This)->lpVtbl->GetStringValue(This,pszValueName,ppszValue)
#define ISpRegDataKey_SetDWORD(This,pszValueName,dwValue) (This)->lpVtbl->SetDWORD(This,pszValueName,dwValue)
#define ISpRegDataKey_GetDWORD(This,pszValueName,pdwValue) (This)->lpVtbl->GetDWORD(This,pszValueName,pdwValue)
#define ISpRegDataKey_OpenKey(This,pszSubKeyName,ppSubKey) (This)->lpVtbl->OpenKey(This,pszSubKeyName,ppSubKey)
#define ISpRegDataKey_CreateKey(This,pszSubKey,ppSubKey) (This)->lpVtbl->CreateKey(This,pszSubKey,ppSubKey)
#define ISpRegDataKey_DeleteKey(This,pszSubKey) (This)->lpVtbl->DeleteKey(This,pszSubKey)
#define ISpRegDataKey_DeleteValue(This,pszValueName) (This)->lpVtbl->DeleteValue(This,pszValueName)
#define ISpRegDataKey_EnumKeys(This,Index,ppszSubKeyName) (This)->lpVtbl->EnumKeys(This,Index,ppszSubKeyName)
#define ISpRegDataKey_EnumValues(This,Index,ppszValueName) (This)->lpVtbl->EnumValues(This,Index,ppszValueName)
/*** ISpRegDataKey methods ***/
#define ISpRegDataKey_SetKey(This,hkey,fReadOnly) (This)->lpVtbl->SetKey(This,hkey,fReadOnly)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpRegDataKey_QueryInterface(ISpRegDataKey* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpRegDataKey_AddRef(ISpRegDataKey* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpRegDataKey_Release(ISpRegDataKey* This) {
    return This->lpVtbl->Release(This);
}
/*** ISpDataKey methods ***/
static FORCEINLINE HRESULT ISpRegDataKey_SetData(ISpRegDataKey* This,LPCWSTR pszValueName,ULONG cbData,const BYTE *pData) {
    return This->lpVtbl->SetData(This,pszValueName,cbData,pData);
}
static FORCEINLINE HRESULT ISpRegDataKey_GetData(ISpRegDataKey* This,LPCWSTR pszValueName,ULONG *pcbData,BYTE *pData) {
    return This->lpVtbl->GetData(This,pszValueName,pcbData,pData);
}
static FORCEINLINE HRESULT ISpRegDataKey_SetStringValue(ISpRegDataKey* This,LPCWSTR pszValueName,LPCWSTR pszValue) {
    return This->lpVtbl->SetStringValue(This,pszValueName,pszValue);
}
static FORCEINLINE HRESULT ISpRegDataKey_GetStringValue(ISpRegDataKey* This,LPCWSTR pszValueName,LPWSTR *ppszValue) {
    return This->lpVtbl->GetStringValue(This,pszValueName,ppszValue);
}
static FORCEINLINE HRESULT ISpRegDataKey_SetDWORD(ISpRegDataKey* This,LPCWSTR pszValueName,DWORD dwValue) {
    return This->lpVtbl->SetDWORD(This,pszValueName,dwValue);
}
static FORCEINLINE HRESULT ISpRegDataKey_GetDWORD(ISpRegDataKey* This,LPCWSTR pszValueName,DWORD *pdwValue) {
    return This->lpVtbl->GetDWORD(This,pszValueName,pdwValue);
}
static FORCEINLINE HRESULT ISpRegDataKey_OpenKey(ISpRegDataKey* This,LPCWSTR pszSubKeyName,ISpDataKey **ppSubKey) {
    return This->lpVtbl->OpenKey(This,pszSubKeyName,ppSubKey);
}
static FORCEINLINE HRESULT ISpRegDataKey_CreateKey(ISpRegDataKey* This,LPCWSTR pszSubKey,ISpDataKey **ppSubKey) {
    return This->lpVtbl->CreateKey(This,pszSubKey,ppSubKey);
}
static FORCEINLINE HRESULT ISpRegDataKey_DeleteKey(ISpRegDataKey* This,LPCWSTR pszSubKey) {
    return This->lpVtbl->DeleteKey(This,pszSubKey);
}
static FORCEINLINE HRESULT ISpRegDataKey_DeleteValue(ISpRegDataKey* This,LPCWSTR pszValueName) {
    return This->lpVtbl->DeleteValue(This,pszValueName);
}
static FORCEINLINE HRESULT ISpRegDataKey_EnumKeys(ISpRegDataKey* This,ULONG Index,LPWSTR *ppszSubKeyName) {
    return This->lpVtbl->EnumKeys(This,Index,ppszSubKeyName);
}
static FORCEINLINE HRESULT ISpRegDataKey_EnumValues(ISpRegDataKey* This,ULONG Index,LPWSTR *ppszValueName) {
    return This->lpVtbl->EnumValues(This,Index,ppszValueName);
}
/*** ISpRegDataKey methods ***/
static FORCEINLINE HRESULT ISpRegDataKey_SetKey(ISpRegDataKey* This,HKEY hkey,WINBOOL fReadOnly) {
    return This->lpVtbl->SetKey(This,hkey,fReadOnly);
}
#endif
#endif

#endif


#endif  /* __ISpRegDataKey_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpObjectTokenCategory interface
 */
#ifndef __ISpObjectTokenCategory_INTERFACE_DEFINED__
#define __ISpObjectTokenCategory_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpObjectTokenCategory, 0x2d3d3845, 0x39af, 0x4850, 0xbb,0xf9, 0x40,0xb4,0x97,0x80,0x01,0x1d);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("2d3d3845-39af-4850-bbf9-40b49780011d")
ISpObjectTokenCategory : public ISpDataKey
{
    virtual HRESULT STDMETHODCALLTYPE SetId(
        LPCWSTR pszCategoryId,
        WINBOOL fCreateIfNotExist) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetId(
        LPWSTR *ppszCoMemCategoryId) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetDataKey(
        SPDATAKEYLOCATION spdkl,
        ISpDataKey **ppDataKey) = 0;

    virtual HRESULT STDMETHODCALLTYPE EnumTokens(
        LPCWSTR pzsReqAttribs,
        LPCWSTR pszOptAttribs,
        IEnumSpObjectTokens **ppEnum) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetDefaultTokenId(
        LPCWSTR pszTokenId) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetDefaultTokenId(
        LPWSTR *ppszCoMemTokenId) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpObjectTokenCategory, 0x2d3d3845, 0x39af, 0x4850, 0xbb,0xf9, 0x40,0xb4,0x97,0x80,0x01,0x1d)
#endif
#else
typedef struct ISpObjectTokenCategoryVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpObjectTokenCategory *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpObjectTokenCategory *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpObjectTokenCategory *This);

    /*** ISpDataKey methods ***/
    HRESULT (STDMETHODCALLTYPE *SetData)(
        ISpObjectTokenCategory *This,
        LPCWSTR pszValueName,
        ULONG cbData,
        const BYTE *pData);

    HRESULT (STDMETHODCALLTYPE *GetData)(
        ISpObjectTokenCategory *This,
        LPCWSTR pszValueName,
        ULONG *pcbData,
        BYTE *pData);

    HRESULT (STDMETHODCALLTYPE *SetStringValue)(
        ISpObjectTokenCategory *This,
        LPCWSTR pszValueName,
        LPCWSTR pszValue);

    HRESULT (STDMETHODCALLTYPE *GetStringValue)(
        ISpObjectTokenCategory *This,
        LPCWSTR pszValueName,
        LPWSTR *ppszValue);

    HRESULT (STDMETHODCALLTYPE *SetDWORD)(
        ISpObjectTokenCategory *This,
        LPCWSTR pszValueName,
        DWORD dwValue);

    HRESULT (STDMETHODCALLTYPE *GetDWORD)(
        ISpObjectTokenCategory *This,
        LPCWSTR pszValueName,
        DWORD *pdwValue);

    HRESULT (STDMETHODCALLTYPE *OpenKey)(
        ISpObjectTokenCategory *This,
        LPCWSTR pszSubKeyName,
        ISpDataKey **ppSubKey);

    HRESULT (STDMETHODCALLTYPE *CreateKey)(
        ISpObjectTokenCategory *This,
        LPCWSTR pszSubKey,
        ISpDataKey **ppSubKey);

    HRESULT (STDMETHODCALLTYPE *DeleteKey)(
        ISpObjectTokenCategory *This,
        LPCWSTR pszSubKey);

    HRESULT (STDMETHODCALLTYPE *DeleteValue)(
        ISpObjectTokenCategory *This,
        LPCWSTR pszValueName);

    HRESULT (STDMETHODCALLTYPE *EnumKeys)(
        ISpObjectTokenCategory *This,
        ULONG Index,
        LPWSTR *ppszSubKeyName);

    HRESULT (STDMETHODCALLTYPE *EnumValues)(
        ISpObjectTokenCategory *This,
        ULONG Index,
        LPWSTR *ppszValueName);

    /*** ISpObjectTokenCategory methods ***/
    HRESULT (STDMETHODCALLTYPE *SetId)(
        ISpObjectTokenCategory *This,
        LPCWSTR pszCategoryId,
        WINBOOL fCreateIfNotExist);

    HRESULT (STDMETHODCALLTYPE *GetId)(
        ISpObjectTokenCategory *This,
        LPWSTR *ppszCoMemCategoryId);

    HRESULT (STDMETHODCALLTYPE *GetDataKey)(
        ISpObjectTokenCategory *This,
        SPDATAKEYLOCATION spdkl,
        ISpDataKey **ppDataKey);

    HRESULT (STDMETHODCALLTYPE *EnumTokens)(
        ISpObjectTokenCategory *This,
        LPCWSTR pzsReqAttribs,
        LPCWSTR pszOptAttribs,
        IEnumSpObjectTokens **ppEnum);

    HRESULT (STDMETHODCALLTYPE *SetDefaultTokenId)(
        ISpObjectTokenCategory *This,
        LPCWSTR pszTokenId);

    HRESULT (STDMETHODCALLTYPE *GetDefaultTokenId)(
        ISpObjectTokenCategory *This,
        LPWSTR *ppszCoMemTokenId);

    END_INTERFACE
} ISpObjectTokenCategoryVtbl;

interface ISpObjectTokenCategory {
    CONST_VTBL ISpObjectTokenCategoryVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpObjectTokenCategory_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpObjectTokenCategory_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpObjectTokenCategory_Release(This) (This)->lpVtbl->Release(This)
/*** ISpDataKey methods ***/
#define ISpObjectTokenCategory_SetData(This,pszValueName,cbData,pData) (This)->lpVtbl->SetData(This,pszValueName,cbData,pData)
#define ISpObjectTokenCategory_GetData(This,pszValueName,pcbData,pData) (This)->lpVtbl->GetData(This,pszValueName,pcbData,pData)
#define ISpObjectTokenCategory_SetStringValue(This,pszValueName,pszValue) (This)->lpVtbl->SetStringValue(This,pszValueName,pszValue)
#define ISpObjectTokenCategory_GetStringValue(This,pszValueName,ppszValue) (This)->lpVtbl->GetStringValue(This,pszValueName,ppszValue)
#define ISpObjectTokenCategory_SetDWORD(This,pszValueName,dwValue) (This)->lpVtbl->SetDWORD(This,pszValueName,dwValue)
#define ISpObjectTokenCategory_GetDWORD(This,pszValueName,pdwValue) (This)->lpVtbl->GetDWORD(This,pszValueName,pdwValue)
#define ISpObjectTokenCategory_OpenKey(This,pszSubKeyName,ppSubKey) (This)->lpVtbl->OpenKey(This,pszSubKeyName,ppSubKey)
#define ISpObjectTokenCategory_CreateKey(This,pszSubKey,ppSubKey) (This)->lpVtbl->CreateKey(This,pszSubKey,ppSubKey)
#define ISpObjectTokenCategory_DeleteKey(This,pszSubKey) (This)->lpVtbl->DeleteKey(This,pszSubKey)
#define ISpObjectTokenCategory_DeleteValue(This,pszValueName) (This)->lpVtbl->DeleteValue(This,pszValueName)
#define ISpObjectTokenCategory_EnumKeys(This,Index,ppszSubKeyName) (This)->lpVtbl->EnumKeys(This,Index,ppszSubKeyName)
#define ISpObjectTokenCategory_EnumValues(This,Index,ppszValueName) (This)->lpVtbl->EnumValues(This,Index,ppszValueName)
/*** ISpObjectTokenCategory methods ***/
#define ISpObjectTokenCategory_SetId(This,pszCategoryId,fCreateIfNotExist) (This)->lpVtbl->SetId(This,pszCategoryId,fCreateIfNotExist)
#define ISpObjectTokenCategory_GetId(This,ppszCoMemCategoryId) (This)->lpVtbl->GetId(This,ppszCoMemCategoryId)
#define ISpObjectTokenCategory_GetDataKey(This,spdkl,ppDataKey) (This)->lpVtbl->GetDataKey(This,spdkl,ppDataKey)
#define ISpObjectTokenCategory_EnumTokens(This,pzsReqAttribs,pszOptAttribs,ppEnum) (This)->lpVtbl->EnumTokens(This,pzsReqAttribs,pszOptAttribs,ppEnum)
#define ISpObjectTokenCategory_SetDefaultTokenId(This,pszTokenId) (This)->lpVtbl->SetDefaultTokenId(This,pszTokenId)
#define ISpObjectTokenCategory_GetDefaultTokenId(This,ppszCoMemTokenId) (This)->lpVtbl->GetDefaultTokenId(This,ppszCoMemTokenId)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpObjectTokenCategory_QueryInterface(ISpObjectTokenCategory* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpObjectTokenCategory_AddRef(ISpObjectTokenCategory* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpObjectTokenCategory_Release(ISpObjectTokenCategory* This) {
    return This->lpVtbl->Release(This);
}
/*** ISpDataKey methods ***/
static FORCEINLINE HRESULT ISpObjectTokenCategory_SetData(ISpObjectTokenCategory* This,LPCWSTR pszValueName,ULONG cbData,const BYTE *pData) {
    return This->lpVtbl->SetData(This,pszValueName,cbData,pData);
}
static FORCEINLINE HRESULT ISpObjectTokenCategory_GetData(ISpObjectTokenCategory* This,LPCWSTR pszValueName,ULONG *pcbData,BYTE *pData) {
    return This->lpVtbl->GetData(This,pszValueName,pcbData,pData);
}
static FORCEINLINE HRESULT ISpObjectTokenCategory_SetStringValue(ISpObjectTokenCategory* This,LPCWSTR pszValueName,LPCWSTR pszValue) {
    return This->lpVtbl->SetStringValue(This,pszValueName,pszValue);
}
static FORCEINLINE HRESULT ISpObjectTokenCategory_GetStringValue(ISpObjectTokenCategory* This,LPCWSTR pszValueName,LPWSTR *ppszValue) {
    return This->lpVtbl->GetStringValue(This,pszValueName,ppszValue);
}
static FORCEINLINE HRESULT ISpObjectTokenCategory_SetDWORD(ISpObjectTokenCategory* This,LPCWSTR pszValueName,DWORD dwValue) {
    return This->lpVtbl->SetDWORD(This,pszValueName,dwValue);
}
static FORCEINLINE HRESULT ISpObjectTokenCategory_GetDWORD(ISpObjectTokenCategory* This,LPCWSTR pszValueName,DWORD *pdwValue) {
    return This->lpVtbl->GetDWORD(This,pszValueName,pdwValue);
}
static FORCEINLINE HRESULT ISpObjectTokenCategory_OpenKey(ISpObjectTokenCategory* This,LPCWSTR pszSubKeyName,ISpDataKey **ppSubKey) {
    return This->lpVtbl->OpenKey(This,pszSubKeyName,ppSubKey);
}
static FORCEINLINE HRESULT ISpObjectTokenCategory_CreateKey(ISpObjectTokenCategory* This,LPCWSTR pszSubKey,ISpDataKey **ppSubKey) {
    return This->lpVtbl->CreateKey(This,pszSubKey,ppSubKey);
}
static FORCEINLINE HRESULT ISpObjectTokenCategory_DeleteKey(ISpObjectTokenCategory* This,LPCWSTR pszSubKey) {
    return This->lpVtbl->DeleteKey(This,pszSubKey);
}
static FORCEINLINE HRESULT ISpObjectTokenCategory_DeleteValue(ISpObjectTokenCategory* This,LPCWSTR pszValueName) {
    return This->lpVtbl->DeleteValue(This,pszValueName);
}
static FORCEINLINE HRESULT ISpObjectTokenCategory_EnumKeys(ISpObjectTokenCategory* This,ULONG Index,LPWSTR *ppszSubKeyName) {
    return This->lpVtbl->EnumKeys(This,Index,ppszSubKeyName);
}
static FORCEINLINE HRESULT ISpObjectTokenCategory_EnumValues(ISpObjectTokenCategory* This,ULONG Index,LPWSTR *ppszValueName) {
    return This->lpVtbl->EnumValues(This,Index,ppszValueName);
}
/*** ISpObjectTokenCategory methods ***/
static FORCEINLINE HRESULT ISpObjectTokenCategory_SetId(ISpObjectTokenCategory* This,LPCWSTR pszCategoryId,WINBOOL fCreateIfNotExist) {
    return This->lpVtbl->SetId(This,pszCategoryId,fCreateIfNotExist);
}
static FORCEINLINE HRESULT ISpObjectTokenCategory_GetId(ISpObjectTokenCategory* This,LPWSTR *ppszCoMemCategoryId) {
    return This->lpVtbl->GetId(This,ppszCoMemCategoryId);
}
static FORCEINLINE HRESULT ISpObjectTokenCategory_GetDataKey(ISpObjectTokenCategory* This,SPDATAKEYLOCATION spdkl,ISpDataKey **ppDataKey) {
    return This->lpVtbl->GetDataKey(This,spdkl,ppDataKey);
}
static FORCEINLINE HRESULT ISpObjectTokenCategory_EnumTokens(ISpObjectTokenCategory* This,LPCWSTR pzsReqAttribs,LPCWSTR pszOptAttribs,IEnumSpObjectTokens **ppEnum) {
    return This->lpVtbl->EnumTokens(This,pzsReqAttribs,pszOptAttribs,ppEnum);
}
static FORCEINLINE HRESULT ISpObjectTokenCategory_SetDefaultTokenId(ISpObjectTokenCategory* This,LPCWSTR pszTokenId) {
    return This->lpVtbl->SetDefaultTokenId(This,pszTokenId);
}
static FORCEINLINE HRESULT ISpObjectTokenCategory_GetDefaultTokenId(ISpObjectTokenCategory* This,LPWSTR *ppszCoMemTokenId) {
    return This->lpVtbl->GetDefaultTokenId(This,ppszCoMemTokenId);
}
#endif
#endif

#endif


#endif  /* __ISpObjectTokenCategory_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpObjectToken interface
 */
#ifndef __ISpObjectToken_INTERFACE_DEFINED__
#define __ISpObjectToken_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpObjectToken, 0x14056589, 0xe16c, 0x11d2, 0xbb,0x90, 0x00,0xc0,0x4f,0x8e,0xe6,0xc0);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("14056589-e16c-11d2-bb90-00c04f8ee6c0")
ISpObjectToken : public ISpDataKey
{
    virtual HRESULT STDMETHODCALLTYPE SetId(
        LPCWSTR pszCategoryId,
        LPCWSTR pszTokenId,
        WINBOOL fCreateIfNotExist) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetId(
        LPWSTR *ppszCoMemTokenId) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetCategory(
        ISpObjectTokenCategory **ppTokenCategory) = 0;

    virtual HRESULT STDMETHODCALLTYPE CreateInstance(
        IUnknown *pUnkOuter,
        DWORD dwClsContext,
        REFIID riid,
        void **ppvObject) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetStorageFileName(
        REFCLSID clsidCaller,
        LPCWSTR pszValueName,
        LPCWSTR pszFileNameSpecifier,
        ULONG nFolder,
        LPWSTR *ppszFilePath) = 0;

    virtual HRESULT STDMETHODCALLTYPE RemoveStorageFileName(
        REFCLSID clsidCaller,
        LPCWSTR pszKeyName,
        WINBOOL fDeleteFile) = 0;

    virtual HRESULT STDMETHODCALLTYPE Remove(
        const CLSID *pclsidCaller) = 0;

    virtual HRESULT STDMETHODCALLTYPE IsUISupported(
        LPCWSTR pszTypeOfUI,
        void *pvExtraData,
        ULONG cbExtraData,
        IUnknown *punkObject,
        WINBOOL *pfSupported) = 0;

    virtual HRESULT STDMETHODCALLTYPE DisplayUI(
        HWND hwndParent,
        LPCWSTR pszTitle,
        LPCWSTR pszTypeOfUI,
        void *pvExtraData,
        ULONG cbExtraData,
        IUnknown *punkObject) = 0;

    virtual HRESULT STDMETHODCALLTYPE MatchesAttributes(
        LPCWSTR pszAttributes,
        WINBOOL *pfMatches) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpObjectToken, 0x14056589, 0xe16c, 0x11d2, 0xbb,0x90, 0x00,0xc0,0x4f,0x8e,0xe6,0xc0)
#endif
#else
typedef struct ISpObjectTokenVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpObjectToken *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpObjectToken *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpObjectToken *This);

    /*** ISpDataKey methods ***/
    HRESULT (STDMETHODCALLTYPE *SetData)(
        ISpObjectToken *This,
        LPCWSTR pszValueName,
        ULONG cbData,
        const BYTE *pData);

    HRESULT (STDMETHODCALLTYPE *GetData)(
        ISpObjectToken *This,
        LPCWSTR pszValueName,
        ULONG *pcbData,
        BYTE *pData);

    HRESULT (STDMETHODCALLTYPE *SetStringValue)(
        ISpObjectToken *This,
        LPCWSTR pszValueName,
        LPCWSTR pszValue);

    HRESULT (STDMETHODCALLTYPE *GetStringValue)(
        ISpObjectToken *This,
        LPCWSTR pszValueName,
        LPWSTR *ppszValue);

    HRESULT (STDMETHODCALLTYPE *SetDWORD)(
        ISpObjectToken *This,
        LPCWSTR pszValueName,
        DWORD dwValue);

    HRESULT (STDMETHODCALLTYPE *GetDWORD)(
        ISpObjectToken *This,
        LPCWSTR pszValueName,
        DWORD *pdwValue);

    HRESULT (STDMETHODCALLTYPE *OpenKey)(
        ISpObjectToken *This,
        LPCWSTR pszSubKeyName,
        ISpDataKey **ppSubKey);

    HRESULT (STDMETHODCALLTYPE *CreateKey)(
        ISpObjectToken *This,
        LPCWSTR pszSubKey,
        ISpDataKey **ppSubKey);

    HRESULT (STDMETHODCALLTYPE *DeleteKey)(
        ISpObjectToken *This,
        LPCWSTR pszSubKey);

    HRESULT (STDMETHODCALLTYPE *DeleteValue)(
        ISpObjectToken *This,
        LPCWSTR pszValueName);

    HRESULT (STDMETHODCALLTYPE *EnumKeys)(
        ISpObjectToken *This,
        ULONG Index,
        LPWSTR *ppszSubKeyName);

    HRESULT (STDMETHODCALLTYPE *EnumValues)(
        ISpObjectToken *This,
        ULONG Index,
        LPWSTR *ppszValueName);

    /*** ISpObjectToken methods ***/
    HRESULT (STDMETHODCALLTYPE *SetId)(
        ISpObjectToken *This,
        LPCWSTR pszCategoryId,
        LPCWSTR pszTokenId,
        WINBOOL fCreateIfNotExist);

    HRESULT (STDMETHODCALLTYPE *GetId)(
        ISpObjectToken *This,
        LPWSTR *ppszCoMemTokenId);

    HRESULT (STDMETHODCALLTYPE *GetCategory)(
        ISpObjectToken *This,
        ISpObjectTokenCategory **ppTokenCategory);

    HRESULT (STDMETHODCALLTYPE *CreateInstance)(
        ISpObjectToken *This,
        IUnknown *pUnkOuter,
        DWORD dwClsContext,
        REFIID riid,
        void **ppvObject);

    HRESULT (STDMETHODCALLTYPE *GetStorageFileName)(
        ISpObjectToken *This,
        REFCLSID clsidCaller,
        LPCWSTR pszValueName,
        LPCWSTR pszFileNameSpecifier,
        ULONG nFolder,
        LPWSTR *ppszFilePath);

    HRESULT (STDMETHODCALLTYPE *RemoveStorageFileName)(
        ISpObjectToken *This,
        REFCLSID clsidCaller,
        LPCWSTR pszKeyName,
        WINBOOL fDeleteFile);

    HRESULT (STDMETHODCALLTYPE *Remove)(
        ISpObjectToken *This,
        const CLSID *pclsidCaller);

    HRESULT (STDMETHODCALLTYPE *IsUISupported)(
        ISpObjectToken *This,
        LPCWSTR pszTypeOfUI,
        void *pvExtraData,
        ULONG cbExtraData,
        IUnknown *punkObject,
        WINBOOL *pfSupported);

    HRESULT (STDMETHODCALLTYPE *DisplayUI)(
        ISpObjectToken *This,
        HWND hwndParent,
        LPCWSTR pszTitle,
        LPCWSTR pszTypeOfUI,
        void *pvExtraData,
        ULONG cbExtraData,
        IUnknown *punkObject);

    HRESULT (STDMETHODCALLTYPE *MatchesAttributes)(
        ISpObjectToken *This,
        LPCWSTR pszAttributes,
        WINBOOL *pfMatches);

    END_INTERFACE
} ISpObjectTokenVtbl;

interface ISpObjectToken {
    CONST_VTBL ISpObjectTokenVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpObjectToken_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpObjectToken_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpObjectToken_Release(This) (This)->lpVtbl->Release(This)
/*** ISpDataKey methods ***/
#define ISpObjectToken_SetData(This,pszValueName,cbData,pData) (This)->lpVtbl->SetData(This,pszValueName,cbData,pData)
#define ISpObjectToken_GetData(This,pszValueName,pcbData,pData) (This)->lpVtbl->GetData(This,pszValueName,pcbData,pData)
#define ISpObjectToken_SetStringValue(This,pszValueName,pszValue) (This)->lpVtbl->SetStringValue(This,pszValueName,pszValue)
#define ISpObjectToken_GetStringValue(This,pszValueName,ppszValue) (This)->lpVtbl->GetStringValue(This,pszValueName,ppszValue)
#define ISpObjectToken_SetDWORD(This,pszValueName,dwValue) (This)->lpVtbl->SetDWORD(This,pszValueName,dwValue)
#define ISpObjectToken_GetDWORD(This,pszValueName,pdwValue) (This)->lpVtbl->GetDWORD(This,pszValueName,pdwValue)
#define ISpObjectToken_OpenKey(This,pszSubKeyName,ppSubKey) (This)->lpVtbl->OpenKey(This,pszSubKeyName,ppSubKey)
#define ISpObjectToken_CreateKey(This,pszSubKey,ppSubKey) (This)->lpVtbl->CreateKey(This,pszSubKey,ppSubKey)
#define ISpObjectToken_DeleteKey(This,pszSubKey) (This)->lpVtbl->DeleteKey(This,pszSubKey)
#define ISpObjectToken_DeleteValue(This,pszValueName) (This)->lpVtbl->DeleteValue(This,pszValueName)
#define ISpObjectToken_EnumKeys(This,Index,ppszSubKeyName) (This)->lpVtbl->EnumKeys(This,Index,ppszSubKeyName)
#define ISpObjectToken_EnumValues(This,Index,ppszValueName) (This)->lpVtbl->EnumValues(This,Index,ppszValueName)
/*** ISpObjectToken methods ***/
#define ISpObjectToken_SetId(This,pszCategoryId,pszTokenId,fCreateIfNotExist) (This)->lpVtbl->SetId(This,pszCategoryId,pszTokenId,fCreateIfNotExist)
#define ISpObjectToken_GetId(This,ppszCoMemTokenId) (This)->lpVtbl->GetId(This,ppszCoMemTokenId)
#define ISpObjectToken_GetCategory(This,ppTokenCategory) (This)->lpVtbl->GetCategory(This,ppTokenCategory)
#define ISpObjectToken_CreateInstance(This,pUnkOuter,dwClsContext,riid,ppvObject) (This)->lpVtbl->CreateInstance(This,pUnkOuter,dwClsContext,riid,ppvObject)
#define ISpObjectToken_GetStorageFileName(This,clsidCaller,pszValueName,pszFileNameSpecifier,nFolder,ppszFilePath) (This)->lpVtbl->GetStorageFileName(This,clsidCaller,pszValueName,pszFileNameSpecifier,nFolder,ppszFilePath)
#define ISpObjectToken_RemoveStorageFileName(This,clsidCaller,pszKeyName,fDeleteFile) (This)->lpVtbl->RemoveStorageFileName(This,clsidCaller,pszKeyName,fDeleteFile)
#define ISpObjectToken_Remove(This,pclsidCaller) (This)->lpVtbl->Remove(This,pclsidCaller)
#define ISpObjectToken_IsUISupported(This,pszTypeOfUI,pvExtraData,cbExtraData,punkObject,pfSupported) (This)->lpVtbl->IsUISupported(This,pszTypeOfUI,pvExtraData,cbExtraData,punkObject,pfSupported)
#define ISpObjectToken_DisplayUI(This,hwndParent,pszTitle,pszTypeOfUI,pvExtraData,cbExtraData,punkObject) (This)->lpVtbl->DisplayUI(This,hwndParent,pszTitle,pszTypeOfUI,pvExtraData,cbExtraData,punkObject)
#define ISpObjectToken_MatchesAttributes(This,pszAttributes,pfMatches) (This)->lpVtbl->MatchesAttributes(This,pszAttributes,pfMatches)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpObjectToken_QueryInterface(ISpObjectToken* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpObjectToken_AddRef(ISpObjectToken* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpObjectToken_Release(ISpObjectToken* This) {
    return This->lpVtbl->Release(This);
}
/*** ISpDataKey methods ***/
static FORCEINLINE HRESULT ISpObjectToken_SetData(ISpObjectToken* This,LPCWSTR pszValueName,ULONG cbData,const BYTE *pData) {
    return This->lpVtbl->SetData(This,pszValueName,cbData,pData);
}
static FORCEINLINE HRESULT ISpObjectToken_GetData(ISpObjectToken* This,LPCWSTR pszValueName,ULONG *pcbData,BYTE *pData) {
    return This->lpVtbl->GetData(This,pszValueName,pcbData,pData);
}
static FORCEINLINE HRESULT ISpObjectToken_SetStringValue(ISpObjectToken* This,LPCWSTR pszValueName,LPCWSTR pszValue) {
    return This->lpVtbl->SetStringValue(This,pszValueName,pszValue);
}
static FORCEINLINE HRESULT ISpObjectToken_GetStringValue(ISpObjectToken* This,LPCWSTR pszValueName,LPWSTR *ppszValue) {
    return This->lpVtbl->GetStringValue(This,pszValueName,ppszValue);
}
static FORCEINLINE HRESULT ISpObjectToken_SetDWORD(ISpObjectToken* This,LPCWSTR pszValueName,DWORD dwValue) {
    return This->lpVtbl->SetDWORD(This,pszValueName,dwValue);
}
static FORCEINLINE HRESULT ISpObjectToken_GetDWORD(ISpObjectToken* This,LPCWSTR pszValueName,DWORD *pdwValue) {
    return This->lpVtbl->GetDWORD(This,pszValueName,pdwValue);
}
static FORCEINLINE HRESULT ISpObjectToken_OpenKey(ISpObjectToken* This,LPCWSTR pszSubKeyName,ISpDataKey **ppSubKey) {
    return This->lpVtbl->OpenKey(This,pszSubKeyName,ppSubKey);
}
static FORCEINLINE HRESULT ISpObjectToken_CreateKey(ISpObjectToken* This,LPCWSTR pszSubKey,ISpDataKey **ppSubKey) {
    return This->lpVtbl->CreateKey(This,pszSubKey,ppSubKey);
}
static FORCEINLINE HRESULT ISpObjectToken_DeleteKey(ISpObjectToken* This,LPCWSTR pszSubKey) {
    return This->lpVtbl->DeleteKey(This,pszSubKey);
}
static FORCEINLINE HRESULT ISpObjectToken_DeleteValue(ISpObjectToken* This,LPCWSTR pszValueName) {
    return This->lpVtbl->DeleteValue(This,pszValueName);
}
static FORCEINLINE HRESULT ISpObjectToken_EnumKeys(ISpObjectToken* This,ULONG Index,LPWSTR *ppszSubKeyName) {
    return This->lpVtbl->EnumKeys(This,Index,ppszSubKeyName);
}
static FORCEINLINE HRESULT ISpObjectToken_EnumValues(ISpObjectToken* This,ULONG Index,LPWSTR *ppszValueName) {
    return This->lpVtbl->EnumValues(This,Index,ppszValueName);
}
/*** ISpObjectToken methods ***/
static FORCEINLINE HRESULT ISpObjectToken_SetId(ISpObjectToken* This,LPCWSTR pszCategoryId,LPCWSTR pszTokenId,WINBOOL fCreateIfNotExist) {
    return This->lpVtbl->SetId(This,pszCategoryId,pszTokenId,fCreateIfNotExist);
}
static FORCEINLINE HRESULT ISpObjectToken_GetId(ISpObjectToken* This,LPWSTR *ppszCoMemTokenId) {
    return This->lpVtbl->GetId(This,ppszCoMemTokenId);
}
static FORCEINLINE HRESULT ISpObjectToken_GetCategory(ISpObjectToken* This,ISpObjectTokenCategory **ppTokenCategory) {
    return This->lpVtbl->GetCategory(This,ppTokenCategory);
}
static FORCEINLINE HRESULT ISpObjectToken_CreateInstance(ISpObjectToken* This,IUnknown *pUnkOuter,DWORD dwClsContext,REFIID riid,void **ppvObject) {
    return This->lpVtbl->CreateInstance(This,pUnkOuter,dwClsContext,riid,ppvObject);
}
static FORCEINLINE HRESULT ISpObjectToken_GetStorageFileName(ISpObjectToken* This,REFCLSID clsidCaller,LPCWSTR pszValueName,LPCWSTR pszFileNameSpecifier,ULONG nFolder,LPWSTR *ppszFilePath) {
    return This->lpVtbl->GetStorageFileName(This,clsidCaller,pszValueName,pszFileNameSpecifier,nFolder,ppszFilePath);
}
static FORCEINLINE HRESULT ISpObjectToken_RemoveStorageFileName(ISpObjectToken* This,REFCLSID clsidCaller,LPCWSTR pszKeyName,WINBOOL fDeleteFile) {
    return This->lpVtbl->RemoveStorageFileName(This,clsidCaller,pszKeyName,fDeleteFile);
}
static FORCEINLINE HRESULT ISpObjectToken_Remove(ISpObjectToken* This,const CLSID *pclsidCaller) {
    return This->lpVtbl->Remove(This,pclsidCaller);
}
static FORCEINLINE HRESULT ISpObjectToken_IsUISupported(ISpObjectToken* This,LPCWSTR pszTypeOfUI,void *pvExtraData,ULONG cbExtraData,IUnknown *punkObject,WINBOOL *pfSupported) {
    return This->lpVtbl->IsUISupported(This,pszTypeOfUI,pvExtraData,cbExtraData,punkObject,pfSupported);
}
static FORCEINLINE HRESULT ISpObjectToken_DisplayUI(ISpObjectToken* This,HWND hwndParent,LPCWSTR pszTitle,LPCWSTR pszTypeOfUI,void *pvExtraData,ULONG cbExtraData,IUnknown *punkObject) {
    return This->lpVtbl->DisplayUI(This,hwndParent,pszTitle,pszTypeOfUI,pvExtraData,cbExtraData,punkObject);
}
static FORCEINLINE HRESULT ISpObjectToken_MatchesAttributes(ISpObjectToken* This,LPCWSTR pszAttributes,WINBOOL *pfMatches) {
    return This->lpVtbl->MatchesAttributes(This,pszAttributes,pfMatches);
}
#endif
#endif

#endif


#endif  /* __ISpObjectToken_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpObjectTokenInit interface
 */
#ifndef __ISpObjectTokenInit_INTERFACE_DEFINED__
#define __ISpObjectTokenInit_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpObjectTokenInit, 0xb8aab0cf, 0x346f, 0x49d8, 0x94,0x99, 0xc8,0xb0,0x3f,0x16,0x1d,0x51);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("b8aab0cf-346f-49d8-9499-c8b03f161d51")
ISpObjectTokenInit : public ISpObjectToken
{
    virtual HRESULT STDMETHODCALLTYPE InitFromDataKey(
        LPCWSTR pszCategoryId,
        LPCWSTR pszTokenId,
        ISpDataKey *pDataKey) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpObjectTokenInit, 0xb8aab0cf, 0x346f, 0x49d8, 0x94,0x99, 0xc8,0xb0,0x3f,0x16,0x1d,0x51)
#endif
#else
typedef struct ISpObjectTokenInitVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpObjectTokenInit *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpObjectTokenInit *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpObjectTokenInit *This);

    /*** ISpDataKey methods ***/
    HRESULT (STDMETHODCALLTYPE *SetData)(
        ISpObjectTokenInit *This,
        LPCWSTR pszValueName,
        ULONG cbData,
        const BYTE *pData);

    HRESULT (STDMETHODCALLTYPE *GetData)(
        ISpObjectTokenInit *This,
        LPCWSTR pszValueName,
        ULONG *pcbData,
        BYTE *pData);

    HRESULT (STDMETHODCALLTYPE *SetStringValue)(
        ISpObjectTokenInit *This,
        LPCWSTR pszValueName,
        LPCWSTR pszValue);

    HRESULT (STDMETHODCALLTYPE *GetStringValue)(
        ISpObjectTokenInit *This,
        LPCWSTR pszValueName,
        LPWSTR *ppszValue);

    HRESULT (STDMETHODCALLTYPE *SetDWORD)(
        ISpObjectTokenInit *This,
        LPCWSTR pszValueName,
        DWORD dwValue);

    HRESULT (STDMETHODCALLTYPE *GetDWORD)(
        ISpObjectTokenInit *This,
        LPCWSTR pszValueName,
        DWORD *pdwValue);

    HRESULT (STDMETHODCALLTYPE *OpenKey)(
        ISpObjectTokenInit *This,
        LPCWSTR pszSubKeyName,
        ISpDataKey **ppSubKey);

    HRESULT (STDMETHODCALLTYPE *CreateKey)(
        ISpObjectTokenInit *This,
        LPCWSTR pszSubKey,
        ISpDataKey **ppSubKey);

    HRESULT (STDMETHODCALLTYPE *DeleteKey)(
        ISpObjectTokenInit *This,
        LPCWSTR pszSubKey);

    HRESULT (STDMETHODCALLTYPE *DeleteValue)(
        ISpObjectTokenInit *This,
        LPCWSTR pszValueName);

    HRESULT (STDMETHODCALLTYPE *EnumKeys)(
        ISpObjectTokenInit *This,
        ULONG Index,
        LPWSTR *ppszSubKeyName);

    HRESULT (STDMETHODCALLTYPE *EnumValues)(
        ISpObjectTokenInit *This,
        ULONG Index,
        LPWSTR *ppszValueName);

    /*** ISpObjectToken methods ***/
    HRESULT (STDMETHODCALLTYPE *SetId)(
        ISpObjectTokenInit *This,
        LPCWSTR pszCategoryId,
        LPCWSTR pszTokenId,
        WINBOOL fCreateIfNotExist);

    HRESULT (STDMETHODCALLTYPE *GetId)(
        ISpObjectTokenInit *This,
        LPWSTR *ppszCoMemTokenId);

    HRESULT (STDMETHODCALLTYPE *GetCategory)(
        ISpObjectTokenInit *This,
        ISpObjectTokenCategory **ppTokenCategory);

    HRESULT (STDMETHODCALLTYPE *CreateInstance)(
        ISpObjectTokenInit *This,
        IUnknown *pUnkOuter,
        DWORD dwClsContext,
        REFIID riid,
        void **ppvObject);

    HRESULT (STDMETHODCALLTYPE *GetStorageFileName)(
        ISpObjectTokenInit *This,
        REFCLSID clsidCaller,
        LPCWSTR pszValueName,
        LPCWSTR pszFileNameSpecifier,
        ULONG nFolder,
        LPWSTR *ppszFilePath);

    HRESULT (STDMETHODCALLTYPE *RemoveStorageFileName)(
        ISpObjectTokenInit *This,
        REFCLSID clsidCaller,
        LPCWSTR pszKeyName,
        WINBOOL fDeleteFile);

    HRESULT (STDMETHODCALLTYPE *Remove)(
        ISpObjectTokenInit *This,
        const CLSID *pclsidCaller);

    HRESULT (STDMETHODCALLTYPE *IsUISupported)(
        ISpObjectTokenInit *This,
        LPCWSTR pszTypeOfUI,
        void *pvExtraData,
        ULONG cbExtraData,
        IUnknown *punkObject,
        WINBOOL *pfSupported);

    HRESULT (STDMETHODCALLTYPE *DisplayUI)(
        ISpObjectTokenInit *This,
        HWND hwndParent,
        LPCWSTR pszTitle,
        LPCWSTR pszTypeOfUI,
        void *pvExtraData,
        ULONG cbExtraData,
        IUnknown *punkObject);

    HRESULT (STDMETHODCALLTYPE *MatchesAttributes)(
        ISpObjectTokenInit *This,
        LPCWSTR pszAttributes,
        WINBOOL *pfMatches);

    /*** ISpObjectTokenInit methods ***/
    HRESULT (STDMETHODCALLTYPE *InitFromDataKey)(
        ISpObjectTokenInit *This,
        LPCWSTR pszCategoryId,
        LPCWSTR pszTokenId,
        ISpDataKey *pDataKey);

    END_INTERFACE
} ISpObjectTokenInitVtbl;

interface ISpObjectTokenInit {
    CONST_VTBL ISpObjectTokenInitVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpObjectTokenInit_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpObjectTokenInit_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpObjectTokenInit_Release(This) (This)->lpVtbl->Release(This)
/*** ISpDataKey methods ***/
#define ISpObjectTokenInit_SetData(This,pszValueName,cbData,pData) (This)->lpVtbl->SetData(This,pszValueName,cbData,pData)
#define ISpObjectTokenInit_GetData(This,pszValueName,pcbData,pData) (This)->lpVtbl->GetData(This,pszValueName,pcbData,pData)
#define ISpObjectTokenInit_SetStringValue(This,pszValueName,pszValue) (This)->lpVtbl->SetStringValue(This,pszValueName,pszValue)
#define ISpObjectTokenInit_GetStringValue(This,pszValueName,ppszValue) (This)->lpVtbl->GetStringValue(This,pszValueName,ppszValue)
#define ISpObjectTokenInit_SetDWORD(This,pszValueName,dwValue) (This)->lpVtbl->SetDWORD(This,pszValueName,dwValue)
#define ISpObjectTokenInit_GetDWORD(This,pszValueName,pdwValue) (This)->lpVtbl->GetDWORD(This,pszValueName,pdwValue)
#define ISpObjectTokenInit_OpenKey(This,pszSubKeyName,ppSubKey) (This)->lpVtbl->OpenKey(This,pszSubKeyName,ppSubKey)
#define ISpObjectTokenInit_CreateKey(This,pszSubKey,ppSubKey) (This)->lpVtbl->CreateKey(This,pszSubKey,ppSubKey)
#define ISpObjectTokenInit_DeleteKey(This,pszSubKey) (This)->lpVtbl->DeleteKey(This,pszSubKey)
#define ISpObjectTokenInit_DeleteValue(This,pszValueName) (This)->lpVtbl->DeleteValue(This,pszValueName)
#define ISpObjectTokenInit_EnumKeys(This,Index,ppszSubKeyName) (This)->lpVtbl->EnumKeys(This,Index,ppszSubKeyName)
#define ISpObjectTokenInit_EnumValues(This,Index,ppszValueName) (This)->lpVtbl->EnumValues(This,Index,ppszValueName)
/*** ISpObjectToken methods ***/
#define ISpObjectTokenInit_SetId(This,pszCategoryId,pszTokenId,fCreateIfNotExist) (This)->lpVtbl->SetId(This,pszCategoryId,pszTokenId,fCreateIfNotExist)
#define ISpObjectTokenInit_GetId(This,ppszCoMemTokenId) (This)->lpVtbl->GetId(This,ppszCoMemTokenId)
#define ISpObjectTokenInit_GetCategory(This,ppTokenCategory) (This)->lpVtbl->GetCategory(This,ppTokenCategory)
#define ISpObjectTokenInit_CreateInstance(This,pUnkOuter,dwClsContext,riid,ppvObject) (This)->lpVtbl->CreateInstance(This,pUnkOuter,dwClsContext,riid,ppvObject)
#define ISpObjectTokenInit_GetStorageFileName(This,clsidCaller,pszValueName,pszFileNameSpecifier,nFolder,ppszFilePath) (This)->lpVtbl->GetStorageFileName(This,clsidCaller,pszValueName,pszFileNameSpecifier,nFolder,ppszFilePath)
#define ISpObjectTokenInit_RemoveStorageFileName(This,clsidCaller,pszKeyName,fDeleteFile) (This)->lpVtbl->RemoveStorageFileName(This,clsidCaller,pszKeyName,fDeleteFile)
#define ISpObjectTokenInit_Remove(This,pclsidCaller) (This)->lpVtbl->Remove(This,pclsidCaller)
#define ISpObjectTokenInit_IsUISupported(This,pszTypeOfUI,pvExtraData,cbExtraData,punkObject,pfSupported) (This)->lpVtbl->IsUISupported(This,pszTypeOfUI,pvExtraData,cbExtraData,punkObject,pfSupported)
#define ISpObjectTokenInit_DisplayUI(This,hwndParent,pszTitle,pszTypeOfUI,pvExtraData,cbExtraData,punkObject) (This)->lpVtbl->DisplayUI(This,hwndParent,pszTitle,pszTypeOfUI,pvExtraData,cbExtraData,punkObject)
#define ISpObjectTokenInit_MatchesAttributes(This,pszAttributes,pfMatches) (This)->lpVtbl->MatchesAttributes(This,pszAttributes,pfMatches)
/*** ISpObjectTokenInit methods ***/
#define ISpObjectTokenInit_InitFromDataKey(This,pszCategoryId,pszTokenId,pDataKey) (This)->lpVtbl->InitFromDataKey(This,pszCategoryId,pszTokenId,pDataKey)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpObjectTokenInit_QueryInterface(ISpObjectTokenInit* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpObjectTokenInit_AddRef(ISpObjectTokenInit* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpObjectTokenInit_Release(ISpObjectTokenInit* This) {
    return This->lpVtbl->Release(This);
}
/*** ISpDataKey methods ***/
static FORCEINLINE HRESULT ISpObjectTokenInit_SetData(ISpObjectTokenInit* This,LPCWSTR pszValueName,ULONG cbData,const BYTE *pData) {
    return This->lpVtbl->SetData(This,pszValueName,cbData,pData);
}
static FORCEINLINE HRESULT ISpObjectTokenInit_GetData(ISpObjectTokenInit* This,LPCWSTR pszValueName,ULONG *pcbData,BYTE *pData) {
    return This->lpVtbl->GetData(This,pszValueName,pcbData,pData);
}
static FORCEINLINE HRESULT ISpObjectTokenInit_SetStringValue(ISpObjectTokenInit* This,LPCWSTR pszValueName,LPCWSTR pszValue) {
    return This->lpVtbl->SetStringValue(This,pszValueName,pszValue);
}
static FORCEINLINE HRESULT ISpObjectTokenInit_GetStringValue(ISpObjectTokenInit* This,LPCWSTR pszValueName,LPWSTR *ppszValue) {
    return This->lpVtbl->GetStringValue(This,pszValueName,ppszValue);
}
static FORCEINLINE HRESULT ISpObjectTokenInit_SetDWORD(ISpObjectTokenInit* This,LPCWSTR pszValueName,DWORD dwValue) {
    return This->lpVtbl->SetDWORD(This,pszValueName,dwValue);
}
static FORCEINLINE HRESULT ISpObjectTokenInit_GetDWORD(ISpObjectTokenInit* This,LPCWSTR pszValueName,DWORD *pdwValue) {
    return This->lpVtbl->GetDWORD(This,pszValueName,pdwValue);
}
static FORCEINLINE HRESULT ISpObjectTokenInit_OpenKey(ISpObjectTokenInit* This,LPCWSTR pszSubKeyName,ISpDataKey **ppSubKey) {
    return This->lpVtbl->OpenKey(This,pszSubKeyName,ppSubKey);
}
static FORCEINLINE HRESULT ISpObjectTokenInit_CreateKey(ISpObjectTokenInit* This,LPCWSTR pszSubKey,ISpDataKey **ppSubKey) {
    return This->lpVtbl->CreateKey(This,pszSubKey,ppSubKey);
}
static FORCEINLINE HRESULT ISpObjectTokenInit_DeleteKey(ISpObjectTokenInit* This,LPCWSTR pszSubKey) {
    return This->lpVtbl->DeleteKey(This,pszSubKey);
}
static FORCEINLINE HRESULT ISpObjectTokenInit_DeleteValue(ISpObjectTokenInit* This,LPCWSTR pszValueName) {
    return This->lpVtbl->DeleteValue(This,pszValueName);
}
static FORCEINLINE HRESULT ISpObjectTokenInit_EnumKeys(ISpObjectTokenInit* This,ULONG Index,LPWSTR *ppszSubKeyName) {
    return This->lpVtbl->EnumKeys(This,Index,ppszSubKeyName);
}
static FORCEINLINE HRESULT ISpObjectTokenInit_EnumValues(ISpObjectTokenInit* This,ULONG Index,LPWSTR *ppszValueName) {
    return This->lpVtbl->EnumValues(This,Index,ppszValueName);
}
/*** ISpObjectToken methods ***/
static FORCEINLINE HRESULT ISpObjectTokenInit_SetId(ISpObjectTokenInit* This,LPCWSTR pszCategoryId,LPCWSTR pszTokenId,WINBOOL fCreateIfNotExist) {
    return This->lpVtbl->SetId(This,pszCategoryId,pszTokenId,fCreateIfNotExist);
}
static FORCEINLINE HRESULT ISpObjectTokenInit_GetId(ISpObjectTokenInit* This,LPWSTR *ppszCoMemTokenId) {
    return This->lpVtbl->GetId(This,ppszCoMemTokenId);
}
static FORCEINLINE HRESULT ISpObjectTokenInit_GetCategory(ISpObjectTokenInit* This,ISpObjectTokenCategory **ppTokenCategory) {
    return This->lpVtbl->GetCategory(This,ppTokenCategory);
}
static FORCEINLINE HRESULT ISpObjectTokenInit_CreateInstance(ISpObjectTokenInit* This,IUnknown *pUnkOuter,DWORD dwClsContext,REFIID riid,void **ppvObject) {
    return This->lpVtbl->CreateInstance(This,pUnkOuter,dwClsContext,riid,ppvObject);
}
static FORCEINLINE HRESULT ISpObjectTokenInit_GetStorageFileName(ISpObjectTokenInit* This,REFCLSID clsidCaller,LPCWSTR pszValueName,LPCWSTR pszFileNameSpecifier,ULONG nFolder,LPWSTR *ppszFilePath) {
    return This->lpVtbl->GetStorageFileName(This,clsidCaller,pszValueName,pszFileNameSpecifier,nFolder,ppszFilePath);
}
static FORCEINLINE HRESULT ISpObjectTokenInit_RemoveStorageFileName(ISpObjectTokenInit* This,REFCLSID clsidCaller,LPCWSTR pszKeyName,WINBOOL fDeleteFile) {
    return This->lpVtbl->RemoveStorageFileName(This,clsidCaller,pszKeyName,fDeleteFile);
}
static FORCEINLINE HRESULT ISpObjectTokenInit_Remove(ISpObjectTokenInit* This,const CLSID *pclsidCaller) {
    return This->lpVtbl->Remove(This,pclsidCaller);
}
static FORCEINLINE HRESULT ISpObjectTokenInit_IsUISupported(ISpObjectTokenInit* This,LPCWSTR pszTypeOfUI,void *pvExtraData,ULONG cbExtraData,IUnknown *punkObject,WINBOOL *pfSupported) {
    return This->lpVtbl->IsUISupported(This,pszTypeOfUI,pvExtraData,cbExtraData,punkObject,pfSupported);
}
static FORCEINLINE HRESULT ISpObjectTokenInit_DisplayUI(ISpObjectTokenInit* This,HWND hwndParent,LPCWSTR pszTitle,LPCWSTR pszTypeOfUI,void *pvExtraData,ULONG cbExtraData,IUnknown *punkObject) {
    return This->lpVtbl->DisplayUI(This,hwndParent,pszTitle,pszTypeOfUI,pvExtraData,cbExtraData,punkObject);
}
static FORCEINLINE HRESULT ISpObjectTokenInit_MatchesAttributes(ISpObjectTokenInit* This,LPCWSTR pszAttributes,WINBOOL *pfMatches) {
    return This->lpVtbl->MatchesAttributes(This,pszAttributes,pfMatches);
}
/*** ISpObjectTokenInit methods ***/
static FORCEINLINE HRESULT ISpObjectTokenInit_InitFromDataKey(ISpObjectTokenInit* This,LPCWSTR pszCategoryId,LPCWSTR pszTokenId,ISpDataKey *pDataKey) {
    return This->lpVtbl->InitFromDataKey(This,pszCategoryId,pszTokenId,pDataKey);
}
#endif
#endif

#endif


#endif  /* __ISpObjectTokenInit_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpResourceManager interface
 */
#ifndef __ISpResourceManager_INTERFACE_DEFINED__
#define __ISpResourceManager_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpResourceManager, 0x93384e18, 0x5014, 0x43d5, 0xad,0xbb, 0xa7,0x8e,0x05,0x59,0x26,0xbd);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("93384e18-5014-43d5-adbb-a78e055926bd")
ISpResourceManager : public IServiceProvider
{
    virtual HRESULT STDMETHODCALLTYPE SetObject(
        REFGUID guidServiceId,
        IUnknown *pUnkObject) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetObject(
        REFGUID guidServiceId,
        REFCLSID ObjectCLSID,
        REFIID ObjectIID,
        WINBOOL fReleaseWhenLastExternalRefReleased,
        void **ppObject) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpResourceManager, 0x93384e18, 0x5014, 0x43d5, 0xad,0xbb, 0xa7,0x8e,0x05,0x59,0x26,0xbd)
#endif
#else
typedef struct ISpResourceManagerVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpResourceManager *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpResourceManager *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpResourceManager *This);

    /*** IServiceProvider methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryService)(
        ISpResourceManager *This,
        REFGUID guidService,
        REFIID riid,
        void **ppvObject);

    /*** ISpResourceManager methods ***/
    HRESULT (STDMETHODCALLTYPE *SetObject)(
        ISpResourceManager *This,
        REFGUID guidServiceId,
        IUnknown *pUnkObject);

    HRESULT (STDMETHODCALLTYPE *GetObject)(
        ISpResourceManager *This,
        REFGUID guidServiceId,
        REFCLSID ObjectCLSID,
        REFIID ObjectIID,
        WINBOOL fReleaseWhenLastExternalRefReleased,
        void **ppObject);

    END_INTERFACE
} ISpResourceManagerVtbl;

interface ISpResourceManager {
    CONST_VTBL ISpResourceManagerVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpResourceManager_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpResourceManager_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpResourceManager_Release(This) (This)->lpVtbl->Release(This)
/*** IServiceProvider methods ***/
#define ISpResourceManager_QueryService(This,guidService,riid,ppvObject) (This)->lpVtbl->QueryService(This,guidService,riid,ppvObject)
/*** ISpResourceManager methods ***/
#define ISpResourceManager_SetObject(This,guidServiceId,pUnkObject) (This)->lpVtbl->SetObject(This,guidServiceId,pUnkObject)
#define ISpResourceManager_GetObject(This,guidServiceId,ObjectCLSID,ObjectIID,fReleaseWhenLastExternalRefReleased,ppObject) (This)->lpVtbl->GetObject(This,guidServiceId,ObjectCLSID,ObjectIID,fReleaseWhenLastExternalRefReleased,ppObject)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpResourceManager_QueryInterface(ISpResourceManager* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpResourceManager_AddRef(ISpResourceManager* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpResourceManager_Release(ISpResourceManager* This) {
    return This->lpVtbl->Release(This);
}
/*** IServiceProvider methods ***/
static FORCEINLINE HRESULT ISpResourceManager_QueryService(ISpResourceManager* This,REFGUID guidService,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryService(This,guidService,riid,ppvObject);
}
/*** ISpResourceManager methods ***/
static FORCEINLINE HRESULT ISpResourceManager_SetObject(ISpResourceManager* This,REFGUID guidServiceId,IUnknown *pUnkObject) {
    return This->lpVtbl->SetObject(This,guidServiceId,pUnkObject);
}
static FORCEINLINE HRESULT ISpResourceManager_GetObject(ISpResourceManager* This,REFGUID guidServiceId,REFCLSID ObjectCLSID,REFIID ObjectIID,WINBOOL fReleaseWhenLastExternalRefReleased,void **ppObject) {
    return This->lpVtbl->GetObject(This,guidServiceId,ObjectCLSID,ObjectIID,fReleaseWhenLastExternalRefReleased,ppObject);
}
#endif
#endif

#endif


#endif  /* __ISpResourceManager_INTERFACE_DEFINED__ */

#if 0
typedef struct SPEVENT {
    WORD eEventId;
    WORD elParamType;
    ULONG ulStreamNum;
    ULONGLONG ullAudioStreamOffset;
    WPARAM wParam;
    LPARAM lParam;
} SPEVENT;
typedef struct SPSERIALIZEDEVENT {
    WORD eEventId;
    WORD elParamType;
    ULONG ulStreamNum;
    ULONGLONG ullAudioStreamOffset;
    ULONG SerializedwParam;
    LONG SerializedlParam;
} SPSERIALIZEDEVENT;
typedef struct SPSERIALIZEDEVENT64 {
    WORD eEventId;
    WORD elParamType;
    ULONG ulStreamNum;
    ULONGLONG ullAudioStreamOffset;
    ULONGLONG SerializedwParam;
    LONGLONG SerializedlParam;
} SPSERIALIZEDEVENT64;
#else
typedef struct SPEVENT {
  SPEVENTENUM eEventId : 16;
  SPEVENTLPARAMTYPE elParamType : 16;
  ULONG ulStreamNum;
  ULONGLONG ullAudioStreamOffset;
  WPARAM      wParam;
  LPARAM      lParam;
} SPEVENT;

typedef struct SPSERIALIZEDEVENT {
  SPEVENTENUM eEventId : 16;
  SPEVENTLPARAMTYPE elParamType : 16;
  ULONG ulStreamNum;
  ULONGLONG ullAudioStreamOffset;
  ULONG SerializedwParam;
  LONG SerializedlParam;
} SPSERIALIZEDEVENT;

typedef struct SPSERIALIZEDEVENT64 {
  SPEVENTENUM eEventId : 16;
  SPEVENTLPARAMTYPE elParamType : 16;
  ULONG ulStreamNum;
  ULONGLONG ullAudioStreamOffset;
  ULONGLONG SerializedwParam;
  LONGLONG SerializedlParam;
} SPSERIALIZEDEVENT64;
#endif
#if 0
typedef struct SPEVENTEX {
    WORD eEventId;
    WORD elParamType;
    ULONG ulStreamNum;
    ULONGLONG ullAudioStreamOffset;
    WPARAM wParam;
    LPARAM lParam;
    ULONGLONG ullAudioTimeOffset;
} SPEVENTEX;
#else
typedef struct SPEVENTEX {
  SPEVENTENUM eEventId : 16;
  SPEVENTLPARAMTYPE elParamType : 16;
  ULONG ulStreamNum;
  ULONGLONG ullAudioStreamOffset;
  WPARAM wParam;
  LPARAM lParam;
  ULONGLONG ullAudioTimeOffset;
} SPEVENTEX;
#endif
typedef struct SPEVENTSOURCEINFO {
    ULONGLONG ullEventInterest;
    ULONGLONG ullQueuedInterest;
    ULONG ulCount;
} SPEVENTSOURCEINFO;
/*****************************************************************************
 * ISpEventSource interface
 */
#ifndef __ISpEventSource_INTERFACE_DEFINED__
#define __ISpEventSource_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpEventSource, 0xbe7a9cce, 0x5f9e, 0x11d2, 0x96,0x0f, 0x00,0xc0,0x4f,0x8e,0xe6,0x28);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("be7a9cce-5f9e-11d2-960f-00c04f8ee628")
ISpEventSource : public ISpNotifySource
{
    virtual HRESULT STDMETHODCALLTYPE SetInterest(
        ULONGLONG ullEventInterest,
        ULONGLONG ullQueuedInterest) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetEvents(
        ULONG ulCount,
        SPEVENT *pEventArray,
        ULONG *pulFetched) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetInfo(
        SPEVENTSOURCEINFO *pInfo) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpEventSource, 0xbe7a9cce, 0x5f9e, 0x11d2, 0x96,0x0f, 0x00,0xc0,0x4f,0x8e,0xe6,0x28)
#endif
#else
typedef struct ISpEventSourceVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpEventSource *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpEventSource *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpEventSource *This);

    /*** ISpNotifySource methods ***/
    HRESULT (STDMETHODCALLTYPE *SetNotifySink)(
        ISpEventSource *This,
        ISpNotifySink *pNotifySink);

    HRESULT (STDMETHODCALLTYPE *SetNotifyWindowMessage)(
        ISpEventSource *This,
        HWND hWnd,
        UINT Msg,
        WPARAM wParam,
        LPARAM lParam);

    HRESULT (STDMETHODCALLTYPE *SetNotifyCallbackFunction)(
        ISpEventSource *This,
        SPNOTIFYCALLBACK *pfnCallback,
        WPARAM wParam,
        LPARAM lParam);

    HRESULT (STDMETHODCALLTYPE *SetNotifyCallbackInterface)(
        ISpEventSource *This,
        ISpNotifyCallback *pSpCallback,
        WPARAM wParam,
        LPARAM lParam);

    HRESULT (STDMETHODCALLTYPE *SetNotifyWin32Event)(
        ISpEventSource *This);

    HRESULT (STDMETHODCALLTYPE *WaitForNotifyEvent)(
        ISpEventSource *This,
        DWORD dwMilliseconds);

    HANDLE (STDMETHODCALLTYPE *GetNotifyEventHandle)(
        ISpEventSource *This);

    /*** ISpEventSource methods ***/
    HRESULT (STDMETHODCALLTYPE *SetInterest)(
        ISpEventSource *This,
        ULONGLONG ullEventInterest,
        ULONGLONG ullQueuedInterest);

    HRESULT (STDMETHODCALLTYPE *GetEvents)(
        ISpEventSource *This,
        ULONG ulCount,
        SPEVENT *pEventArray,
        ULONG *pulFetched);

    HRESULT (STDMETHODCALLTYPE *GetInfo)(
        ISpEventSource *This,
        SPEVENTSOURCEINFO *pInfo);

    END_INTERFACE
} ISpEventSourceVtbl;

interface ISpEventSource {
    CONST_VTBL ISpEventSourceVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpEventSource_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpEventSource_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpEventSource_Release(This) (This)->lpVtbl->Release(This)
/*** ISpNotifySource methods ***/
#define ISpEventSource_SetNotifySink(This,pNotifySink) (This)->lpVtbl->SetNotifySink(This,pNotifySink)
#define ISpEventSource_SetNotifyWindowMessage(This,hWnd,Msg,wParam,lParam) (This)->lpVtbl->SetNotifyWindowMessage(This,hWnd,Msg,wParam,lParam)
#define ISpEventSource_SetNotifyCallbackFunction(This,pfnCallback,wParam,lParam) (This)->lpVtbl->SetNotifyCallbackFunction(This,pfnCallback,wParam,lParam)
#define ISpEventSource_SetNotifyCallbackInterface(This,pSpCallback,wParam,lParam) (This)->lpVtbl->SetNotifyCallbackInterface(This,pSpCallback,wParam,lParam)
#define ISpEventSource_SetNotifyWin32Event(This) (This)->lpVtbl->SetNotifyWin32Event(This)
#define ISpEventSource_WaitForNotifyEvent(This,dwMilliseconds) (This)->lpVtbl->WaitForNotifyEvent(This,dwMilliseconds)
#define ISpEventSource_GetNotifyEventHandle(This) (This)->lpVtbl->GetNotifyEventHandle(This)
/*** ISpEventSource methods ***/
#define ISpEventSource_SetInterest(This,ullEventInterest,ullQueuedInterest) (This)->lpVtbl->SetInterest(This,ullEventInterest,ullQueuedInterest)
#define ISpEventSource_GetEvents(This,ulCount,pEventArray,pulFetched) (This)->lpVtbl->GetEvents(This,ulCount,pEventArray,pulFetched)
#define ISpEventSource_GetInfo(This,pInfo) (This)->lpVtbl->GetInfo(This,pInfo)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpEventSource_QueryInterface(ISpEventSource* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpEventSource_AddRef(ISpEventSource* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpEventSource_Release(ISpEventSource* This) {
    return This->lpVtbl->Release(This);
}
/*** ISpNotifySource methods ***/
static FORCEINLINE HRESULT ISpEventSource_SetNotifySink(ISpEventSource* This,ISpNotifySink *pNotifySink) {
    return This->lpVtbl->SetNotifySink(This,pNotifySink);
}
static FORCEINLINE HRESULT ISpEventSource_SetNotifyWindowMessage(ISpEventSource* This,HWND hWnd,UINT Msg,WPARAM wParam,LPARAM lParam) {
    return This->lpVtbl->SetNotifyWindowMessage(This,hWnd,Msg,wParam,lParam);
}
static FORCEINLINE HRESULT ISpEventSource_SetNotifyCallbackFunction(ISpEventSource* This,SPNOTIFYCALLBACK *pfnCallback,WPARAM wParam,LPARAM lParam) {
    return This->lpVtbl->SetNotifyCallbackFunction(This,pfnCallback,wParam,lParam);
}
static FORCEINLINE HRESULT ISpEventSource_SetNotifyCallbackInterface(ISpEventSource* This,ISpNotifyCallback *pSpCallback,WPARAM wParam,LPARAM lParam) {
    return This->lpVtbl->SetNotifyCallbackInterface(This,pSpCallback,wParam,lParam);
}
static FORCEINLINE HRESULT ISpEventSource_SetNotifyWin32Event(ISpEventSource* This) {
    return This->lpVtbl->SetNotifyWin32Event(This);
}
static FORCEINLINE HRESULT ISpEventSource_WaitForNotifyEvent(ISpEventSource* This,DWORD dwMilliseconds) {
    return This->lpVtbl->WaitForNotifyEvent(This,dwMilliseconds);
}
static FORCEINLINE HANDLE ISpEventSource_GetNotifyEventHandle(ISpEventSource* This) {
    return This->lpVtbl->GetNotifyEventHandle(This);
}
/*** ISpEventSource methods ***/
static FORCEINLINE HRESULT ISpEventSource_SetInterest(ISpEventSource* This,ULONGLONG ullEventInterest,ULONGLONG ullQueuedInterest) {
    return This->lpVtbl->SetInterest(This,ullEventInterest,ullQueuedInterest);
}
static FORCEINLINE HRESULT ISpEventSource_GetEvents(ISpEventSource* This,ULONG ulCount,SPEVENT *pEventArray,ULONG *pulFetched) {
    return This->lpVtbl->GetEvents(This,ulCount,pEventArray,pulFetched);
}
static FORCEINLINE HRESULT ISpEventSource_GetInfo(ISpEventSource* This,SPEVENTSOURCEINFO *pInfo) {
    return This->lpVtbl->GetInfo(This,pInfo);
}
#endif
#endif

#endif


#endif  /* __ISpEventSource_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpEventSource2 interface
 */
#ifndef __ISpEventSource2_INTERFACE_DEFINED__
#define __ISpEventSource2_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpEventSource2, 0x2373a435, 0x6a4b, 0x429e, 0xa6,0xac, 0xd4,0x23,0x1a,0x61,0x97,0x5b);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("2373a435-6a4b-429e-a6ac-d4231a61975b")
ISpEventSource2 : public ISpEventSource
{
    virtual HRESULT STDMETHODCALLTYPE GetEventsEx(
        ULONG ulCount,
        SPEVENTEX *pEventArray,
        ULONG *pulFetched) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpEventSource2, 0x2373a435, 0x6a4b, 0x429e, 0xa6,0xac, 0xd4,0x23,0x1a,0x61,0x97,0x5b)
#endif
#else
typedef struct ISpEventSource2Vtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpEventSource2 *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpEventSource2 *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpEventSource2 *This);

    /*** ISpNotifySource methods ***/
    HRESULT (STDMETHODCALLTYPE *SetNotifySink)(
        ISpEventSource2 *This,
        ISpNotifySink *pNotifySink);

    HRESULT (STDMETHODCALLTYPE *SetNotifyWindowMessage)(
        ISpEventSource2 *This,
        HWND hWnd,
        UINT Msg,
        WPARAM wParam,
        LPARAM lParam);

    HRESULT (STDMETHODCALLTYPE *SetNotifyCallbackFunction)(
        ISpEventSource2 *This,
        SPNOTIFYCALLBACK *pfnCallback,
        WPARAM wParam,
        LPARAM lParam);

    HRESULT (STDMETHODCALLTYPE *SetNotifyCallbackInterface)(
        ISpEventSource2 *This,
        ISpNotifyCallback *pSpCallback,
        WPARAM wParam,
        LPARAM lParam);

    HRESULT (STDMETHODCALLTYPE *SetNotifyWin32Event)(
        ISpEventSource2 *This);

    HRESULT (STDMETHODCALLTYPE *WaitForNotifyEvent)(
        ISpEventSource2 *This,
        DWORD dwMilliseconds);

    HANDLE (STDMETHODCALLTYPE *GetNotifyEventHandle)(
        ISpEventSource2 *This);

    /*** ISpEventSource methods ***/
    HRESULT (STDMETHODCALLTYPE *SetInterest)(
        ISpEventSource2 *This,
        ULONGLONG ullEventInterest,
        ULONGLONG ullQueuedInterest);

    HRESULT (STDMETHODCALLTYPE *GetEvents)(
        ISpEventSource2 *This,
        ULONG ulCount,
        SPEVENT *pEventArray,
        ULONG *pulFetched);

    HRESULT (STDMETHODCALLTYPE *GetInfo)(
        ISpEventSource2 *This,
        SPEVENTSOURCEINFO *pInfo);

    /*** ISpEventSource2 methods ***/
    HRESULT (STDMETHODCALLTYPE *GetEventsEx)(
        ISpEventSource2 *This,
        ULONG ulCount,
        SPEVENTEX *pEventArray,
        ULONG *pulFetched);

    END_INTERFACE
} ISpEventSource2Vtbl;

interface ISpEventSource2 {
    CONST_VTBL ISpEventSource2Vtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpEventSource2_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpEventSource2_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpEventSource2_Release(This) (This)->lpVtbl->Release(This)
/*** ISpNotifySource methods ***/
#define ISpEventSource2_SetNotifySink(This,pNotifySink) (This)->lpVtbl->SetNotifySink(This,pNotifySink)
#define ISpEventSource2_SetNotifyWindowMessage(This,hWnd,Msg,wParam,lParam) (This)->lpVtbl->SetNotifyWindowMessage(This,hWnd,Msg,wParam,lParam)
#define ISpEventSource2_SetNotifyCallbackFunction(This,pfnCallback,wParam,lParam) (This)->lpVtbl->SetNotifyCallbackFunction(This,pfnCallback,wParam,lParam)
#define ISpEventSource2_SetNotifyCallbackInterface(This,pSpCallback,wParam,lParam) (This)->lpVtbl->SetNotifyCallbackInterface(This,pSpCallback,wParam,lParam)
#define ISpEventSource2_SetNotifyWin32Event(This) (This)->lpVtbl->SetNotifyWin32Event(This)
#define ISpEventSource2_WaitForNotifyEvent(This,dwMilliseconds) (This)->lpVtbl->WaitForNotifyEvent(This,dwMilliseconds)
#define ISpEventSource2_GetNotifyEventHandle(This) (This)->lpVtbl->GetNotifyEventHandle(This)
/*** ISpEventSource methods ***/
#define ISpEventSource2_SetInterest(This,ullEventInterest,ullQueuedInterest) (This)->lpVtbl->SetInterest(This,ullEventInterest,ullQueuedInterest)
#define ISpEventSource2_GetEvents(This,ulCount,pEventArray,pulFetched) (This)->lpVtbl->GetEvents(This,ulCount,pEventArray,pulFetched)
#define ISpEventSource2_GetInfo(This,pInfo) (This)->lpVtbl->GetInfo(This,pInfo)
/*** ISpEventSource2 methods ***/
#define ISpEventSource2_GetEventsEx(This,ulCount,pEventArray,pulFetched) (This)->lpVtbl->GetEventsEx(This,ulCount,pEventArray,pulFetched)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpEventSource2_QueryInterface(ISpEventSource2* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpEventSource2_AddRef(ISpEventSource2* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpEventSource2_Release(ISpEventSource2* This) {
    return This->lpVtbl->Release(This);
}
/*** ISpNotifySource methods ***/
static FORCEINLINE HRESULT ISpEventSource2_SetNotifySink(ISpEventSource2* This,ISpNotifySink *pNotifySink) {
    return This->lpVtbl->SetNotifySink(This,pNotifySink);
}
static FORCEINLINE HRESULT ISpEventSource2_SetNotifyWindowMessage(ISpEventSource2* This,HWND hWnd,UINT Msg,WPARAM wParam,LPARAM lParam) {
    return This->lpVtbl->SetNotifyWindowMessage(This,hWnd,Msg,wParam,lParam);
}
static FORCEINLINE HRESULT ISpEventSource2_SetNotifyCallbackFunction(ISpEventSource2* This,SPNOTIFYCALLBACK *pfnCallback,WPARAM wParam,LPARAM lParam) {
    return This->lpVtbl->SetNotifyCallbackFunction(This,pfnCallback,wParam,lParam);
}
static FORCEINLINE HRESULT ISpEventSource2_SetNotifyCallbackInterface(ISpEventSource2* This,ISpNotifyCallback *pSpCallback,WPARAM wParam,LPARAM lParam) {
    return This->lpVtbl->SetNotifyCallbackInterface(This,pSpCallback,wParam,lParam);
}
static FORCEINLINE HRESULT ISpEventSource2_SetNotifyWin32Event(ISpEventSource2* This) {
    return This->lpVtbl->SetNotifyWin32Event(This);
}
static FORCEINLINE HRESULT ISpEventSource2_WaitForNotifyEvent(ISpEventSource2* This,DWORD dwMilliseconds) {
    return This->lpVtbl->WaitForNotifyEvent(This,dwMilliseconds);
}
static FORCEINLINE HANDLE ISpEventSource2_GetNotifyEventHandle(ISpEventSource2* This) {
    return This->lpVtbl->GetNotifyEventHandle(This);
}
/*** ISpEventSource methods ***/
static FORCEINLINE HRESULT ISpEventSource2_SetInterest(ISpEventSource2* This,ULONGLONG ullEventInterest,ULONGLONG ullQueuedInterest) {
    return This->lpVtbl->SetInterest(This,ullEventInterest,ullQueuedInterest);
}
static FORCEINLINE HRESULT ISpEventSource2_GetEvents(ISpEventSource2* This,ULONG ulCount,SPEVENT *pEventArray,ULONG *pulFetched) {
    return This->lpVtbl->GetEvents(This,ulCount,pEventArray,pulFetched);
}
static FORCEINLINE HRESULT ISpEventSource2_GetInfo(ISpEventSource2* This,SPEVENTSOURCEINFO *pInfo) {
    return This->lpVtbl->GetInfo(This,pInfo);
}
/*** ISpEventSource2 methods ***/
static FORCEINLINE HRESULT ISpEventSource2_GetEventsEx(ISpEventSource2* This,ULONG ulCount,SPEVENTEX *pEventArray,ULONG *pulFetched) {
    return This->lpVtbl->GetEventsEx(This,ulCount,pEventArray,pulFetched);
}
#endif
#endif

#endif


#endif  /* __ISpEventSource2_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpEventSink interface
 */
#ifndef __ISpEventSink_INTERFACE_DEFINED__
#define __ISpEventSink_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpEventSink, 0xbe7a9cc9, 0x5f9e, 0x11d2, 0x96,0x0f, 0x00,0xc0,0x4f,0x8e,0xe6,0x28);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("be7a9cc9-5f9e-11d2-960f-00c04f8ee628")
ISpEventSink : public IUnknown
{
    virtual HRESULT STDMETHODCALLTYPE AddEvents(
        const SPEVENT *pEventArray,
        ULONG ulCount) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetEventInterest(
        ULONGLONG *pullEventInterest) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpEventSink, 0xbe7a9cc9, 0x5f9e, 0x11d2, 0x96,0x0f, 0x00,0xc0,0x4f,0x8e,0xe6,0x28)
#endif
#else
typedef struct ISpEventSinkVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpEventSink *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpEventSink *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpEventSink *This);

    /*** ISpEventSink methods ***/
    HRESULT (STDMETHODCALLTYPE *AddEvents)(
        ISpEventSink *This,
        const SPEVENT *pEventArray,
        ULONG ulCount);

    HRESULT (STDMETHODCALLTYPE *GetEventInterest)(
        ISpEventSink *This,
        ULONGLONG *pullEventInterest);

    END_INTERFACE
} ISpEventSinkVtbl;

interface ISpEventSink {
    CONST_VTBL ISpEventSinkVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpEventSink_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpEventSink_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpEventSink_Release(This) (This)->lpVtbl->Release(This)
/*** ISpEventSink methods ***/
#define ISpEventSink_AddEvents(This,pEventArray,ulCount) (This)->lpVtbl->AddEvents(This,pEventArray,ulCount)
#define ISpEventSink_GetEventInterest(This,pullEventInterest) (This)->lpVtbl->GetEventInterest(This,pullEventInterest)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpEventSink_QueryInterface(ISpEventSink* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpEventSink_AddRef(ISpEventSink* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpEventSink_Release(ISpEventSink* This) {
    return This->lpVtbl->Release(This);
}
/*** ISpEventSink methods ***/
static FORCEINLINE HRESULT ISpEventSink_AddEvents(ISpEventSink* This,const SPEVENT *pEventArray,ULONG ulCount) {
    return This->lpVtbl->AddEvents(This,pEventArray,ulCount);
}
static FORCEINLINE HRESULT ISpEventSink_GetEventInterest(ISpEventSink* This,ULONGLONG *pullEventInterest) {
    return This->lpVtbl->GetEventInterest(This,pullEventInterest);
}
#endif
#endif

#endif


#endif  /* __ISpEventSink_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpStreamFormat interface
 */
#ifndef __ISpStreamFormat_INTERFACE_DEFINED__
#define __ISpStreamFormat_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpStreamFormat, 0xbed530be, 0x2606, 0x4f4d, 0xa1,0xc0, 0x54,0xc5,0xcd,0xa5,0x56,0x6f);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("bed530be-2606-4f4d-a1c0-54c5cda5566f")
ISpStreamFormat : public IStream
{
    virtual HRESULT STDMETHODCALLTYPE GetFormat(
        GUID *pguidFormatId,
        WAVEFORMATEX **ppCoMemWaveFormatEx) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpStreamFormat, 0xbed530be, 0x2606, 0x4f4d, 0xa1,0xc0, 0x54,0xc5,0xcd,0xa5,0x56,0x6f)
#endif
#else
typedef struct ISpStreamFormatVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpStreamFormat *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpStreamFormat *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpStreamFormat *This);

    /*** ISequentialStream methods ***/
    HRESULT (STDMETHODCALLTYPE *Read)(
        ISpStreamFormat *This,
        void *pv,
        ULONG cb,
        ULONG *pcbRead);

    HRESULT (STDMETHODCALLTYPE *Write)(
        ISpStreamFormat *This,
        const void *pv,
        ULONG cb,
        ULONG *pcbWritten);

    /*** IStream methods ***/
    HRESULT (STDMETHODCALLTYPE *Seek)(
        ISpStreamFormat *This,
        LARGE_INTEGER dlibMove,
        DWORD dwOrigin,
        ULARGE_INTEGER *plibNewPosition);

    HRESULT (STDMETHODCALLTYPE *SetSize)(
        ISpStreamFormat *This,
        ULARGE_INTEGER libNewSize);

    HRESULT (STDMETHODCALLTYPE *CopyTo)(
        ISpStreamFormat *This,
        IStream *pstm,
        ULARGE_INTEGER cb,
        ULARGE_INTEGER *pcbRead,
        ULARGE_INTEGER *pcbWritten);

    HRESULT (STDMETHODCALLTYPE *Commit)(
        ISpStreamFormat *This,
        DWORD grfCommitFlags);

    HRESULT (STDMETHODCALLTYPE *Revert)(
        ISpStreamFormat *This);

    HRESULT (STDMETHODCALLTYPE *LockRegion)(
        ISpStreamFormat *This,
        ULARGE_INTEGER libOffset,
        ULARGE_INTEGER cb,
        DWORD dwLockType);

    HRESULT (STDMETHODCALLTYPE *UnlockRegion)(
        ISpStreamFormat *This,
        ULARGE_INTEGER libOffset,
        ULARGE_INTEGER cb,
        DWORD dwLockType);

    HRESULT (STDMETHODCALLTYPE *Stat)(
        ISpStreamFormat *This,
        STATSTG *pstatstg,
        DWORD grfStatFlag);

    HRESULT (STDMETHODCALLTYPE *Clone)(
        ISpStreamFormat *This,
        IStream **ppstm);

    /*** ISpStreamFormat methods ***/
    HRESULT (STDMETHODCALLTYPE *GetFormat)(
        ISpStreamFormat *This,
        GUID *pguidFormatId,
        WAVEFORMATEX **ppCoMemWaveFormatEx);

    END_INTERFACE
} ISpStreamFormatVtbl;

interface ISpStreamFormat {
    CONST_VTBL ISpStreamFormatVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpStreamFormat_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpStreamFormat_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpStreamFormat_Release(This) (This)->lpVtbl->Release(This)
/*** ISequentialStream methods ***/
#define ISpStreamFormat_Read(This,pv,cb,pcbRead) (This)->lpVtbl->Read(This,pv,cb,pcbRead)
#define ISpStreamFormat_Write(This,pv,cb,pcbWritten) (This)->lpVtbl->Write(This,pv,cb,pcbWritten)
/*** IStream methods ***/
#define ISpStreamFormat_Seek(This,dlibMove,dwOrigin,plibNewPosition) (This)->lpVtbl->Seek(This,dlibMove,dwOrigin,plibNewPosition)
#define ISpStreamFormat_SetSize(This,libNewSize) (This)->lpVtbl->SetSize(This,libNewSize)
#define ISpStreamFormat_CopyTo(This,pstm,cb,pcbRead,pcbWritten) (This)->lpVtbl->CopyTo(This,pstm,cb,pcbRead,pcbWritten)
#define ISpStreamFormat_Commit(This,grfCommitFlags) (This)->lpVtbl->Commit(This,grfCommitFlags)
#define ISpStreamFormat_Revert(This) (This)->lpVtbl->Revert(This)
#define ISpStreamFormat_LockRegion(This,libOffset,cb,dwLockType) (This)->lpVtbl->LockRegion(This,libOffset,cb,dwLockType)
#define ISpStreamFormat_UnlockRegion(This,libOffset,cb,dwLockType) (This)->lpVtbl->UnlockRegion(This,libOffset,cb,dwLockType)
#define ISpStreamFormat_Stat(This,pstatstg,grfStatFlag) (This)->lpVtbl->Stat(This,pstatstg,grfStatFlag)
#define ISpStreamFormat_Clone(This,ppstm) (This)->lpVtbl->Clone(This,ppstm)
/*** ISpStreamFormat methods ***/
#define ISpStreamFormat_GetFormat(This,pguidFormatId,ppCoMemWaveFormatEx) (This)->lpVtbl->GetFormat(This,pguidFormatId,ppCoMemWaveFormatEx)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpStreamFormat_QueryInterface(ISpStreamFormat* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpStreamFormat_AddRef(ISpStreamFormat* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpStreamFormat_Release(ISpStreamFormat* This) {
    return This->lpVtbl->Release(This);
}
/*** ISequentialStream methods ***/
static FORCEINLINE HRESULT ISpStreamFormat_Read(ISpStreamFormat* This,void *pv,ULONG cb,ULONG *pcbRead) {
    return This->lpVtbl->Read(This,pv,cb,pcbRead);
}
static FORCEINLINE HRESULT ISpStreamFormat_Write(ISpStreamFormat* This,const void *pv,ULONG cb,ULONG *pcbWritten) {
    return This->lpVtbl->Write(This,pv,cb,pcbWritten);
}
/*** IStream methods ***/
static FORCEINLINE HRESULT ISpStreamFormat_Seek(ISpStreamFormat* This,LARGE_INTEGER dlibMove,DWORD dwOrigin,ULARGE_INTEGER *plibNewPosition) {
    return This->lpVtbl->Seek(This,dlibMove,dwOrigin,plibNewPosition);
}
static FORCEINLINE HRESULT ISpStreamFormat_SetSize(ISpStreamFormat* This,ULARGE_INTEGER libNewSize) {
    return This->lpVtbl->SetSize(This,libNewSize);
}
static FORCEINLINE HRESULT ISpStreamFormat_CopyTo(ISpStreamFormat* This,IStream *pstm,ULARGE_INTEGER cb,ULARGE_INTEGER *pcbRead,ULARGE_INTEGER *pcbWritten) {
    return This->lpVtbl->CopyTo(This,pstm,cb,pcbRead,pcbWritten);
}
static FORCEINLINE HRESULT ISpStreamFormat_Commit(ISpStreamFormat* This,DWORD grfCommitFlags) {
    return This->lpVtbl->Commit(This,grfCommitFlags);
}
static FORCEINLINE HRESULT ISpStreamFormat_Revert(ISpStreamFormat* This) {
    return This->lpVtbl->Revert(This);
}
static FORCEINLINE HRESULT ISpStreamFormat_LockRegion(ISpStreamFormat* This,ULARGE_INTEGER libOffset,ULARGE_INTEGER cb,DWORD dwLockType) {
    return This->lpVtbl->LockRegion(This,libOffset,cb,dwLockType);
}
static FORCEINLINE HRESULT ISpStreamFormat_UnlockRegion(ISpStreamFormat* This,ULARGE_INTEGER libOffset,ULARGE_INTEGER cb,DWORD dwLockType) {
    return This->lpVtbl->UnlockRegion(This,libOffset,cb,dwLockType);
}
static FORCEINLINE HRESULT ISpStreamFormat_Stat(ISpStreamFormat* This,STATSTG *pstatstg,DWORD grfStatFlag) {
    return This->lpVtbl->Stat(This,pstatstg,grfStatFlag);
}
static FORCEINLINE HRESULT ISpStreamFormat_Clone(ISpStreamFormat* This,IStream **ppstm) {
    return This->lpVtbl->Clone(This,ppstm);
}
/*** ISpStreamFormat methods ***/
static FORCEINLINE HRESULT ISpStreamFormat_GetFormat(ISpStreamFormat* This,GUID *pguidFormatId,WAVEFORMATEX **ppCoMemWaveFormatEx) {
    return This->lpVtbl->GetFormat(This,pguidFormatId,ppCoMemWaveFormatEx);
}
#endif
#endif

#endif


#endif  /* __ISpStreamFormat_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpStream interface
 */
#ifndef __ISpStream_INTERFACE_DEFINED__
#define __ISpStream_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpStream, 0x12e3cca9, 0x7518, 0x44c5, 0xa5,0xe7, 0xba,0x5a,0x79,0xcb,0x92,0x9e);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("12e3cca9-7518-44c5-a5e7-ba5a79cb929e")
ISpStream : public ISpStreamFormat
{
    virtual HRESULT STDMETHODCALLTYPE SetBaseStream(
        IStream *pStream,
        REFGUID rguidFormat,
        const WAVEFORMATEX *pWaveFormatEx) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetBaseStream(
        IStream **ppStream) = 0;

    virtual HRESULT STDMETHODCALLTYPE BindToFile(
        LPCWSTR pszFileName,
        SPFILEMODE eMode,
        const GUID *pFormatId,
        const WAVEFORMATEX *pWaveFormatEx,
        ULONGLONG ullEventInterest) = 0;

    virtual HRESULT STDMETHODCALLTYPE Close(
        ) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpStream, 0x12e3cca9, 0x7518, 0x44c5, 0xa5,0xe7, 0xba,0x5a,0x79,0xcb,0x92,0x9e)
#endif
#else
typedef struct ISpStreamVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpStream *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpStream *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpStream *This);

    /*** ISequentialStream methods ***/
    HRESULT (STDMETHODCALLTYPE *Read)(
        ISpStream *This,
        void *pv,
        ULONG cb,
        ULONG *pcbRead);

    HRESULT (STDMETHODCALLTYPE *Write)(
        ISpStream *This,
        const void *pv,
        ULONG cb,
        ULONG *pcbWritten);

    /*** IStream methods ***/
    HRESULT (STDMETHODCALLTYPE *Seek)(
        ISpStream *This,
        LARGE_INTEGER dlibMove,
        DWORD dwOrigin,
        ULARGE_INTEGER *plibNewPosition);

    HRESULT (STDMETHODCALLTYPE *SetSize)(
        ISpStream *This,
        ULARGE_INTEGER libNewSize);

    HRESULT (STDMETHODCALLTYPE *CopyTo)(
        ISpStream *This,
        IStream *pstm,
        ULARGE_INTEGER cb,
        ULARGE_INTEGER *pcbRead,
        ULARGE_INTEGER *pcbWritten);

    HRESULT (STDMETHODCALLTYPE *Commit)(
        ISpStream *This,
        DWORD grfCommitFlags);

    HRESULT (STDMETHODCALLTYPE *Revert)(
        ISpStream *This);

    HRESULT (STDMETHODCALLTYPE *LockRegion)(
        ISpStream *This,
        ULARGE_INTEGER libOffset,
        ULARGE_INTEGER cb,
        DWORD dwLockType);

    HRESULT (STDMETHODCALLTYPE *UnlockRegion)(
        ISpStream *This,
        ULARGE_INTEGER libOffset,
        ULARGE_INTEGER cb,
        DWORD dwLockType);

    HRESULT (STDMETHODCALLTYPE *Stat)(
        ISpStream *This,
        STATSTG *pstatstg,
        DWORD grfStatFlag);

    HRESULT (STDMETHODCALLTYPE *Clone)(
        ISpStream *This,
        IStream **ppstm);

    /*** ISpStreamFormat methods ***/
    HRESULT (STDMETHODCALLTYPE *GetFormat)(
        ISpStream *This,
        GUID *pguidFormatId,
        WAVEFORMATEX **ppCoMemWaveFormatEx);

    /*** ISpStream methods ***/
    HRESULT (STDMETHODCALLTYPE *SetBaseStream)(
        ISpStream *This,
        IStream *pStream,
        REFGUID rguidFormat,
        const WAVEFORMATEX *pWaveFormatEx);

    HRESULT (STDMETHODCALLTYPE *GetBaseStream)(
        ISpStream *This,
        IStream **ppStream);

    HRESULT (STDMETHODCALLTYPE *BindToFile)(
        ISpStream *This,
        LPCWSTR pszFileName,
        SPFILEMODE eMode,
        const GUID *pFormatId,
        const WAVEFORMATEX *pWaveFormatEx,
        ULONGLONG ullEventInterest);

    HRESULT (STDMETHODCALLTYPE *Close)(
        ISpStream *This);

    END_INTERFACE
} ISpStreamVtbl;

interface ISpStream {
    CONST_VTBL ISpStreamVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpStream_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpStream_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpStream_Release(This) (This)->lpVtbl->Release(This)
/*** ISequentialStream methods ***/
#define ISpStream_Read(This,pv,cb,pcbRead) (This)->lpVtbl->Read(This,pv,cb,pcbRead)
#define ISpStream_Write(This,pv,cb,pcbWritten) (This)->lpVtbl->Write(This,pv,cb,pcbWritten)
/*** IStream methods ***/
#define ISpStream_Seek(This,dlibMove,dwOrigin,plibNewPosition) (This)->lpVtbl->Seek(This,dlibMove,dwOrigin,plibNewPosition)
#define ISpStream_SetSize(This,libNewSize) (This)->lpVtbl->SetSize(This,libNewSize)
#define ISpStream_CopyTo(This,pstm,cb,pcbRead,pcbWritten) (This)->lpVtbl->CopyTo(This,pstm,cb,pcbRead,pcbWritten)
#define ISpStream_Commit(This,grfCommitFlags) (This)->lpVtbl->Commit(This,grfCommitFlags)
#define ISpStream_Revert(This) (This)->lpVtbl->Revert(This)
#define ISpStream_LockRegion(This,libOffset,cb,dwLockType) (This)->lpVtbl->LockRegion(This,libOffset,cb,dwLockType)
#define ISpStream_UnlockRegion(This,libOffset,cb,dwLockType) (This)->lpVtbl->UnlockRegion(This,libOffset,cb,dwLockType)
#define ISpStream_Stat(This,pstatstg,grfStatFlag) (This)->lpVtbl->Stat(This,pstatstg,grfStatFlag)
#define ISpStream_Clone(This,ppstm) (This)->lpVtbl->Clone(This,ppstm)
/*** ISpStreamFormat methods ***/
#define ISpStream_GetFormat(This,pguidFormatId,ppCoMemWaveFormatEx) (This)->lpVtbl->GetFormat(This,pguidFormatId,ppCoMemWaveFormatEx)
/*** ISpStream methods ***/
#define ISpStream_SetBaseStream(This,pStream,rguidFormat,pWaveFormatEx) (This)->lpVtbl->SetBaseStream(This,pStream,rguidFormat,pWaveFormatEx)
#define ISpStream_GetBaseStream(This,ppStream) (This)->lpVtbl->GetBaseStream(This,ppStream)
#define ISpStream_BindToFile(This,pszFileName,eMode,pFormatId,pWaveFormatEx,ullEventInterest) (This)->lpVtbl->BindToFile(This,pszFileName,eMode,pFormatId,pWaveFormatEx,ullEventInterest)
#define ISpStream_Close(This) (This)->lpVtbl->Close(This)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpStream_QueryInterface(ISpStream* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpStream_AddRef(ISpStream* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpStream_Release(ISpStream* This) {
    return This->lpVtbl->Release(This);
}
/*** ISequentialStream methods ***/
static FORCEINLINE HRESULT ISpStream_Read(ISpStream* This,void *pv,ULONG cb,ULONG *pcbRead) {
    return This->lpVtbl->Read(This,pv,cb,pcbRead);
}
static FORCEINLINE HRESULT ISpStream_Write(ISpStream* This,const void *pv,ULONG cb,ULONG *pcbWritten) {
    return This->lpVtbl->Write(This,pv,cb,pcbWritten);
}
/*** IStream methods ***/
static FORCEINLINE HRESULT ISpStream_Seek(ISpStream* This,LARGE_INTEGER dlibMove,DWORD dwOrigin,ULARGE_INTEGER *plibNewPosition) {
    return This->lpVtbl->Seek(This,dlibMove,dwOrigin,plibNewPosition);
}
static FORCEINLINE HRESULT ISpStream_SetSize(ISpStream* This,ULARGE_INTEGER libNewSize) {
    return This->lpVtbl->SetSize(This,libNewSize);
}
static FORCEINLINE HRESULT ISpStream_CopyTo(ISpStream* This,IStream *pstm,ULARGE_INTEGER cb,ULARGE_INTEGER *pcbRead,ULARGE_INTEGER *pcbWritten) {
    return This->lpVtbl->CopyTo(This,pstm,cb,pcbRead,pcbWritten);
}
static FORCEINLINE HRESULT ISpStream_Commit(ISpStream* This,DWORD grfCommitFlags) {
    return This->lpVtbl->Commit(This,grfCommitFlags);
}
static FORCEINLINE HRESULT ISpStream_Revert(ISpStream* This) {
    return This->lpVtbl->Revert(This);
}
static FORCEINLINE HRESULT ISpStream_LockRegion(ISpStream* This,ULARGE_INTEGER libOffset,ULARGE_INTEGER cb,DWORD dwLockType) {
    return This->lpVtbl->LockRegion(This,libOffset,cb,dwLockType);
}
static FORCEINLINE HRESULT ISpStream_UnlockRegion(ISpStream* This,ULARGE_INTEGER libOffset,ULARGE_INTEGER cb,DWORD dwLockType) {
    return This->lpVtbl->UnlockRegion(This,libOffset,cb,dwLockType);
}
static FORCEINLINE HRESULT ISpStream_Stat(ISpStream* This,STATSTG *pstatstg,DWORD grfStatFlag) {
    return This->lpVtbl->Stat(This,pstatstg,grfStatFlag);
}
static FORCEINLINE HRESULT ISpStream_Clone(ISpStream* This,IStream **ppstm) {
    return This->lpVtbl->Clone(This,ppstm);
}
/*** ISpStreamFormat methods ***/
static FORCEINLINE HRESULT ISpStream_GetFormat(ISpStream* This,GUID *pguidFormatId,WAVEFORMATEX **ppCoMemWaveFormatEx) {
    return This->lpVtbl->GetFormat(This,pguidFormatId,ppCoMemWaveFormatEx);
}
/*** ISpStream methods ***/
static FORCEINLINE HRESULT ISpStream_SetBaseStream(ISpStream* This,IStream *pStream,REFGUID rguidFormat,const WAVEFORMATEX *pWaveFormatEx) {
    return This->lpVtbl->SetBaseStream(This,pStream,rguidFormat,pWaveFormatEx);
}
static FORCEINLINE HRESULT ISpStream_GetBaseStream(ISpStream* This,IStream **ppStream) {
    return This->lpVtbl->GetBaseStream(This,ppStream);
}
static FORCEINLINE HRESULT ISpStream_BindToFile(ISpStream* This,LPCWSTR pszFileName,SPFILEMODE eMode,const GUID *pFormatId,const WAVEFORMATEX *pWaveFormatEx,ULONGLONG ullEventInterest) {
    return This->lpVtbl->BindToFile(This,pszFileName,eMode,pFormatId,pWaveFormatEx,ullEventInterest);
}
static FORCEINLINE HRESULT ISpStream_Close(ISpStream* This) {
    return This->lpVtbl->Close(This);
}
#endif
#endif

#endif


#endif  /* __ISpStream_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpStreamFormatConverter interface
 */
#ifndef __ISpStreamFormatConverter_INTERFACE_DEFINED__
#define __ISpStreamFormatConverter_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpStreamFormatConverter, 0x678a932c, 0xea71, 0x4446, 0x9b,0x41, 0x78,0xfd,0xa6,0x28,0x0a,0x29);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("678a932c-ea71-4446-9b41-78fda6280a29")
ISpStreamFormatConverter : public ISpStreamFormat
{
    virtual HRESULT STDMETHODCALLTYPE SetBaseStream(
        ISpStreamFormat *pStream,
        WINBOOL fSetFormatToBaseStreamFormat,
        WINBOOL fWriteToBaseStream) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetBaseStream(
        ISpStreamFormat **ppStream) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetFormat(
        REFGUID rguidFormatIdOfConvertedStream,
        const WAVEFORMATEX *pWaveFormatExOfConvertedStream) = 0;

    virtual HRESULT STDMETHODCALLTYPE ResetSeekPosition(
        ) = 0;

    virtual HRESULT STDMETHODCALLTYPE ScaleConvertedToBaseOffset(
        ULONGLONG ullOffsetConvertedStream,
        ULONGLONG *pullOffsetBaseStream) = 0;

    virtual HRESULT STDMETHODCALLTYPE ScaleBaseToConvertedOffset(
        ULONGLONG ullOffsetBaseStream,
        ULONGLONG *pullOffsetConvertedStream) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpStreamFormatConverter, 0x678a932c, 0xea71, 0x4446, 0x9b,0x41, 0x78,0xfd,0xa6,0x28,0x0a,0x29)
#endif
#else
typedef struct ISpStreamFormatConverterVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpStreamFormatConverter *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpStreamFormatConverter *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpStreamFormatConverter *This);

    /*** ISequentialStream methods ***/
    HRESULT (STDMETHODCALLTYPE *Read)(
        ISpStreamFormatConverter *This,
        void *pv,
        ULONG cb,
        ULONG *pcbRead);

    HRESULT (STDMETHODCALLTYPE *Write)(
        ISpStreamFormatConverter *This,
        const void *pv,
        ULONG cb,
        ULONG *pcbWritten);

    /*** IStream methods ***/
    HRESULT (STDMETHODCALLTYPE *Seek)(
        ISpStreamFormatConverter *This,
        LARGE_INTEGER dlibMove,
        DWORD dwOrigin,
        ULARGE_INTEGER *plibNewPosition);

    HRESULT (STDMETHODCALLTYPE *SetSize)(
        ISpStreamFormatConverter *This,
        ULARGE_INTEGER libNewSize);

    HRESULT (STDMETHODCALLTYPE *CopyTo)(
        ISpStreamFormatConverter *This,
        IStream *pstm,
        ULARGE_INTEGER cb,
        ULARGE_INTEGER *pcbRead,
        ULARGE_INTEGER *pcbWritten);

    HRESULT (STDMETHODCALLTYPE *Commit)(
        ISpStreamFormatConverter *This,
        DWORD grfCommitFlags);

    HRESULT (STDMETHODCALLTYPE *Revert)(
        ISpStreamFormatConverter *This);

    HRESULT (STDMETHODCALLTYPE *LockRegion)(
        ISpStreamFormatConverter *This,
        ULARGE_INTEGER libOffset,
        ULARGE_INTEGER cb,
        DWORD dwLockType);

    HRESULT (STDMETHODCALLTYPE *UnlockRegion)(
        ISpStreamFormatConverter *This,
        ULARGE_INTEGER libOffset,
        ULARGE_INTEGER cb,
        DWORD dwLockType);

    HRESULT (STDMETHODCALLTYPE *Stat)(
        ISpStreamFormatConverter *This,
        STATSTG *pstatstg,
        DWORD grfStatFlag);

    HRESULT (STDMETHODCALLTYPE *Clone)(
        ISpStreamFormatConverter *This,
        IStream **ppstm);

    /*** ISpStreamFormat methods ***/
    HRESULT (STDMETHODCALLTYPE *GetFormat)(
        ISpStreamFormatConverter *This,
        GUID *pguidFormatId,
        WAVEFORMATEX **ppCoMemWaveFormatEx);

    /*** ISpStreamFormatConverter methods ***/
    HRESULT (STDMETHODCALLTYPE *SetBaseStream)(
        ISpStreamFormatConverter *This,
        ISpStreamFormat *pStream,
        WINBOOL fSetFormatToBaseStreamFormat,
        WINBOOL fWriteToBaseStream);

    HRESULT (STDMETHODCALLTYPE *GetBaseStream)(
        ISpStreamFormatConverter *This,
        ISpStreamFormat **ppStream);

    HRESULT (STDMETHODCALLTYPE *SetFormat)(
        ISpStreamFormatConverter *This,
        REFGUID rguidFormatIdOfConvertedStream,
        const WAVEFORMATEX *pWaveFormatExOfConvertedStream);

    HRESULT (STDMETHODCALLTYPE *ResetSeekPosition)(
        ISpStreamFormatConverter *This);

    HRESULT (STDMETHODCALLTYPE *ScaleConvertedToBaseOffset)(
        ISpStreamFormatConverter *This,
        ULONGLONG ullOffsetConvertedStream,
        ULONGLONG *pullOffsetBaseStream);

    HRESULT (STDMETHODCALLTYPE *ScaleBaseToConvertedOffset)(
        ISpStreamFormatConverter *This,
        ULONGLONG ullOffsetBaseStream,
        ULONGLONG *pullOffsetConvertedStream);

    END_INTERFACE
} ISpStreamFormatConverterVtbl;

interface ISpStreamFormatConverter {
    CONST_VTBL ISpStreamFormatConverterVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpStreamFormatConverter_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpStreamFormatConverter_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpStreamFormatConverter_Release(This) (This)->lpVtbl->Release(This)
/*** ISequentialStream methods ***/
#define ISpStreamFormatConverter_Read(This,pv,cb,pcbRead) (This)->lpVtbl->Read(This,pv,cb,pcbRead)
#define ISpStreamFormatConverter_Write(This,pv,cb,pcbWritten) (This)->lpVtbl->Write(This,pv,cb,pcbWritten)
/*** IStream methods ***/
#define ISpStreamFormatConverter_Seek(This,dlibMove,dwOrigin,plibNewPosition) (This)->lpVtbl->Seek(This,dlibMove,dwOrigin,plibNewPosition)
#define ISpStreamFormatConverter_SetSize(This,libNewSize) (This)->lpVtbl->SetSize(This,libNewSize)
#define ISpStreamFormatConverter_CopyTo(This,pstm,cb,pcbRead,pcbWritten) (This)->lpVtbl->CopyTo(This,pstm,cb,pcbRead,pcbWritten)
#define ISpStreamFormatConverter_Commit(This,grfCommitFlags) (This)->lpVtbl->Commit(This,grfCommitFlags)
#define ISpStreamFormatConverter_Revert(This) (This)->lpVtbl->Revert(This)
#define ISpStreamFormatConverter_LockRegion(This,libOffset,cb,dwLockType) (This)->lpVtbl->LockRegion(This,libOffset,cb,dwLockType)
#define ISpStreamFormatConverter_UnlockRegion(This,libOffset,cb,dwLockType) (This)->lpVtbl->UnlockRegion(This,libOffset,cb,dwLockType)
#define ISpStreamFormatConverter_Stat(This,pstatstg,grfStatFlag) (This)->lpVtbl->Stat(This,pstatstg,grfStatFlag)
#define ISpStreamFormatConverter_Clone(This,ppstm) (This)->lpVtbl->Clone(This,ppstm)
/*** ISpStreamFormat methods ***/
#define ISpStreamFormatConverter_GetFormat(This,pguidFormatId,ppCoMemWaveFormatEx) (This)->lpVtbl->GetFormat(This,pguidFormatId,ppCoMemWaveFormatEx)
/*** ISpStreamFormatConverter methods ***/
#define ISpStreamFormatConverter_SetBaseStream(This,pStream,fSetFormatToBaseStreamFormat,fWriteToBaseStream) (This)->lpVtbl->SetBaseStream(This,pStream,fSetFormatToBaseStreamFormat,fWriteToBaseStream)
#define ISpStreamFormatConverter_GetBaseStream(This,ppStream) (This)->lpVtbl->GetBaseStream(This,ppStream)
#define ISpStreamFormatConverter_SetFormat(This,rguidFormatIdOfConvertedStream,pWaveFormatExOfConvertedStream) (This)->lpVtbl->SetFormat(This,rguidFormatIdOfConvertedStream,pWaveFormatExOfConvertedStream)
#define ISpStreamFormatConverter_ResetSeekPosition(This) (This)->lpVtbl->ResetSeekPosition(This)
#define ISpStreamFormatConverter_ScaleConvertedToBaseOffset(This,ullOffsetConvertedStream,pullOffsetBaseStream) (This)->lpVtbl->ScaleConvertedToBaseOffset(This,ullOffsetConvertedStream,pullOffsetBaseStream)
#define ISpStreamFormatConverter_ScaleBaseToConvertedOffset(This,ullOffsetBaseStream,pullOffsetConvertedStream) (This)->lpVtbl->ScaleBaseToConvertedOffset(This,ullOffsetBaseStream,pullOffsetConvertedStream)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpStreamFormatConverter_QueryInterface(ISpStreamFormatConverter* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpStreamFormatConverter_AddRef(ISpStreamFormatConverter* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpStreamFormatConverter_Release(ISpStreamFormatConverter* This) {
    return This->lpVtbl->Release(This);
}
/*** ISequentialStream methods ***/
static FORCEINLINE HRESULT ISpStreamFormatConverter_Read(ISpStreamFormatConverter* This,void *pv,ULONG cb,ULONG *pcbRead) {
    return This->lpVtbl->Read(This,pv,cb,pcbRead);
}
static FORCEINLINE HRESULT ISpStreamFormatConverter_Write(ISpStreamFormatConverter* This,const void *pv,ULONG cb,ULONG *pcbWritten) {
    return This->lpVtbl->Write(This,pv,cb,pcbWritten);
}
/*** IStream methods ***/
static FORCEINLINE HRESULT ISpStreamFormatConverter_Seek(ISpStreamFormatConverter* This,LARGE_INTEGER dlibMove,DWORD dwOrigin,ULARGE_INTEGER *plibNewPosition) {
    return This->lpVtbl->Seek(This,dlibMove,dwOrigin,plibNewPosition);
}
static FORCEINLINE HRESULT ISpStreamFormatConverter_SetSize(ISpStreamFormatConverter* This,ULARGE_INTEGER libNewSize) {
    return This->lpVtbl->SetSize(This,libNewSize);
}
static FORCEINLINE HRESULT ISpStreamFormatConverter_CopyTo(ISpStreamFormatConverter* This,IStream *pstm,ULARGE_INTEGER cb,ULARGE_INTEGER *pcbRead,ULARGE_INTEGER *pcbWritten) {
    return This->lpVtbl->CopyTo(This,pstm,cb,pcbRead,pcbWritten);
}
static FORCEINLINE HRESULT ISpStreamFormatConverter_Commit(ISpStreamFormatConverter* This,DWORD grfCommitFlags) {
    return This->lpVtbl->Commit(This,grfCommitFlags);
}
static FORCEINLINE HRESULT ISpStreamFormatConverter_Revert(ISpStreamFormatConverter* This) {
    return This->lpVtbl->Revert(This);
}
static FORCEINLINE HRESULT ISpStreamFormatConverter_LockRegion(ISpStreamFormatConverter* This,ULARGE_INTEGER libOffset,ULARGE_INTEGER cb,DWORD dwLockType) {
    return This->lpVtbl->LockRegion(This,libOffset,cb,dwLockType);
}
static FORCEINLINE HRESULT ISpStreamFormatConverter_UnlockRegion(ISpStreamFormatConverter* This,ULARGE_INTEGER libOffset,ULARGE_INTEGER cb,DWORD dwLockType) {
    return This->lpVtbl->UnlockRegion(This,libOffset,cb,dwLockType);
}
static FORCEINLINE HRESULT ISpStreamFormatConverter_Stat(ISpStreamFormatConverter* This,STATSTG *pstatstg,DWORD grfStatFlag) {
    return This->lpVtbl->Stat(This,pstatstg,grfStatFlag);
}
static FORCEINLINE HRESULT ISpStreamFormatConverter_Clone(ISpStreamFormatConverter* This,IStream **ppstm) {
    return This->lpVtbl->Clone(This,ppstm);
}
/*** ISpStreamFormat methods ***/
static FORCEINLINE HRESULT ISpStreamFormatConverter_GetFormat(ISpStreamFormatConverter* This,GUID *pguidFormatId,WAVEFORMATEX **ppCoMemWaveFormatEx) {
    return This->lpVtbl->GetFormat(This,pguidFormatId,ppCoMemWaveFormatEx);
}
/*** ISpStreamFormatConverter methods ***/
static FORCEINLINE HRESULT ISpStreamFormatConverter_SetBaseStream(ISpStreamFormatConverter* This,ISpStreamFormat *pStream,WINBOOL fSetFormatToBaseStreamFormat,WINBOOL fWriteToBaseStream) {
    return This->lpVtbl->SetBaseStream(This,pStream,fSetFormatToBaseStreamFormat,fWriteToBaseStream);
}
static FORCEINLINE HRESULT ISpStreamFormatConverter_GetBaseStream(ISpStreamFormatConverter* This,ISpStreamFormat **ppStream) {
    return This->lpVtbl->GetBaseStream(This,ppStream);
}
static FORCEINLINE HRESULT ISpStreamFormatConverter_SetFormat(ISpStreamFormatConverter* This,REFGUID rguidFormatIdOfConvertedStream,const WAVEFORMATEX *pWaveFormatExOfConvertedStream) {
    return This->lpVtbl->SetFormat(This,rguidFormatIdOfConvertedStream,pWaveFormatExOfConvertedStream);
}
static FORCEINLINE HRESULT ISpStreamFormatConverter_ResetSeekPosition(ISpStreamFormatConverter* This) {
    return This->lpVtbl->ResetSeekPosition(This);
}
static FORCEINLINE HRESULT ISpStreamFormatConverter_ScaleConvertedToBaseOffset(ISpStreamFormatConverter* This,ULONGLONG ullOffsetConvertedStream,ULONGLONG *pullOffsetBaseStream) {
    return This->lpVtbl->ScaleConvertedToBaseOffset(This,ullOffsetConvertedStream,pullOffsetBaseStream);
}
static FORCEINLINE HRESULT ISpStreamFormatConverter_ScaleBaseToConvertedOffset(ISpStreamFormatConverter* This,ULONGLONG ullOffsetBaseStream,ULONGLONG *pullOffsetConvertedStream) {
    return This->lpVtbl->ScaleBaseToConvertedOffset(This,ullOffsetBaseStream,pullOffsetConvertedStream);
}
#endif
#endif

#endif


#endif  /* __ISpStreamFormatConverter_INTERFACE_DEFINED__ */

typedef struct SPAUDIOSTATUS {
    LONG cbFreeBuffSpace;
    ULONG cbNonBlockingIO;
    SPAUDIOSTATE State;
    ULONGLONG CurSeekPos;
    ULONGLONG CurDevicePos;
    DWORD dwAudioLevel;
    DWORD dwReserved2;
} SPAUDIOSTATUS;
typedef struct SPAUDIOBUFFERINFO {
    ULONG ulMsMinNotification;
    ULONG ulMsBufferSize;
    ULONG ulMsEventBias;
} SPAUDIOBUFFERINFO;
/*****************************************************************************
 * ISpAudio interface
 */
#ifndef __ISpAudio_INTERFACE_DEFINED__
#define __ISpAudio_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpAudio, 0xc05c768f, 0xfae8, 0x4ec2, 0x8e,0x07, 0x33,0x83,0x21,0xc1,0x24,0x52);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("c05c768f-fae8-4ec2-8e07-338321c12452")
ISpAudio : public ISpStreamFormat
{
    virtual HRESULT STDMETHODCALLTYPE SetState(
        SPAUDIOSTATE NewState,
        ULONGLONG ullReserved) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetFormat(
        REFGUID rguidFmtId,
        const WAVEFORMATEX *pWaveFormatEx) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetStatus(
        SPAUDIOSTATUS *pStatus) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetBufferInfo(
        const SPAUDIOBUFFERINFO *pBuffInfo) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetBufferInfo(
        SPAUDIOBUFFERINFO *pBuffInfo) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetDefaultFormat(
        GUID *pFormatId,
        WAVEFORMATEX **ppCoMemWaveFormatEx) = 0;

    virtual HANDLE STDMETHODCALLTYPE EventHandle(
        ) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetVolumeLevel(
        ULONG *pLevel) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetVolumeLevel(
        ULONG Level) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetBufferNotifySize(
        ULONG *pcbSize) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetBufferNotifySize(
        ULONG cbSize) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpAudio, 0xc05c768f, 0xfae8, 0x4ec2, 0x8e,0x07, 0x33,0x83,0x21,0xc1,0x24,0x52)
#endif
#else
typedef struct ISpAudioVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpAudio *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpAudio *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpAudio *This);

    /*** ISequentialStream methods ***/
    HRESULT (STDMETHODCALLTYPE *Read)(
        ISpAudio *This,
        void *pv,
        ULONG cb,
        ULONG *pcbRead);

    HRESULT (STDMETHODCALLTYPE *Write)(
        ISpAudio *This,
        const void *pv,
        ULONG cb,
        ULONG *pcbWritten);

    /*** IStream methods ***/
    HRESULT (STDMETHODCALLTYPE *Seek)(
        ISpAudio *This,
        LARGE_INTEGER dlibMove,
        DWORD dwOrigin,
        ULARGE_INTEGER *plibNewPosition);

    HRESULT (STDMETHODCALLTYPE *SetSize)(
        ISpAudio *This,
        ULARGE_INTEGER libNewSize);

    HRESULT (STDMETHODCALLTYPE *CopyTo)(
        ISpAudio *This,
        IStream *pstm,
        ULARGE_INTEGER cb,
        ULARGE_INTEGER *pcbRead,
        ULARGE_INTEGER *pcbWritten);

    HRESULT (STDMETHODCALLTYPE *Commit)(
        ISpAudio *This,
        DWORD grfCommitFlags);

    HRESULT (STDMETHODCALLTYPE *Revert)(
        ISpAudio *This);

    HRESULT (STDMETHODCALLTYPE *LockRegion)(
        ISpAudio *This,
        ULARGE_INTEGER libOffset,
        ULARGE_INTEGER cb,
        DWORD dwLockType);

    HRESULT (STDMETHODCALLTYPE *UnlockRegion)(
        ISpAudio *This,
        ULARGE_INTEGER libOffset,
        ULARGE_INTEGER cb,
        DWORD dwLockType);

    HRESULT (STDMETHODCALLTYPE *Stat)(
        ISpAudio *This,
        STATSTG *pstatstg,
        DWORD grfStatFlag);

    HRESULT (STDMETHODCALLTYPE *Clone)(
        ISpAudio *This,
        IStream **ppstm);

    /*** ISpStreamFormat methods ***/
    HRESULT (STDMETHODCALLTYPE *GetFormat)(
        ISpAudio *This,
        GUID *pguidFormatId,
        WAVEFORMATEX **ppCoMemWaveFormatEx);

    /*** ISpAudio methods ***/
    HRESULT (STDMETHODCALLTYPE *SetState)(
        ISpAudio *This,
        SPAUDIOSTATE NewState,
        ULONGLONG ullReserved);

    HRESULT (STDMETHODCALLTYPE *SetFormat)(
        ISpAudio *This,
        REFGUID rguidFmtId,
        const WAVEFORMATEX *pWaveFormatEx);

    HRESULT (STDMETHODCALLTYPE *GetStatus)(
        ISpAudio *This,
        SPAUDIOSTATUS *pStatus);

    HRESULT (STDMETHODCALLTYPE *SetBufferInfo)(
        ISpAudio *This,
        const SPAUDIOBUFFERINFO *pBuffInfo);

    HRESULT (STDMETHODCALLTYPE *GetBufferInfo)(
        ISpAudio *This,
        SPAUDIOBUFFERINFO *pBuffInfo);

    HRESULT (STDMETHODCALLTYPE *GetDefaultFormat)(
        ISpAudio *This,
        GUID *pFormatId,
        WAVEFORMATEX **ppCoMemWaveFormatEx);

    HANDLE (STDMETHODCALLTYPE *EventHandle)(
        ISpAudio *This);

    HRESULT (STDMETHODCALLTYPE *GetVolumeLevel)(
        ISpAudio *This,
        ULONG *pLevel);

    HRESULT (STDMETHODCALLTYPE *SetVolumeLevel)(
        ISpAudio *This,
        ULONG Level);

    HRESULT (STDMETHODCALLTYPE *GetBufferNotifySize)(
        ISpAudio *This,
        ULONG *pcbSize);

    HRESULT (STDMETHODCALLTYPE *SetBufferNotifySize)(
        ISpAudio *This,
        ULONG cbSize);

    END_INTERFACE
} ISpAudioVtbl;

interface ISpAudio {
    CONST_VTBL ISpAudioVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpAudio_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpAudio_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpAudio_Release(This) (This)->lpVtbl->Release(This)
/*** ISequentialStream methods ***/
#define ISpAudio_Read(This,pv,cb,pcbRead) (This)->lpVtbl->Read(This,pv,cb,pcbRead)
#define ISpAudio_Write(This,pv,cb,pcbWritten) (This)->lpVtbl->Write(This,pv,cb,pcbWritten)
/*** IStream methods ***/
#define ISpAudio_Seek(This,dlibMove,dwOrigin,plibNewPosition) (This)->lpVtbl->Seek(This,dlibMove,dwOrigin,plibNewPosition)
#define ISpAudio_SetSize(This,libNewSize) (This)->lpVtbl->SetSize(This,libNewSize)
#define ISpAudio_CopyTo(This,pstm,cb,pcbRead,pcbWritten) (This)->lpVtbl->CopyTo(This,pstm,cb,pcbRead,pcbWritten)
#define ISpAudio_Commit(This,grfCommitFlags) (This)->lpVtbl->Commit(This,grfCommitFlags)
#define ISpAudio_Revert(This) (This)->lpVtbl->Revert(This)
#define ISpAudio_LockRegion(This,libOffset,cb,dwLockType) (This)->lpVtbl->LockRegion(This,libOffset,cb,dwLockType)
#define ISpAudio_UnlockRegion(This,libOffset,cb,dwLockType) (This)->lpVtbl->UnlockRegion(This,libOffset,cb,dwLockType)
#define ISpAudio_Stat(This,pstatstg,grfStatFlag) (This)->lpVtbl->Stat(This,pstatstg,grfStatFlag)
#define ISpAudio_Clone(This,ppstm) (This)->lpVtbl->Clone(This,ppstm)
/*** ISpStreamFormat methods ***/
#define ISpAudio_GetFormat(This,pguidFormatId,ppCoMemWaveFormatEx) (This)->lpVtbl->GetFormat(This,pguidFormatId,ppCoMemWaveFormatEx)
/*** ISpAudio methods ***/
#define ISpAudio_SetState(This,NewState,ullReserved) (This)->lpVtbl->SetState(This,NewState,ullReserved)
#define ISpAudio_SetFormat(This,rguidFmtId,pWaveFormatEx) (This)->lpVtbl->SetFormat(This,rguidFmtId,pWaveFormatEx)
#define ISpAudio_GetStatus(This,pStatus) (This)->lpVtbl->GetStatus(This,pStatus)
#define ISpAudio_SetBufferInfo(This,pBuffInfo) (This)->lpVtbl->SetBufferInfo(This,pBuffInfo)
#define ISpAudio_GetBufferInfo(This,pBuffInfo) (This)->lpVtbl->GetBufferInfo(This,pBuffInfo)
#define ISpAudio_GetDefaultFormat(This,pFormatId,ppCoMemWaveFormatEx) (This)->lpVtbl->GetDefaultFormat(This,pFormatId,ppCoMemWaveFormatEx)
#define ISpAudio_EventHandle(This) (This)->lpVtbl->EventHandle(This)
#define ISpAudio_GetVolumeLevel(This,pLevel) (This)->lpVtbl->GetVolumeLevel(This,pLevel)
#define ISpAudio_SetVolumeLevel(This,Level) (This)->lpVtbl->SetVolumeLevel(This,Level)
#define ISpAudio_GetBufferNotifySize(This,pcbSize) (This)->lpVtbl->GetBufferNotifySize(This,pcbSize)
#define ISpAudio_SetBufferNotifySize(This,cbSize) (This)->lpVtbl->SetBufferNotifySize(This,cbSize)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpAudio_QueryInterface(ISpAudio* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpAudio_AddRef(ISpAudio* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpAudio_Release(ISpAudio* This) {
    return This->lpVtbl->Release(This);
}
/*** ISequentialStream methods ***/
static FORCEINLINE HRESULT ISpAudio_Read(ISpAudio* This,void *pv,ULONG cb,ULONG *pcbRead) {
    return This->lpVtbl->Read(This,pv,cb,pcbRead);
}
static FORCEINLINE HRESULT ISpAudio_Write(ISpAudio* This,const void *pv,ULONG cb,ULONG *pcbWritten) {
    return This->lpVtbl->Write(This,pv,cb,pcbWritten);
}
/*** IStream methods ***/
static FORCEINLINE HRESULT ISpAudio_Seek(ISpAudio* This,LARGE_INTEGER dlibMove,DWORD dwOrigin,ULARGE_INTEGER *plibNewPosition) {
    return This->lpVtbl->Seek(This,dlibMove,dwOrigin,plibNewPosition);
}
static FORCEINLINE HRESULT ISpAudio_SetSize(ISpAudio* This,ULARGE_INTEGER libNewSize) {
    return This->lpVtbl->SetSize(This,libNewSize);
}
static FORCEINLINE HRESULT ISpAudio_CopyTo(ISpAudio* This,IStream *pstm,ULARGE_INTEGER cb,ULARGE_INTEGER *pcbRead,ULARGE_INTEGER *pcbWritten) {
    return This->lpVtbl->CopyTo(This,pstm,cb,pcbRead,pcbWritten);
}
static FORCEINLINE HRESULT ISpAudio_Commit(ISpAudio* This,DWORD grfCommitFlags) {
    return This->lpVtbl->Commit(This,grfCommitFlags);
}
static FORCEINLINE HRESULT ISpAudio_Revert(ISpAudio* This) {
    return This->lpVtbl->Revert(This);
}
static FORCEINLINE HRESULT ISpAudio_LockRegion(ISpAudio* This,ULARGE_INTEGER libOffset,ULARGE_INTEGER cb,DWORD dwLockType) {
    return This->lpVtbl->LockRegion(This,libOffset,cb,dwLockType);
}
static FORCEINLINE HRESULT ISpAudio_UnlockRegion(ISpAudio* This,ULARGE_INTEGER libOffset,ULARGE_INTEGER cb,DWORD dwLockType) {
    return This->lpVtbl->UnlockRegion(This,libOffset,cb,dwLockType);
}
static FORCEINLINE HRESULT ISpAudio_Stat(ISpAudio* This,STATSTG *pstatstg,DWORD grfStatFlag) {
    return This->lpVtbl->Stat(This,pstatstg,grfStatFlag);
}
static FORCEINLINE HRESULT ISpAudio_Clone(ISpAudio* This,IStream **ppstm) {
    return This->lpVtbl->Clone(This,ppstm);
}
/*** ISpStreamFormat methods ***/
static FORCEINLINE HRESULT ISpAudio_GetFormat(ISpAudio* This,GUID *pguidFormatId,WAVEFORMATEX **ppCoMemWaveFormatEx) {
    return This->lpVtbl->GetFormat(This,pguidFormatId,ppCoMemWaveFormatEx);
}
/*** ISpAudio methods ***/
static FORCEINLINE HRESULT ISpAudio_SetState(ISpAudio* This,SPAUDIOSTATE NewState,ULONGLONG ullReserved) {
    return This->lpVtbl->SetState(This,NewState,ullReserved);
}
static FORCEINLINE HRESULT ISpAudio_SetFormat(ISpAudio* This,REFGUID rguidFmtId,const WAVEFORMATEX *pWaveFormatEx) {
    return This->lpVtbl->SetFormat(This,rguidFmtId,pWaveFormatEx);
}
static FORCEINLINE HRESULT ISpAudio_GetStatus(ISpAudio* This,SPAUDIOSTATUS *pStatus) {
    return This->lpVtbl->GetStatus(This,pStatus);
}
static FORCEINLINE HRESULT ISpAudio_SetBufferInfo(ISpAudio* This,const SPAUDIOBUFFERINFO *pBuffInfo) {
    return This->lpVtbl->SetBufferInfo(This,pBuffInfo);
}
static FORCEINLINE HRESULT ISpAudio_GetBufferInfo(ISpAudio* This,SPAUDIOBUFFERINFO *pBuffInfo) {
    return This->lpVtbl->GetBufferInfo(This,pBuffInfo);
}
static FORCEINLINE HRESULT ISpAudio_GetDefaultFormat(ISpAudio* This,GUID *pFormatId,WAVEFORMATEX **ppCoMemWaveFormatEx) {
    return This->lpVtbl->GetDefaultFormat(This,pFormatId,ppCoMemWaveFormatEx);
}
static FORCEINLINE HANDLE ISpAudio_EventHandle(ISpAudio* This) {
    return This->lpVtbl->EventHandle(This);
}
static FORCEINLINE HRESULT ISpAudio_GetVolumeLevel(ISpAudio* This,ULONG *pLevel) {
    return This->lpVtbl->GetVolumeLevel(This,pLevel);
}
static FORCEINLINE HRESULT ISpAudio_SetVolumeLevel(ISpAudio* This,ULONG Level) {
    return This->lpVtbl->SetVolumeLevel(This,Level);
}
static FORCEINLINE HRESULT ISpAudio_GetBufferNotifySize(ISpAudio* This,ULONG *pcbSize) {
    return This->lpVtbl->GetBufferNotifySize(This,pcbSize);
}
static FORCEINLINE HRESULT ISpAudio_SetBufferNotifySize(ISpAudio* This,ULONG cbSize) {
    return This->lpVtbl->SetBufferNotifySize(This,cbSize);
}
#endif
#endif

#endif


#endif  /* __ISpAudio_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpMMSysAudio interface
 */
#ifndef __ISpMMSysAudio_INTERFACE_DEFINED__
#define __ISpMMSysAudio_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpMMSysAudio, 0x15806f6e, 0x1d70, 0x4b48, 0x98,0xe6, 0x3b,0x1a,0x00,0x75,0x09,0xab);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("15806f6e-1d70-4b48-98e6-3b1a007509ab")
ISpMMSysAudio : public ISpAudio
{
    virtual HRESULT STDMETHODCALLTYPE GetDeviceId(
        UINT *puDeviceId) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetDeviceId(
        UINT uDeviceId) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetMMHandle(
        void **pHandle) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetLineId(
        UINT *puLineId) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetLineId(
        UINT uLineId) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpMMSysAudio, 0x15806f6e, 0x1d70, 0x4b48, 0x98,0xe6, 0x3b,0x1a,0x00,0x75,0x09,0xab)
#endif
#else
typedef struct ISpMMSysAudioVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpMMSysAudio *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpMMSysAudio *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpMMSysAudio *This);

    /*** ISequentialStream methods ***/
    HRESULT (STDMETHODCALLTYPE *Read)(
        ISpMMSysAudio *This,
        void *pv,
        ULONG cb,
        ULONG *pcbRead);

    HRESULT (STDMETHODCALLTYPE *Write)(
        ISpMMSysAudio *This,
        const void *pv,
        ULONG cb,
        ULONG *pcbWritten);

    /*** IStream methods ***/
    HRESULT (STDMETHODCALLTYPE *Seek)(
        ISpMMSysAudio *This,
        LARGE_INTEGER dlibMove,
        DWORD dwOrigin,
        ULARGE_INTEGER *plibNewPosition);

    HRESULT (STDMETHODCALLTYPE *SetSize)(
        ISpMMSysAudio *This,
        ULARGE_INTEGER libNewSize);

    HRESULT (STDMETHODCALLTYPE *CopyTo)(
        ISpMMSysAudio *This,
        IStream *pstm,
        ULARGE_INTEGER cb,
        ULARGE_INTEGER *pcbRead,
        ULARGE_INTEGER *pcbWritten);

    HRESULT (STDMETHODCALLTYPE *Commit)(
        ISpMMSysAudio *This,
        DWORD grfCommitFlags);

    HRESULT (STDMETHODCALLTYPE *Revert)(
        ISpMMSysAudio *This);

    HRESULT (STDMETHODCALLTYPE *LockRegion)(
        ISpMMSysAudio *This,
        ULARGE_INTEGER libOffset,
        ULARGE_INTEGER cb,
        DWORD dwLockType);

    HRESULT (STDMETHODCALLTYPE *UnlockRegion)(
        ISpMMSysAudio *This,
        ULARGE_INTEGER libOffset,
        ULARGE_INTEGER cb,
        DWORD dwLockType);

    HRESULT (STDMETHODCALLTYPE *Stat)(
        ISpMMSysAudio *This,
        STATSTG *pstatstg,
        DWORD grfStatFlag);

    HRESULT (STDMETHODCALLTYPE *Clone)(
        ISpMMSysAudio *This,
        IStream **ppstm);

    /*** ISpStreamFormat methods ***/
    HRESULT (STDMETHODCALLTYPE *GetFormat)(
        ISpMMSysAudio *This,
        GUID *pguidFormatId,
        WAVEFORMATEX **ppCoMemWaveFormatEx);

    /*** ISpAudio methods ***/
    HRESULT (STDMETHODCALLTYPE *SetState)(
        ISpMMSysAudio *This,
        SPAUDIOSTATE NewState,
        ULONGLONG ullReserved);

    HRESULT (STDMETHODCALLTYPE *SetFormat)(
        ISpMMSysAudio *This,
        REFGUID rguidFmtId,
        const WAVEFORMATEX *pWaveFormatEx);

    HRESULT (STDMETHODCALLTYPE *GetStatus)(
        ISpMMSysAudio *This,
        SPAUDIOSTATUS *pStatus);

    HRESULT (STDMETHODCALLTYPE *SetBufferInfo)(
        ISpMMSysAudio *This,
        const SPAUDIOBUFFERINFO *pBuffInfo);

    HRESULT (STDMETHODCALLTYPE *GetBufferInfo)(
        ISpMMSysAudio *This,
        SPAUDIOBUFFERINFO *pBuffInfo);

    HRESULT (STDMETHODCALLTYPE *GetDefaultFormat)(
        ISpMMSysAudio *This,
        GUID *pFormatId,
        WAVEFORMATEX **ppCoMemWaveFormatEx);

    HANDLE (STDMETHODCALLTYPE *EventHandle)(
        ISpMMSysAudio *This);

    HRESULT (STDMETHODCALLTYPE *GetVolumeLevel)(
        ISpMMSysAudio *This,
        ULONG *pLevel);

    HRESULT (STDMETHODCALLTYPE *SetVolumeLevel)(
        ISpMMSysAudio *This,
        ULONG Level);

    HRESULT (STDMETHODCALLTYPE *GetBufferNotifySize)(
        ISpMMSysAudio *This,
        ULONG *pcbSize);

    HRESULT (STDMETHODCALLTYPE *SetBufferNotifySize)(
        ISpMMSysAudio *This,
        ULONG cbSize);

    /*** ISpMMSysAudio methods ***/
    HRESULT (STDMETHODCALLTYPE *GetDeviceId)(
        ISpMMSysAudio *This,
        UINT *puDeviceId);

    HRESULT (STDMETHODCALLTYPE *SetDeviceId)(
        ISpMMSysAudio *This,
        UINT uDeviceId);

    HRESULT (STDMETHODCALLTYPE *GetMMHandle)(
        ISpMMSysAudio *This,
        void **pHandle);

    HRESULT (STDMETHODCALLTYPE *GetLineId)(
        ISpMMSysAudio *This,
        UINT *puLineId);

    HRESULT (STDMETHODCALLTYPE *SetLineId)(
        ISpMMSysAudio *This,
        UINT uLineId);

    END_INTERFACE
} ISpMMSysAudioVtbl;

interface ISpMMSysAudio {
    CONST_VTBL ISpMMSysAudioVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpMMSysAudio_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpMMSysAudio_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpMMSysAudio_Release(This) (This)->lpVtbl->Release(This)
/*** ISequentialStream methods ***/
#define ISpMMSysAudio_Read(This,pv,cb,pcbRead) (This)->lpVtbl->Read(This,pv,cb,pcbRead)
#define ISpMMSysAudio_Write(This,pv,cb,pcbWritten) (This)->lpVtbl->Write(This,pv,cb,pcbWritten)
/*** IStream methods ***/
#define ISpMMSysAudio_Seek(This,dlibMove,dwOrigin,plibNewPosition) (This)->lpVtbl->Seek(This,dlibMove,dwOrigin,plibNewPosition)
#define ISpMMSysAudio_SetSize(This,libNewSize) (This)->lpVtbl->SetSize(This,libNewSize)
#define ISpMMSysAudio_CopyTo(This,pstm,cb,pcbRead,pcbWritten) (This)->lpVtbl->CopyTo(This,pstm,cb,pcbRead,pcbWritten)
#define ISpMMSysAudio_Commit(This,grfCommitFlags) (This)->lpVtbl->Commit(This,grfCommitFlags)
#define ISpMMSysAudio_Revert(This) (This)->lpVtbl->Revert(This)
#define ISpMMSysAudio_LockRegion(This,libOffset,cb,dwLockType) (This)->lpVtbl->LockRegion(This,libOffset,cb,dwLockType)
#define ISpMMSysAudio_UnlockRegion(This,libOffset,cb,dwLockType) (This)->lpVtbl->UnlockRegion(This,libOffset,cb,dwLockType)
#define ISpMMSysAudio_Stat(This,pstatstg,grfStatFlag) (This)->lpVtbl->Stat(This,pstatstg,grfStatFlag)
#define ISpMMSysAudio_Clone(This,ppstm) (This)->lpVtbl->Clone(This,ppstm)
/*** ISpStreamFormat methods ***/
#define ISpMMSysAudio_GetFormat(This,pguidFormatId,ppCoMemWaveFormatEx) (This)->lpVtbl->GetFormat(This,pguidFormatId,ppCoMemWaveFormatEx)
/*** ISpAudio methods ***/
#define ISpMMSysAudio_SetState(This,NewState,ullReserved) (This)->lpVtbl->SetState(This,NewState,ullReserved)
#define ISpMMSysAudio_SetFormat(This,rguidFmtId,pWaveFormatEx) (This)->lpVtbl->SetFormat(This,rguidFmtId,pWaveFormatEx)
#define ISpMMSysAudio_GetStatus(This,pStatus) (This)->lpVtbl->GetStatus(This,pStatus)
#define ISpMMSysAudio_SetBufferInfo(This,pBuffInfo) (This)->lpVtbl->SetBufferInfo(This,pBuffInfo)
#define ISpMMSysAudio_GetBufferInfo(This,pBuffInfo) (This)->lpVtbl->GetBufferInfo(This,pBuffInfo)
#define ISpMMSysAudio_GetDefaultFormat(This,pFormatId,ppCoMemWaveFormatEx) (This)->lpVtbl->GetDefaultFormat(This,pFormatId,ppCoMemWaveFormatEx)
#define ISpMMSysAudio_EventHandle(This) (This)->lpVtbl->EventHandle(This)
#define ISpMMSysAudio_GetVolumeLevel(This,pLevel) (This)->lpVtbl->GetVolumeLevel(This,pLevel)
#define ISpMMSysAudio_SetVolumeLevel(This,Level) (This)->lpVtbl->SetVolumeLevel(This,Level)
#define ISpMMSysAudio_GetBufferNotifySize(This,pcbSize) (This)->lpVtbl->GetBufferNotifySize(This,pcbSize)
#define ISpMMSysAudio_SetBufferNotifySize(This,cbSize) (This)->lpVtbl->SetBufferNotifySize(This,cbSize)
/*** ISpMMSysAudio methods ***/
#define ISpMMSysAudio_GetDeviceId(This,puDeviceId) (This)->lpVtbl->GetDeviceId(This,puDeviceId)
#define ISpMMSysAudio_SetDeviceId(This,uDeviceId) (This)->lpVtbl->SetDeviceId(This,uDeviceId)
#define ISpMMSysAudio_GetMMHandle(This,pHandle) (This)->lpVtbl->GetMMHandle(This,pHandle)
#define ISpMMSysAudio_GetLineId(This,puLineId) (This)->lpVtbl->GetLineId(This,puLineId)
#define ISpMMSysAudio_SetLineId(This,uLineId) (This)->lpVtbl->SetLineId(This,uLineId)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpMMSysAudio_QueryInterface(ISpMMSysAudio* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpMMSysAudio_AddRef(ISpMMSysAudio* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpMMSysAudio_Release(ISpMMSysAudio* This) {
    return This->lpVtbl->Release(This);
}
/*** ISequentialStream methods ***/
static FORCEINLINE HRESULT ISpMMSysAudio_Read(ISpMMSysAudio* This,void *pv,ULONG cb,ULONG *pcbRead) {
    return This->lpVtbl->Read(This,pv,cb,pcbRead);
}
static FORCEINLINE HRESULT ISpMMSysAudio_Write(ISpMMSysAudio* This,const void *pv,ULONG cb,ULONG *pcbWritten) {
    return This->lpVtbl->Write(This,pv,cb,pcbWritten);
}
/*** IStream methods ***/
static FORCEINLINE HRESULT ISpMMSysAudio_Seek(ISpMMSysAudio* This,LARGE_INTEGER dlibMove,DWORD dwOrigin,ULARGE_INTEGER *plibNewPosition) {
    return This->lpVtbl->Seek(This,dlibMove,dwOrigin,plibNewPosition);
}
static FORCEINLINE HRESULT ISpMMSysAudio_SetSize(ISpMMSysAudio* This,ULARGE_INTEGER libNewSize) {
    return This->lpVtbl->SetSize(This,libNewSize);
}
static FORCEINLINE HRESULT ISpMMSysAudio_CopyTo(ISpMMSysAudio* This,IStream *pstm,ULARGE_INTEGER cb,ULARGE_INTEGER *pcbRead,ULARGE_INTEGER *pcbWritten) {
    return This->lpVtbl->CopyTo(This,pstm,cb,pcbRead,pcbWritten);
}
static FORCEINLINE HRESULT ISpMMSysAudio_Commit(ISpMMSysAudio* This,DWORD grfCommitFlags) {
    return This->lpVtbl->Commit(This,grfCommitFlags);
}
static FORCEINLINE HRESULT ISpMMSysAudio_Revert(ISpMMSysAudio* This) {
    return This->lpVtbl->Revert(This);
}
static FORCEINLINE HRESULT ISpMMSysAudio_LockRegion(ISpMMSysAudio* This,ULARGE_INTEGER libOffset,ULARGE_INTEGER cb,DWORD dwLockType) {
    return This->lpVtbl->LockRegion(This,libOffset,cb,dwLockType);
}
static FORCEINLINE HRESULT ISpMMSysAudio_UnlockRegion(ISpMMSysAudio* This,ULARGE_INTEGER libOffset,ULARGE_INTEGER cb,DWORD dwLockType) {
    return This->lpVtbl->UnlockRegion(This,libOffset,cb,dwLockType);
}
static FORCEINLINE HRESULT ISpMMSysAudio_Stat(ISpMMSysAudio* This,STATSTG *pstatstg,DWORD grfStatFlag) {
    return This->lpVtbl->Stat(This,pstatstg,grfStatFlag);
}
static FORCEINLINE HRESULT ISpMMSysAudio_Clone(ISpMMSysAudio* This,IStream **ppstm) {
    return This->lpVtbl->Clone(This,ppstm);
}
/*** ISpStreamFormat methods ***/
static FORCEINLINE HRESULT ISpMMSysAudio_GetFormat(ISpMMSysAudio* This,GUID *pguidFormatId,WAVEFORMATEX **ppCoMemWaveFormatEx) {
    return This->lpVtbl->GetFormat(This,pguidFormatId,ppCoMemWaveFormatEx);
}
/*** ISpAudio methods ***/
static FORCEINLINE HRESULT ISpMMSysAudio_SetState(ISpMMSysAudio* This,SPAUDIOSTATE NewState,ULONGLONG ullReserved) {
    return This->lpVtbl->SetState(This,NewState,ullReserved);
}
static FORCEINLINE HRESULT ISpMMSysAudio_SetFormat(ISpMMSysAudio* This,REFGUID rguidFmtId,const WAVEFORMATEX *pWaveFormatEx) {
    return This->lpVtbl->SetFormat(This,rguidFmtId,pWaveFormatEx);
}
static FORCEINLINE HRESULT ISpMMSysAudio_GetStatus(ISpMMSysAudio* This,SPAUDIOSTATUS *pStatus) {
    return This->lpVtbl->GetStatus(This,pStatus);
}
static FORCEINLINE HRESULT ISpMMSysAudio_SetBufferInfo(ISpMMSysAudio* This,const SPAUDIOBUFFERINFO *pBuffInfo) {
    return This->lpVtbl->SetBufferInfo(This,pBuffInfo);
}
static FORCEINLINE HRESULT ISpMMSysAudio_GetBufferInfo(ISpMMSysAudio* This,SPAUDIOBUFFERINFO *pBuffInfo) {
    return This->lpVtbl->GetBufferInfo(This,pBuffInfo);
}
static FORCEINLINE HRESULT ISpMMSysAudio_GetDefaultFormat(ISpMMSysAudio* This,GUID *pFormatId,WAVEFORMATEX **ppCoMemWaveFormatEx) {
    return This->lpVtbl->GetDefaultFormat(This,pFormatId,ppCoMemWaveFormatEx);
}
static FORCEINLINE HANDLE ISpMMSysAudio_EventHandle(ISpMMSysAudio* This) {
    return This->lpVtbl->EventHandle(This);
}
static FORCEINLINE HRESULT ISpMMSysAudio_GetVolumeLevel(ISpMMSysAudio* This,ULONG *pLevel) {
    return This->lpVtbl->GetVolumeLevel(This,pLevel);
}
static FORCEINLINE HRESULT ISpMMSysAudio_SetVolumeLevel(ISpMMSysAudio* This,ULONG Level) {
    return This->lpVtbl->SetVolumeLevel(This,Level);
}
static FORCEINLINE HRESULT ISpMMSysAudio_GetBufferNotifySize(ISpMMSysAudio* This,ULONG *pcbSize) {
    return This->lpVtbl->GetBufferNotifySize(This,pcbSize);
}
static FORCEINLINE HRESULT ISpMMSysAudio_SetBufferNotifySize(ISpMMSysAudio* This,ULONG cbSize) {
    return This->lpVtbl->SetBufferNotifySize(This,cbSize);
}
/*** ISpMMSysAudio methods ***/
static FORCEINLINE HRESULT ISpMMSysAudio_GetDeviceId(ISpMMSysAudio* This,UINT *puDeviceId) {
    return This->lpVtbl->GetDeviceId(This,puDeviceId);
}
static FORCEINLINE HRESULT ISpMMSysAudio_SetDeviceId(ISpMMSysAudio* This,UINT uDeviceId) {
    return This->lpVtbl->SetDeviceId(This,uDeviceId);
}
static FORCEINLINE HRESULT ISpMMSysAudio_GetMMHandle(ISpMMSysAudio* This,void **pHandle) {
    return This->lpVtbl->GetMMHandle(This,pHandle);
}
static FORCEINLINE HRESULT ISpMMSysAudio_GetLineId(ISpMMSysAudio* This,UINT *puLineId) {
    return This->lpVtbl->GetLineId(This,puLineId);
}
static FORCEINLINE HRESULT ISpMMSysAudio_SetLineId(ISpMMSysAudio* This,UINT uLineId) {
    return This->lpVtbl->SetLineId(This,uLineId);
}
#endif
#endif

#endif


#endif  /* __ISpMMSysAudio_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpTranscript interface
 */
#ifndef __ISpTranscript_INTERFACE_DEFINED__
#define __ISpTranscript_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpTranscript, 0x10f63bce, 0x201a, 0x11d3, 0xac,0x70, 0x00,0xc0,0x4f,0x8e,0xe6,0xc0);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("10f63bce-201a-11d3-ac70-00c04f8ee6c0")
ISpTranscript : public IUnknown
{
    virtual HRESULT STDMETHODCALLTYPE GetTranscript(
        LPWSTR *ppszTranscript) = 0;

    virtual HRESULT STDMETHODCALLTYPE AppendTranscript(
        LPCWSTR pszTranscript) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpTranscript, 0x10f63bce, 0x201a, 0x11d3, 0xac,0x70, 0x00,0xc0,0x4f,0x8e,0xe6,0xc0)
#endif
#else
typedef struct ISpTranscriptVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpTranscript *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpTranscript *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpTranscript *This);

    /*** ISpTranscript methods ***/
    HRESULT (STDMETHODCALLTYPE *GetTranscript)(
        ISpTranscript *This,
        LPWSTR *ppszTranscript);

    HRESULT (STDMETHODCALLTYPE *AppendTranscript)(
        ISpTranscript *This,
        LPCWSTR pszTranscript);

    END_INTERFACE
} ISpTranscriptVtbl;

interface ISpTranscript {
    CONST_VTBL ISpTranscriptVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpTranscript_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpTranscript_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpTranscript_Release(This) (This)->lpVtbl->Release(This)
/*** ISpTranscript methods ***/
#define ISpTranscript_GetTranscript(This,ppszTranscript) (This)->lpVtbl->GetTranscript(This,ppszTranscript)
#define ISpTranscript_AppendTranscript(This,pszTranscript) (This)->lpVtbl->AppendTranscript(This,pszTranscript)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpTranscript_QueryInterface(ISpTranscript* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpTranscript_AddRef(ISpTranscript* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpTranscript_Release(ISpTranscript* This) {
    return This->lpVtbl->Release(This);
}
/*** ISpTranscript methods ***/
static FORCEINLINE HRESULT ISpTranscript_GetTranscript(ISpTranscript* This,LPWSTR *ppszTranscript) {
    return This->lpVtbl->GetTranscript(This,ppszTranscript);
}
static FORCEINLINE HRESULT ISpTranscript_AppendTranscript(ISpTranscript* This,LPCWSTR pszTranscript) {
    return This->lpVtbl->AppendTranscript(This,pszTranscript);
}
#endif
#endif

#endif


#endif  /* __ISpTranscript_INTERFACE_DEFINED__ */

typedef WCHAR SPPHONEID;
typedef LPWSTR PSPPHONEID;
typedef LPCWSTR PCSPPHONEID;
typedef struct SPPHRASEELEMENT {
    ULONG ulAudioTimeOffset;
    ULONG ulAudioSizeTime;
    ULONG ulAudioStreamOffset;
    ULONG ulAudioSizeBytes;
    ULONG ulRetainedStreamOffset;
    ULONG ulRetainedSizeBytes;
    LPCWSTR pszDisplayText;
    LPCWSTR pszLexicalForm;
    const SPPHONEID *pszPronunciation;
    BYTE bDisplayAttributes;
    signed char RequiredConfidence;
    signed char ActualConfidence;
    BYTE Reserved;
    float SREngineConfidence;
} SPPHRASEELEMENT;
typedef struct SPPHRASERULE SPPHRASERULE;
typedef struct SPPHRASEPROPERTY SPPHRASEPROPERTY;
struct SPPHRASERULE {
    LPCWSTR pszName;
    ULONG ulId;
    ULONG ulFirstElement;
    ULONG ulCountOfElements;
    const SPPHRASERULE *pNextSibling;
    const SPPHRASERULE *pFirstChild;
    float SREngineConfidence;
    signed char Confidence;
};
struct SPPHRASEPROPERTY {
    LPCWSTR pszName;
    __C89_NAMELESS union {
        ULONG ulId;
        __C89_NAMELESS struct {
            byte bType;
            byte bReserved;
            unsigned short usArrayIndex;
        } __C89_NAMELESSSTRUCTNAME;
    } __C89_NAMELESSUNIONNAME;
    LPCWSTR pszValue;
    VARIANT vValue;
    ULONG ulFirstElement;
    ULONG ulCountOfElements;
    const SPPHRASEPROPERTY *pNextSibling;
    const SPPHRASEPROPERTY *pFirstChild;
    float SREngineConfidence;
    signed char Confidence;
};
typedef struct SPPHRASEREPLACEMENT {
    BYTE bDisplayAttributes;
    LPCWSTR pszReplacementText;
    ULONG ulFirstElement;
    ULONG ulCountOfElements;
} SPPHRASEREPLACEMENT;
typedef struct SPSEMANTICERRORINFO {
    ULONG ulLineNumber;
    LPWSTR pszScriptLine;
    LPWSTR pszSource;
    LPWSTR pszDescription;
    HRESULT hrResultCode;
} SPSEMANTICERRORINFO;
typedef struct SPPHRASE_50 {
    ULONG cbSize;
    WORD LangID;
    WORD wHomophoneGroupId;
    ULONGLONG ullGrammarID;
    ULONGLONG ftStartTime;
    ULONGLONG ullAudioStreamPosition;
    ULONG ulAudioSizeBytes;
    ULONG ulRetainedSizeBytes;
    ULONG ulAudioSizeTime;
    SPPHRASERULE Rule;
    const SPPHRASEPROPERTY *pProperties;
    const SPPHRASEELEMENT *pElements;
    ULONG cReplacements;
    const SPPHRASEREPLACEMENT *pReplacements;
    GUID SREngineID;
    ULONG ulSREnginePrivateDataSize;
    const BYTE *pSREnginePrivateData;
} SPPHRASE_50;
#define SP_SPPHRASESIZE_500 sizeof (SPPHRASE_50)
#ifdef __cplusplus
typedef struct SPPHRASE : public SPPHRASE_50 {
  LPWSTR pSML;
  SPSEMANTICERRORINFO* pSemanticErrorInfo;
} SPPHRASE;
#else
typedef struct SPPHRASE {
    ULONG cbSize;
    WORD LangID;
    WORD wHomophoneGroupId;
    ULONGLONG ullGrammarID;
    ULONGLONG ftStartTime;
    ULONGLONG ullAudioStreamPosition;
    ULONG ulAudioSizeBytes;
    ULONG ulRetainedSizeBytes;
    ULONG ulAudioSizeTime;
    SPPHRASERULE Rule;
    const SPPHRASEPROPERTY *pProperties;
    const SPPHRASEELEMENT *pElements;
    ULONG cReplacements;
    const SPPHRASEREPLACEMENT *pReplacements;
    GUID SREngineID;
    ULONG ulSREnginePrivateDataSize;
    const BYTE *pSREnginePrivateData;
    LPWSTR pSML;
    SPSEMANTICERRORINFO *pSemanticErrorInfo;
} SPPHRASE;
#endif
typedef struct SPSERIALIZEDPHRASE {
    ULONG ulSerializedSize;
} SPSERIALIZEDPHRASE;
typedef struct SPRULE {
    LPCWSTR pszRuleName;
    ULONG ulRuleId;
    DWORD dwAttributes;
} SPRULE;
typedef struct SPBINARYGRAMMAR {
    ULONG ulTotalSerializedSize;
} SPBINARYGRAMMAR;
#if 0
typedef void *SPSTATEHANDLE;
#else
DECLARE_HANDLE(SPSTATEHANDLE);
#endif
typedef struct SPWORDPRONUNCIATION {
    struct SPWORDPRONUNCIATION *pNextWordPronunciation;
    SPLEXICONTYPE eLexiconType;
    WORD LangID;
    WORD wPronunciationFlags;
    SPPARTOFSPEECH ePartOfSpeech;
    SPPHONEID szPronunciation[1];
} SPWORDPRONUNCIATION;
typedef struct SPWORDPRONUNCIATIONLIST {
    ULONG ulSize;
    BYTE *pvBuffer;
    SPWORDPRONUNCIATION *pFirstWordPronunciation;
} SPWORDPRONUNCIATIONLIST;
typedef struct SPWORD {
    struct SPWORD *pNextWord;
    WORD LangID;
    WORD wReserved;
    SPWORDTYPE eWordType;
    LPWSTR pszWord;
    SPWORDPRONUNCIATION *pFirstWordPronunciation;
} SPWORD;
typedef struct SPWORDLIST {
    ULONG ulSize;
    BYTE *pvBuffer;
    SPWORD *pFirstWord;
} SPWORDLIST;
/*****************************************************************************
 * ISpLexicon interface
 */
#ifndef __ISpLexicon_INTERFACE_DEFINED__
#define __ISpLexicon_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpLexicon, 0xda41a7c2, 0x5383, 0x4db2, 0x91,0x6b, 0x6c,0x17,0x19,0xe3,0xdb,0x58);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("da41a7c2-5383-4db2-916b-6c1719e3db58")
ISpLexicon : public IUnknown
{
    virtual HRESULT STDMETHODCALLTYPE GetPronunciations(
        LPCWSTR pszWord,
        WORD LangID,
        DWORD dwFlags,
        SPWORDPRONUNCIATIONLIST *pWordPronunciationList) = 0;

    virtual HRESULT STDMETHODCALLTYPE AddPronunciation(
        LPCWSTR pszWord,
        WORD LangID,
        SPPARTOFSPEECH ePartOfSpeech,
        PCSPPHONEID pszPronunciation) = 0;

    virtual HRESULT STDMETHODCALLTYPE RemovePronunciation(
        LPCWSTR pszWord,
        WORD LangID,
        SPPARTOFSPEECH ePartOfSpeech,
        PCSPPHONEID pszPronunciation) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetGeneration(
        DWORD *pdwGeneration) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetGenerationChange(
        DWORD dwFlags,
        DWORD *pdwGeneration,
        SPWORDLIST *pWordList) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetWords(
        DWORD dwFlags,
        DWORD *pdwGeneration,
        DWORD *pdwCookie,
        SPWORDLIST *pWordList) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpLexicon, 0xda41a7c2, 0x5383, 0x4db2, 0x91,0x6b, 0x6c,0x17,0x19,0xe3,0xdb,0x58)
#endif
#else
typedef struct ISpLexiconVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpLexicon *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpLexicon *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpLexicon *This);

    /*** ISpLexicon methods ***/
    HRESULT (STDMETHODCALLTYPE *GetPronunciations)(
        ISpLexicon *This,
        LPCWSTR pszWord,
        WORD LangID,
        DWORD dwFlags,
        SPWORDPRONUNCIATIONLIST *pWordPronunciationList);

    HRESULT (STDMETHODCALLTYPE *AddPronunciation)(
        ISpLexicon *This,
        LPCWSTR pszWord,
        WORD LangID,
        SPPARTOFSPEECH ePartOfSpeech,
        PCSPPHONEID pszPronunciation);

    HRESULT (STDMETHODCALLTYPE *RemovePronunciation)(
        ISpLexicon *This,
        LPCWSTR pszWord,
        WORD LangID,
        SPPARTOFSPEECH ePartOfSpeech,
        PCSPPHONEID pszPronunciation);

    HRESULT (STDMETHODCALLTYPE *GetGeneration)(
        ISpLexicon *This,
        DWORD *pdwGeneration);

    HRESULT (STDMETHODCALLTYPE *GetGenerationChange)(
        ISpLexicon *This,
        DWORD dwFlags,
        DWORD *pdwGeneration,
        SPWORDLIST *pWordList);

    HRESULT (STDMETHODCALLTYPE *GetWords)(
        ISpLexicon *This,
        DWORD dwFlags,
        DWORD *pdwGeneration,
        DWORD *pdwCookie,
        SPWORDLIST *pWordList);

    END_INTERFACE
} ISpLexiconVtbl;

interface ISpLexicon {
    CONST_VTBL ISpLexiconVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpLexicon_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpLexicon_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpLexicon_Release(This) (This)->lpVtbl->Release(This)
/*** ISpLexicon methods ***/
#define ISpLexicon_GetPronunciations(This,pszWord,LangID,dwFlags,pWordPronunciationList) (This)->lpVtbl->GetPronunciations(This,pszWord,LangID,dwFlags,pWordPronunciationList)
#define ISpLexicon_AddPronunciation(This,pszWord,LangID,ePartOfSpeech,pszPronunciation) (This)->lpVtbl->AddPronunciation(This,pszWord,LangID,ePartOfSpeech,pszPronunciation)
#define ISpLexicon_RemovePronunciation(This,pszWord,LangID,ePartOfSpeech,pszPronunciation) (This)->lpVtbl->RemovePronunciation(This,pszWord,LangID,ePartOfSpeech,pszPronunciation)
#define ISpLexicon_GetGeneration(This,pdwGeneration) (This)->lpVtbl->GetGeneration(This,pdwGeneration)
#define ISpLexicon_GetGenerationChange(This,dwFlags,pdwGeneration,pWordList) (This)->lpVtbl->GetGenerationChange(This,dwFlags,pdwGeneration,pWordList)
#define ISpLexicon_GetWords(This,dwFlags,pdwGeneration,pdwCookie,pWordList) (This)->lpVtbl->GetWords(This,dwFlags,pdwGeneration,pdwCookie,pWordList)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpLexicon_QueryInterface(ISpLexicon* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpLexicon_AddRef(ISpLexicon* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpLexicon_Release(ISpLexicon* This) {
    return This->lpVtbl->Release(This);
}
/*** ISpLexicon methods ***/
static FORCEINLINE HRESULT ISpLexicon_GetPronunciations(ISpLexicon* This,LPCWSTR pszWord,WORD LangID,DWORD dwFlags,SPWORDPRONUNCIATIONLIST *pWordPronunciationList) {
    return This->lpVtbl->GetPronunciations(This,pszWord,LangID,dwFlags,pWordPronunciationList);
}
static FORCEINLINE HRESULT ISpLexicon_AddPronunciation(ISpLexicon* This,LPCWSTR pszWord,WORD LangID,SPPARTOFSPEECH ePartOfSpeech,PCSPPHONEID pszPronunciation) {
    return This->lpVtbl->AddPronunciation(This,pszWord,LangID,ePartOfSpeech,pszPronunciation);
}
static FORCEINLINE HRESULT ISpLexicon_RemovePronunciation(ISpLexicon* This,LPCWSTR pszWord,WORD LangID,SPPARTOFSPEECH ePartOfSpeech,PCSPPHONEID pszPronunciation) {
    return This->lpVtbl->RemovePronunciation(This,pszWord,LangID,ePartOfSpeech,pszPronunciation);
}
static FORCEINLINE HRESULT ISpLexicon_GetGeneration(ISpLexicon* This,DWORD *pdwGeneration) {
    return This->lpVtbl->GetGeneration(This,pdwGeneration);
}
static FORCEINLINE HRESULT ISpLexicon_GetGenerationChange(ISpLexicon* This,DWORD dwFlags,DWORD *pdwGeneration,SPWORDLIST *pWordList) {
    return This->lpVtbl->GetGenerationChange(This,dwFlags,pdwGeneration,pWordList);
}
static FORCEINLINE HRESULT ISpLexicon_GetWords(ISpLexicon* This,DWORD dwFlags,DWORD *pdwGeneration,DWORD *pdwCookie,SPWORDLIST *pWordList) {
    return This->lpVtbl->GetWords(This,dwFlags,pdwGeneration,pdwCookie,pWordList);
}
#endif
#endif

#endif


#endif  /* __ISpLexicon_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpContainerLexicon interface
 */
#ifndef __ISpContainerLexicon_INTERFACE_DEFINED__
#define __ISpContainerLexicon_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpContainerLexicon, 0x8565572f, 0xc094, 0x41cc, 0xb5,0x6e, 0x10,0xbd,0x9c,0x3f,0xf0,0x44);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("8565572f-c094-41cc-b56e-10bd9c3ff044")
ISpContainerLexicon : public ISpLexicon
{
    virtual HRESULT STDMETHODCALLTYPE AddLexicon(
        ISpLexicon *pAddLexicon,
        DWORD dwFlags) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpContainerLexicon, 0x8565572f, 0xc094, 0x41cc, 0xb5,0x6e, 0x10,0xbd,0x9c,0x3f,0xf0,0x44)
#endif
#else
typedef struct ISpContainerLexiconVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpContainerLexicon *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpContainerLexicon *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpContainerLexicon *This);

    /*** ISpLexicon methods ***/
    HRESULT (STDMETHODCALLTYPE *GetPronunciations)(
        ISpContainerLexicon *This,
        LPCWSTR pszWord,
        WORD LangID,
        DWORD dwFlags,
        SPWORDPRONUNCIATIONLIST *pWordPronunciationList);

    HRESULT (STDMETHODCALLTYPE *AddPronunciation)(
        ISpContainerLexicon *This,
        LPCWSTR pszWord,
        WORD LangID,
        SPPARTOFSPEECH ePartOfSpeech,
        PCSPPHONEID pszPronunciation);

    HRESULT (STDMETHODCALLTYPE *RemovePronunciation)(
        ISpContainerLexicon *This,
        LPCWSTR pszWord,
        WORD LangID,
        SPPARTOFSPEECH ePartOfSpeech,
        PCSPPHONEID pszPronunciation);

    HRESULT (STDMETHODCALLTYPE *GetGeneration)(
        ISpContainerLexicon *This,
        DWORD *pdwGeneration);

    HRESULT (STDMETHODCALLTYPE *GetGenerationChange)(
        ISpContainerLexicon *This,
        DWORD dwFlags,
        DWORD *pdwGeneration,
        SPWORDLIST *pWordList);

    HRESULT (STDMETHODCALLTYPE *GetWords)(
        ISpContainerLexicon *This,
        DWORD dwFlags,
        DWORD *pdwGeneration,
        DWORD *pdwCookie,
        SPWORDLIST *pWordList);

    /*** ISpContainerLexicon methods ***/
    HRESULT (STDMETHODCALLTYPE *AddLexicon)(
        ISpContainerLexicon *This,
        ISpLexicon *pAddLexicon,
        DWORD dwFlags);

    END_INTERFACE
} ISpContainerLexiconVtbl;

interface ISpContainerLexicon {
    CONST_VTBL ISpContainerLexiconVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpContainerLexicon_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpContainerLexicon_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpContainerLexicon_Release(This) (This)->lpVtbl->Release(This)
/*** ISpLexicon methods ***/
#define ISpContainerLexicon_GetPronunciations(This,pszWord,LangID,dwFlags,pWordPronunciationList) (This)->lpVtbl->GetPronunciations(This,pszWord,LangID,dwFlags,pWordPronunciationList)
#define ISpContainerLexicon_AddPronunciation(This,pszWord,LangID,ePartOfSpeech,pszPronunciation) (This)->lpVtbl->AddPronunciation(This,pszWord,LangID,ePartOfSpeech,pszPronunciation)
#define ISpContainerLexicon_RemovePronunciation(This,pszWord,LangID,ePartOfSpeech,pszPronunciation) (This)->lpVtbl->RemovePronunciation(This,pszWord,LangID,ePartOfSpeech,pszPronunciation)
#define ISpContainerLexicon_GetGeneration(This,pdwGeneration) (This)->lpVtbl->GetGeneration(This,pdwGeneration)
#define ISpContainerLexicon_GetGenerationChange(This,dwFlags,pdwGeneration,pWordList) (This)->lpVtbl->GetGenerationChange(This,dwFlags,pdwGeneration,pWordList)
#define ISpContainerLexicon_GetWords(This,dwFlags,pdwGeneration,pdwCookie,pWordList) (This)->lpVtbl->GetWords(This,dwFlags,pdwGeneration,pdwCookie,pWordList)
/*** ISpContainerLexicon methods ***/
#define ISpContainerLexicon_AddLexicon(This,pAddLexicon,dwFlags) (This)->lpVtbl->AddLexicon(This,pAddLexicon,dwFlags)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpContainerLexicon_QueryInterface(ISpContainerLexicon* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpContainerLexicon_AddRef(ISpContainerLexicon* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpContainerLexicon_Release(ISpContainerLexicon* This) {
    return This->lpVtbl->Release(This);
}
/*** ISpLexicon methods ***/
static FORCEINLINE HRESULT ISpContainerLexicon_GetPronunciations(ISpContainerLexicon* This,LPCWSTR pszWord,WORD LangID,DWORD dwFlags,SPWORDPRONUNCIATIONLIST *pWordPronunciationList) {
    return This->lpVtbl->GetPronunciations(This,pszWord,LangID,dwFlags,pWordPronunciationList);
}
static FORCEINLINE HRESULT ISpContainerLexicon_AddPronunciation(ISpContainerLexicon* This,LPCWSTR pszWord,WORD LangID,SPPARTOFSPEECH ePartOfSpeech,PCSPPHONEID pszPronunciation) {
    return This->lpVtbl->AddPronunciation(This,pszWord,LangID,ePartOfSpeech,pszPronunciation);
}
static FORCEINLINE HRESULT ISpContainerLexicon_RemovePronunciation(ISpContainerLexicon* This,LPCWSTR pszWord,WORD LangID,SPPARTOFSPEECH ePartOfSpeech,PCSPPHONEID pszPronunciation) {
    return This->lpVtbl->RemovePronunciation(This,pszWord,LangID,ePartOfSpeech,pszPronunciation);
}
static FORCEINLINE HRESULT ISpContainerLexicon_GetGeneration(ISpContainerLexicon* This,DWORD *pdwGeneration) {
    return This->lpVtbl->GetGeneration(This,pdwGeneration);
}
static FORCEINLINE HRESULT ISpContainerLexicon_GetGenerationChange(ISpContainerLexicon* This,DWORD dwFlags,DWORD *pdwGeneration,SPWORDLIST *pWordList) {
    return This->lpVtbl->GetGenerationChange(This,dwFlags,pdwGeneration,pWordList);
}
static FORCEINLINE HRESULT ISpContainerLexicon_GetWords(ISpContainerLexicon* This,DWORD dwFlags,DWORD *pdwGeneration,DWORD *pdwCookie,SPWORDLIST *pWordList) {
    return This->lpVtbl->GetWords(This,dwFlags,pdwGeneration,pdwCookie,pWordList);
}
/*** ISpContainerLexicon methods ***/
static FORCEINLINE HRESULT ISpContainerLexicon_AddLexicon(ISpContainerLexicon* This,ISpLexicon *pAddLexicon,DWORD dwFlags) {
    return This->lpVtbl->AddLexicon(This,pAddLexicon,dwFlags);
}
#endif
#endif

#endif


#endif  /* __ISpContainerLexicon_INTERFACE_DEFINED__ */

typedef struct SPSHORTCUTPAIR {
    struct SPSHORTCUTPAIR *pNextSHORTCUTPAIR;
    WORD LangID;
    SPSHORTCUTTYPE shType;
    LPWSTR pszDisplay;
    LPWSTR pszSpoken;
} SPSHORTCUTPAIR;
typedef struct SPSHORTCUTPAIRLIST {
    ULONG ulSize;
    BYTE *pvBuffer;
    SPSHORTCUTPAIR *pFirstShortcutPair;
} SPSHORTCUTPAIRLIST;
/*****************************************************************************
 * ISpShortcut interface
 */
#ifndef __ISpShortcut_INTERFACE_DEFINED__
#define __ISpShortcut_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpShortcut, 0x3df681e2, 0xea56, 0x11d9, 0x8b,0xde, 0xf6,0x6b,0xad,0x1e,0x3f,0x3a);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("3df681e2-ea56-11d9-8bde-f66bad1e3f3a")
ISpShortcut : public IUnknown
{
    virtual HRESULT STDMETHODCALLTYPE AddShortcut(
        LPCWSTR pszDisplay,
        WORD LangID,
        LPCWSTR pszSpoken,
        SPSHORTCUTTYPE shType) = 0;

    virtual HRESULT STDMETHODCALLTYPE RemoveShortcut(
        LPCWSTR pszDisplay,
        WORD LangID,
        LPCWSTR pszSpoken,
        SPSHORTCUTTYPE shType) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetShortcuts(
        WORD LangID,
        SPSHORTCUTPAIRLIST *pShortcutpairList) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetGeneration(
        DWORD *pdwGeneration) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetWordsFromGenerationChange(
        DWORD *pdwGeneration,
        SPWORDLIST *pWordList) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetWords(
        DWORD *pdwGeneration,
        DWORD *pdwCookie,
        SPWORDLIST *pWordList) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetShortcutsForGeneration(
        DWORD *pdwGeneration,
        DWORD *pdwCookie,
        SPSHORTCUTPAIRLIST *pShortcutpairList) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetGenerationChange(
        DWORD *pdwGeneration,
        SPSHORTCUTPAIRLIST *pShortcutpairList) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpShortcut, 0x3df681e2, 0xea56, 0x11d9, 0x8b,0xde, 0xf6,0x6b,0xad,0x1e,0x3f,0x3a)
#endif
#else
typedef struct ISpShortcutVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpShortcut *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpShortcut *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpShortcut *This);

    /*** ISpShortcut methods ***/
    HRESULT (STDMETHODCALLTYPE *AddShortcut)(
        ISpShortcut *This,
        LPCWSTR pszDisplay,
        WORD LangID,
        LPCWSTR pszSpoken,
        SPSHORTCUTTYPE shType);

    HRESULT (STDMETHODCALLTYPE *RemoveShortcut)(
        ISpShortcut *This,
        LPCWSTR pszDisplay,
        WORD LangID,
        LPCWSTR pszSpoken,
        SPSHORTCUTTYPE shType);

    HRESULT (STDMETHODCALLTYPE *GetShortcuts)(
        ISpShortcut *This,
        WORD LangID,
        SPSHORTCUTPAIRLIST *pShortcutpairList);

    HRESULT (STDMETHODCALLTYPE *GetGeneration)(
        ISpShortcut *This,
        DWORD *pdwGeneration);

    HRESULT (STDMETHODCALLTYPE *GetWordsFromGenerationChange)(
        ISpShortcut *This,
        DWORD *pdwGeneration,
        SPWORDLIST *pWordList);

    HRESULT (STDMETHODCALLTYPE *GetWords)(
        ISpShortcut *This,
        DWORD *pdwGeneration,
        DWORD *pdwCookie,
        SPWORDLIST *pWordList);

    HRESULT (STDMETHODCALLTYPE *GetShortcutsForGeneration)(
        ISpShortcut *This,
        DWORD *pdwGeneration,
        DWORD *pdwCookie,
        SPSHORTCUTPAIRLIST *pShortcutpairList);

    HRESULT (STDMETHODCALLTYPE *GetGenerationChange)(
        ISpShortcut *This,
        DWORD *pdwGeneration,
        SPSHORTCUTPAIRLIST *pShortcutpairList);

    END_INTERFACE
} ISpShortcutVtbl;

interface ISpShortcut {
    CONST_VTBL ISpShortcutVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpShortcut_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpShortcut_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpShortcut_Release(This) (This)->lpVtbl->Release(This)
/*** ISpShortcut methods ***/
#define ISpShortcut_AddShortcut(This,pszDisplay,LangID,pszSpoken,shType) (This)->lpVtbl->AddShortcut(This,pszDisplay,LangID,pszSpoken,shType)
#define ISpShortcut_RemoveShortcut(This,pszDisplay,LangID,pszSpoken,shType) (This)->lpVtbl->RemoveShortcut(This,pszDisplay,LangID,pszSpoken,shType)
#define ISpShortcut_GetShortcuts(This,LangID,pShortcutpairList) (This)->lpVtbl->GetShortcuts(This,LangID,pShortcutpairList)
#define ISpShortcut_GetGeneration(This,pdwGeneration) (This)->lpVtbl->GetGeneration(This,pdwGeneration)
#define ISpShortcut_GetWordsFromGenerationChange(This,pdwGeneration,pWordList) (This)->lpVtbl->GetWordsFromGenerationChange(This,pdwGeneration,pWordList)
#define ISpShortcut_GetWords(This,pdwGeneration,pdwCookie,pWordList) (This)->lpVtbl->GetWords(This,pdwGeneration,pdwCookie,pWordList)
#define ISpShortcut_GetShortcutsForGeneration(This,pdwGeneration,pdwCookie,pShortcutpairList) (This)->lpVtbl->GetShortcutsForGeneration(This,pdwGeneration,pdwCookie,pShortcutpairList)
#define ISpShortcut_GetGenerationChange(This,pdwGeneration,pShortcutpairList) (This)->lpVtbl->GetGenerationChange(This,pdwGeneration,pShortcutpairList)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpShortcut_QueryInterface(ISpShortcut* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpShortcut_AddRef(ISpShortcut* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpShortcut_Release(ISpShortcut* This) {
    return This->lpVtbl->Release(This);
}
/*** ISpShortcut methods ***/
static FORCEINLINE HRESULT ISpShortcut_AddShortcut(ISpShortcut* This,LPCWSTR pszDisplay,WORD LangID,LPCWSTR pszSpoken,SPSHORTCUTTYPE shType) {
    return This->lpVtbl->AddShortcut(This,pszDisplay,LangID,pszSpoken,shType);
}
static FORCEINLINE HRESULT ISpShortcut_RemoveShortcut(ISpShortcut* This,LPCWSTR pszDisplay,WORD LangID,LPCWSTR pszSpoken,SPSHORTCUTTYPE shType) {
    return This->lpVtbl->RemoveShortcut(This,pszDisplay,LangID,pszSpoken,shType);
}
static FORCEINLINE HRESULT ISpShortcut_GetShortcuts(ISpShortcut* This,WORD LangID,SPSHORTCUTPAIRLIST *pShortcutpairList) {
    return This->lpVtbl->GetShortcuts(This,LangID,pShortcutpairList);
}
static FORCEINLINE HRESULT ISpShortcut_GetGeneration(ISpShortcut* This,DWORD *pdwGeneration) {
    return This->lpVtbl->GetGeneration(This,pdwGeneration);
}
static FORCEINLINE HRESULT ISpShortcut_GetWordsFromGenerationChange(ISpShortcut* This,DWORD *pdwGeneration,SPWORDLIST *pWordList) {
    return This->lpVtbl->GetWordsFromGenerationChange(This,pdwGeneration,pWordList);
}
static FORCEINLINE HRESULT ISpShortcut_GetWords(ISpShortcut* This,DWORD *pdwGeneration,DWORD *pdwCookie,SPWORDLIST *pWordList) {
    return This->lpVtbl->GetWords(This,pdwGeneration,pdwCookie,pWordList);
}
static FORCEINLINE HRESULT ISpShortcut_GetShortcutsForGeneration(ISpShortcut* This,DWORD *pdwGeneration,DWORD *pdwCookie,SPSHORTCUTPAIRLIST *pShortcutpairList) {
    return This->lpVtbl->GetShortcutsForGeneration(This,pdwGeneration,pdwCookie,pShortcutpairList);
}
static FORCEINLINE HRESULT ISpShortcut_GetGenerationChange(ISpShortcut* This,DWORD *pdwGeneration,SPSHORTCUTPAIRLIST *pShortcutpairList) {
    return This->lpVtbl->GetGenerationChange(This,pdwGeneration,pShortcutpairList);
}
#endif
#endif

#endif


#endif  /* __ISpShortcut_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpPhoneConverter interface
 */
#ifndef __ISpPhoneConverter_INTERFACE_DEFINED__
#define __ISpPhoneConverter_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpPhoneConverter, 0x8445c581, 0x0cac, 0x4a38, 0xab,0xfe, 0x9b,0x2c,0xe2,0x82,0x64,0x55);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("8445c581-0cac-4a38-abfe-9b2ce2826455")
ISpPhoneConverter : public ISpObjectWithToken
{
    virtual HRESULT STDMETHODCALLTYPE PhoneToId(
        LPCWSTR pszPhone,
        SPPHONEID *pId) = 0;

    virtual HRESULT STDMETHODCALLTYPE IdToPhone(
        PCSPPHONEID pId,
        WCHAR *pszPhone) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpPhoneConverter, 0x8445c581, 0x0cac, 0x4a38, 0xab,0xfe, 0x9b,0x2c,0xe2,0x82,0x64,0x55)
#endif
#else
typedef struct ISpPhoneConverterVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpPhoneConverter *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpPhoneConverter *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpPhoneConverter *This);

    /*** ISpObjectWithToken methods ***/
    HRESULT (STDMETHODCALLTYPE *SetObjectToken)(
        ISpPhoneConverter *This,
        ISpObjectToken *pToken);

    HRESULT (STDMETHODCALLTYPE *GetObjectToken)(
        ISpPhoneConverter *This,
        ISpObjectToken **ppToken);

    /*** ISpPhoneConverter methods ***/
    HRESULT (STDMETHODCALLTYPE *PhoneToId)(
        ISpPhoneConverter *This,
        LPCWSTR pszPhone,
        SPPHONEID *pId);

    HRESULT (STDMETHODCALLTYPE *IdToPhone)(
        ISpPhoneConverter *This,
        PCSPPHONEID pId,
        WCHAR *pszPhone);

    END_INTERFACE
} ISpPhoneConverterVtbl;

interface ISpPhoneConverter {
    CONST_VTBL ISpPhoneConverterVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpPhoneConverter_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpPhoneConverter_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpPhoneConverter_Release(This) (This)->lpVtbl->Release(This)
/*** ISpObjectWithToken methods ***/
#define ISpPhoneConverter_SetObjectToken(This,pToken) (This)->lpVtbl->SetObjectToken(This,pToken)
#define ISpPhoneConverter_GetObjectToken(This,ppToken) (This)->lpVtbl->GetObjectToken(This,ppToken)
/*** ISpPhoneConverter methods ***/
#define ISpPhoneConverter_PhoneToId(This,pszPhone,pId) (This)->lpVtbl->PhoneToId(This,pszPhone,pId)
#define ISpPhoneConverter_IdToPhone(This,pId,pszPhone) (This)->lpVtbl->IdToPhone(This,pId,pszPhone)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpPhoneConverter_QueryInterface(ISpPhoneConverter* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpPhoneConverter_AddRef(ISpPhoneConverter* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpPhoneConverter_Release(ISpPhoneConverter* This) {
    return This->lpVtbl->Release(This);
}
/*** ISpObjectWithToken methods ***/
static FORCEINLINE HRESULT ISpPhoneConverter_SetObjectToken(ISpPhoneConverter* This,ISpObjectToken *pToken) {
    return This->lpVtbl->SetObjectToken(This,pToken);
}
static FORCEINLINE HRESULT ISpPhoneConverter_GetObjectToken(ISpPhoneConverter* This,ISpObjectToken **ppToken) {
    return This->lpVtbl->GetObjectToken(This,ppToken);
}
/*** ISpPhoneConverter methods ***/
static FORCEINLINE HRESULT ISpPhoneConverter_PhoneToId(ISpPhoneConverter* This,LPCWSTR pszPhone,SPPHONEID *pId) {
    return This->lpVtbl->PhoneToId(This,pszPhone,pId);
}
static FORCEINLINE HRESULT ISpPhoneConverter_IdToPhone(ISpPhoneConverter* This,PCSPPHONEID pId,WCHAR *pszPhone) {
    return This->lpVtbl->IdToPhone(This,pId,pszPhone);
}
#endif
#endif

#endif


#endif  /* __ISpPhoneConverter_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpPhoneticAlphabetConverter interface
 */
#ifndef __ISpPhoneticAlphabetConverter_INTERFACE_DEFINED__
#define __ISpPhoneticAlphabetConverter_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpPhoneticAlphabetConverter, 0x133adcd4, 0x19b4, 0x4020, 0x9f,0xdc, 0x84,0x2e,0x78,0x25,0x3b,0x17);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("133adcd4-19b4-4020-9fdc-842e78253b17")
ISpPhoneticAlphabetConverter : public IUnknown
{
    virtual HRESULT STDMETHODCALLTYPE GetLangId(
        WORD *pLangID) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetLangId(
        WORD LangID) = 0;

    virtual HRESULT STDMETHODCALLTYPE SAPI2UPS(
        const SPPHONEID *pszSAPIId,
        SPPHONEID *pszUPSId,
        DWORD cMaxLength) = 0;

    virtual HRESULT STDMETHODCALLTYPE UPS2SAPI(
        const SPPHONEID *pszUPSId,
        SPPHONEID *pszSAPIId,
        DWORD cMaxLength) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetMaxConvertLength(
        DWORD cSrcLength,
        WINBOOL bSAPI2UPS,
        DWORD *pcMaxDestLength) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpPhoneticAlphabetConverter, 0x133adcd4, 0x19b4, 0x4020, 0x9f,0xdc, 0x84,0x2e,0x78,0x25,0x3b,0x17)
#endif
#else
typedef struct ISpPhoneticAlphabetConverterVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpPhoneticAlphabetConverter *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpPhoneticAlphabetConverter *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpPhoneticAlphabetConverter *This);

    /*** ISpPhoneticAlphabetConverter methods ***/
    HRESULT (STDMETHODCALLTYPE *GetLangId)(
        ISpPhoneticAlphabetConverter *This,
        WORD *pLangID);

    HRESULT (STDMETHODCALLTYPE *SetLangId)(
        ISpPhoneticAlphabetConverter *This,
        WORD LangID);

    HRESULT (STDMETHODCALLTYPE *SAPI2UPS)(
        ISpPhoneticAlphabetConverter *This,
        const SPPHONEID *pszSAPIId,
        SPPHONEID *pszUPSId,
        DWORD cMaxLength);

    HRESULT (STDMETHODCALLTYPE *UPS2SAPI)(
        ISpPhoneticAlphabetConverter *This,
        const SPPHONEID *pszUPSId,
        SPPHONEID *pszSAPIId,
        DWORD cMaxLength);

    HRESULT (STDMETHODCALLTYPE *GetMaxConvertLength)(
        ISpPhoneticAlphabetConverter *This,
        DWORD cSrcLength,
        WINBOOL bSAPI2UPS,
        DWORD *pcMaxDestLength);

    END_INTERFACE
} ISpPhoneticAlphabetConverterVtbl;

interface ISpPhoneticAlphabetConverter {
    CONST_VTBL ISpPhoneticAlphabetConverterVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpPhoneticAlphabetConverter_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpPhoneticAlphabetConverter_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpPhoneticAlphabetConverter_Release(This) (This)->lpVtbl->Release(This)
/*** ISpPhoneticAlphabetConverter methods ***/
#define ISpPhoneticAlphabetConverter_GetLangId(This,pLangID) (This)->lpVtbl->GetLangId(This,pLangID)
#define ISpPhoneticAlphabetConverter_SetLangId(This,LangID) (This)->lpVtbl->SetLangId(This,LangID)
#define ISpPhoneticAlphabetConverter_SAPI2UPS(This,pszSAPIId,pszUPSId,cMaxLength) (This)->lpVtbl->SAPI2UPS(This,pszSAPIId,pszUPSId,cMaxLength)
#define ISpPhoneticAlphabetConverter_UPS2SAPI(This,pszUPSId,pszSAPIId,cMaxLength) (This)->lpVtbl->UPS2SAPI(This,pszUPSId,pszSAPIId,cMaxLength)
#define ISpPhoneticAlphabetConverter_GetMaxConvertLength(This,cSrcLength,bSAPI2UPS,pcMaxDestLength) (This)->lpVtbl->GetMaxConvertLength(This,cSrcLength,bSAPI2UPS,pcMaxDestLength)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpPhoneticAlphabetConverter_QueryInterface(ISpPhoneticAlphabetConverter* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpPhoneticAlphabetConverter_AddRef(ISpPhoneticAlphabetConverter* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpPhoneticAlphabetConverter_Release(ISpPhoneticAlphabetConverter* This) {
    return This->lpVtbl->Release(This);
}
/*** ISpPhoneticAlphabetConverter methods ***/
static FORCEINLINE HRESULT ISpPhoneticAlphabetConverter_GetLangId(ISpPhoneticAlphabetConverter* This,WORD *pLangID) {
    return This->lpVtbl->GetLangId(This,pLangID);
}
static FORCEINLINE HRESULT ISpPhoneticAlphabetConverter_SetLangId(ISpPhoneticAlphabetConverter* This,WORD LangID) {
    return This->lpVtbl->SetLangId(This,LangID);
}
static FORCEINLINE HRESULT ISpPhoneticAlphabetConverter_SAPI2UPS(ISpPhoneticAlphabetConverter* This,const SPPHONEID *pszSAPIId,SPPHONEID *pszUPSId,DWORD cMaxLength) {
    return This->lpVtbl->SAPI2UPS(This,pszSAPIId,pszUPSId,cMaxLength);
}
static FORCEINLINE HRESULT ISpPhoneticAlphabetConverter_UPS2SAPI(ISpPhoneticAlphabetConverter* This,const SPPHONEID *pszUPSId,SPPHONEID *pszSAPIId,DWORD cMaxLength) {
    return This->lpVtbl->UPS2SAPI(This,pszUPSId,pszSAPIId,cMaxLength);
}
static FORCEINLINE HRESULT ISpPhoneticAlphabetConverter_GetMaxConvertLength(ISpPhoneticAlphabetConverter* This,DWORD cSrcLength,WINBOOL bSAPI2UPS,DWORD *pcMaxDestLength) {
    return This->lpVtbl->GetMaxConvertLength(This,cSrcLength,bSAPI2UPS,pcMaxDestLength);
}
#endif
#endif

#endif


#endif  /* __ISpPhoneticAlphabetConverter_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpPhoneticAlphabetSelection interface
 */
#ifndef __ISpPhoneticAlphabetSelection_INTERFACE_DEFINED__
#define __ISpPhoneticAlphabetSelection_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpPhoneticAlphabetSelection, 0xb2745efd, 0x42ce, 0x48ca, 0x81,0xf1, 0xa9,0x6e,0x02,0x53,0x8a,0x90);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("b2745efd-42ce-48ca-81f1-a96e02538a90")
ISpPhoneticAlphabetSelection : public IUnknown
{
    virtual HRESULT STDMETHODCALLTYPE IsAlphabetUPS(
        WINBOOL *pfIsUPS) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetAlphabetToUPS(
        WINBOOL fForceUPS) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpPhoneticAlphabetSelection, 0xb2745efd, 0x42ce, 0x48ca, 0x81,0xf1, 0xa9,0x6e,0x02,0x53,0x8a,0x90)
#endif
#else
typedef struct ISpPhoneticAlphabetSelectionVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpPhoneticAlphabetSelection *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpPhoneticAlphabetSelection *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpPhoneticAlphabetSelection *This);

    /*** ISpPhoneticAlphabetSelection methods ***/
    HRESULT (STDMETHODCALLTYPE *IsAlphabetUPS)(
        ISpPhoneticAlphabetSelection *This,
        WINBOOL *pfIsUPS);

    HRESULT (STDMETHODCALLTYPE *SetAlphabetToUPS)(
        ISpPhoneticAlphabetSelection *This,
        WINBOOL fForceUPS);

    END_INTERFACE
} ISpPhoneticAlphabetSelectionVtbl;

interface ISpPhoneticAlphabetSelection {
    CONST_VTBL ISpPhoneticAlphabetSelectionVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpPhoneticAlphabetSelection_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpPhoneticAlphabetSelection_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpPhoneticAlphabetSelection_Release(This) (This)->lpVtbl->Release(This)
/*** ISpPhoneticAlphabetSelection methods ***/
#define ISpPhoneticAlphabetSelection_IsAlphabetUPS(This,pfIsUPS) (This)->lpVtbl->IsAlphabetUPS(This,pfIsUPS)
#define ISpPhoneticAlphabetSelection_SetAlphabetToUPS(This,fForceUPS) (This)->lpVtbl->SetAlphabetToUPS(This,fForceUPS)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpPhoneticAlphabetSelection_QueryInterface(ISpPhoneticAlphabetSelection* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpPhoneticAlphabetSelection_AddRef(ISpPhoneticAlphabetSelection* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpPhoneticAlphabetSelection_Release(ISpPhoneticAlphabetSelection* This) {
    return This->lpVtbl->Release(This);
}
/*** ISpPhoneticAlphabetSelection methods ***/
static FORCEINLINE HRESULT ISpPhoneticAlphabetSelection_IsAlphabetUPS(ISpPhoneticAlphabetSelection* This,WINBOOL *pfIsUPS) {
    return This->lpVtbl->IsAlphabetUPS(This,pfIsUPS);
}
static FORCEINLINE HRESULT ISpPhoneticAlphabetSelection_SetAlphabetToUPS(ISpPhoneticAlphabetSelection* This,WINBOOL fForceUPS) {
    return This->lpVtbl->SetAlphabetToUPS(This,fForceUPS);
}
#endif
#endif

#endif


#endif  /* __ISpPhoneticAlphabetSelection_INTERFACE_DEFINED__ */

typedef struct SPVPITCH {
    LONG MiddleAdj;
    LONG RangeAdj;
} SPVPITCH;
typedef struct SPVCONTEXT {
    LPCWSTR pCategory;
    LPCWSTR pBefore;
    LPCWSTR pAfter;
} SPVCONTEXT;
typedef struct SPVSTATE {
    SPVACTIONS eAction;
    WORD LangID;
    WORD wReserved;
    LONG EmphAdj;
    LONG RateAdj;
    ULONG Volume;
    SPVPITCH PitchAdj;
    ULONG SilenceMSecs;
    SPPHONEID *pPhoneIds;
    SPPARTOFSPEECH ePartOfSpeech;
    SPVCONTEXT Context;
} SPVSTATE;
typedef struct SPVOICESTATUS {
    ULONG ulCurrentStream;
    ULONG ulLastStreamQueued;
    HRESULT hrLastResult;
    DWORD dwRunningState;
    ULONG ulInputWordPos;
    ULONG ulInputWordLen;
    ULONG ulInputSentPos;
    ULONG ulInputSentLen;
    LONG lBookmarkId;
    SPPHONEID PhonemeId;
    SPVISEMES VisemeId;
    DWORD dwReserved1;
    DWORD dwReserved2;
} SPVOICESTATUS;
typedef enum SPEAKFLAGS {
    SPF_DEFAULT = 0,
    SPF_ASYNC = 1,
    SPF_PURGEBEFORESPEAK = 2,
    SPF_IS_FILENAME = 4,
    SPF_IS_XML = 8,
    SPF_IS_NOT_XML = 0x10,
    SPF_PERSIST_XML = 0x20,
    SPF_NLP_SPEAK_PUNC = 0x40,
    SPF_PARSE_SAPI = 0x80,
    SPF_PARSE_SSML = 0x100,
    SPF_PARSE_AUTODETECT = 0,
    SPF_NLP_MASK = SPF_NLP_SPEAK_PUNC,
    SPF_PARSE_MASK = SPF_PARSE_SAPI | SPF_PARSE_SSML,
    SPF_VOICE_MASK = ((((((SPF_ASYNC | SPF_PURGEBEFORESPEAK) | SPF_IS_FILENAME) | SPF_IS_XML) | SPF_IS_NOT_XML) | SPF_NLP_MASK) | SPF_PERSIST_XML) | SPF_PARSE_MASK,
    SPF_UNUSED_FLAGS = ~SPF_VOICE_MASK
} SPEAKFLAGS;
/*****************************************************************************
 * ISpVoice interface
 */
#ifndef __ISpVoice_INTERFACE_DEFINED__
#define __ISpVoice_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpVoice, 0x6c44df74, 0x72b9, 0x4992, 0xa1,0xec, 0xef,0x99,0x6e,0x04,0x22,0xd4);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("6c44df74-72b9-4992-a1ec-ef996e0422d4")
ISpVoice : public ISpEventSource
{
    virtual HRESULT STDMETHODCALLTYPE SetOutput(
        IUnknown *pUnkOutput,
        WINBOOL fAllowFormatChanges) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetOutputObjectToken(
        ISpObjectToken **ppObjectToken) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetOutputStream(
        ISpStreamFormat **ppStream) = 0;

    virtual HRESULT STDMETHODCALLTYPE Pause(
        ) = 0;

    virtual HRESULT STDMETHODCALLTYPE Resume(
        ) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetVoice(
        ISpObjectToken *pToken) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetVoice(
        ISpObjectToken **ppToken) = 0;

    virtual HRESULT STDMETHODCALLTYPE Speak(
        LPCWSTR pwcs,
        DWORD dwFlags,
        ULONG *pulStreamNumber) = 0;

    virtual HRESULT STDMETHODCALLTYPE SpeakStream(
        IStream *pStream,
        DWORD dwFlags,
        ULONG *pulStreamNumber) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetStatus(
        SPVOICESTATUS *pStatus,
        LPWSTR *ppszLastBookmark) = 0;

    virtual HRESULT STDMETHODCALLTYPE Skip(
        LPCWSTR pItemType,
        LONG lNumItems,
        ULONG *pulNumSkipped) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetPriority(
        SPVPRIORITY ePriority) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetPriority(
        SPVPRIORITY *pePriority) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetAlertBoundary(
        SPEVENTENUM eBoundary) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetAlertBoundary(
        SPEVENTENUM *peBoundary) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetRate(
        LONG RateAdjust) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetRate(
        LONG *pRateAdjust) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetVolume(
        USHORT usVolume) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetVolume(
        USHORT *pusVolume) = 0;

    virtual HRESULT STDMETHODCALLTYPE WaitUntilDone(
        ULONG msTimeout) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetSyncSpeakTimeout(
        ULONG msTimeout) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetSyncSpeakTimeout(
        ULONG *pmsTimeout) = 0;

    virtual HANDLE STDMETHODCALLTYPE SpeakCompleteEvent(
        ) = 0;

    virtual HRESULT STDMETHODCALLTYPE IsUISupported(
        LPCWSTR pszTypeOfUI,
        void *pvExtraData,
        ULONG cbExtraData,
        WINBOOL *pfSupported) = 0;

    virtual HRESULT STDMETHODCALLTYPE DisplayUI(
        HWND hwndParent,
        LPCWSTR pszTitle,
        LPCWSTR pszTypeOfUI,
        void *pvExtraData,
        ULONG cbExtraData) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpVoice, 0x6c44df74, 0x72b9, 0x4992, 0xa1,0xec, 0xef,0x99,0x6e,0x04,0x22,0xd4)
#endif
#else
typedef struct ISpVoiceVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpVoice *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpVoice *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpVoice *This);

    /*** ISpNotifySource methods ***/
    HRESULT (STDMETHODCALLTYPE *SetNotifySink)(
        ISpVoice *This,
        ISpNotifySink *pNotifySink);

    HRESULT (STDMETHODCALLTYPE *SetNotifyWindowMessage)(
        ISpVoice *This,
        HWND hWnd,
        UINT Msg,
        WPARAM wParam,
        LPARAM lParam);

    HRESULT (STDMETHODCALLTYPE *SetNotifyCallbackFunction)(
        ISpVoice *This,
        SPNOTIFYCALLBACK *pfnCallback,
        WPARAM wParam,
        LPARAM lParam);

    HRESULT (STDMETHODCALLTYPE *SetNotifyCallbackInterface)(
        ISpVoice *This,
        ISpNotifyCallback *pSpCallback,
        WPARAM wParam,
        LPARAM lParam);

    HRESULT (STDMETHODCALLTYPE *SetNotifyWin32Event)(
        ISpVoice *This);

    HRESULT (STDMETHODCALLTYPE *WaitForNotifyEvent)(
        ISpVoice *This,
        DWORD dwMilliseconds);

    HANDLE (STDMETHODCALLTYPE *GetNotifyEventHandle)(
        ISpVoice *This);

    /*** ISpEventSource methods ***/
    HRESULT (STDMETHODCALLTYPE *SetInterest)(
        ISpVoice *This,
        ULONGLONG ullEventInterest,
        ULONGLONG ullQueuedInterest);

    HRESULT (STDMETHODCALLTYPE *GetEvents)(
        ISpVoice *This,
        ULONG ulCount,
        SPEVENT *pEventArray,
        ULONG *pulFetched);

    HRESULT (STDMETHODCALLTYPE *GetInfo)(
        ISpVoice *This,
        SPEVENTSOURCEINFO *pInfo);

    /*** ISpVoice methods ***/
    HRESULT (STDMETHODCALLTYPE *SetOutput)(
        ISpVoice *This,
        IUnknown *pUnkOutput,
        WINBOOL fAllowFormatChanges);

    HRESULT (STDMETHODCALLTYPE *GetOutputObjectToken)(
        ISpVoice *This,
        ISpObjectToken **ppObjectToken);

    HRESULT (STDMETHODCALLTYPE *GetOutputStream)(
        ISpVoice *This,
        ISpStreamFormat **ppStream);

    HRESULT (STDMETHODCALLTYPE *Pause)(
        ISpVoice *This);

    HRESULT (STDMETHODCALLTYPE *Resume)(
        ISpVoice *This);

    HRESULT (STDMETHODCALLTYPE *SetVoice)(
        ISpVoice *This,
        ISpObjectToken *pToken);

    HRESULT (STDMETHODCALLTYPE *GetVoice)(
        ISpVoice *This,
        ISpObjectToken **ppToken);

    HRESULT (STDMETHODCALLTYPE *Speak)(
        ISpVoice *This,
        LPCWSTR pwcs,
        DWORD dwFlags,
        ULONG *pulStreamNumber);

    HRESULT (STDMETHODCALLTYPE *SpeakStream)(
        ISpVoice *This,
        IStream *pStream,
        DWORD dwFlags,
        ULONG *pulStreamNumber);

    HRESULT (STDMETHODCALLTYPE *GetStatus)(
        ISpVoice *This,
        SPVOICESTATUS *pStatus,
        LPWSTR *ppszLastBookmark);

    HRESULT (STDMETHODCALLTYPE *Skip)(
        ISpVoice *This,
        LPCWSTR pItemType,
        LONG lNumItems,
        ULONG *pulNumSkipped);

    HRESULT (STDMETHODCALLTYPE *SetPriority)(
        ISpVoice *This,
        SPVPRIORITY ePriority);

    HRESULT (STDMETHODCALLTYPE *GetPriority)(
        ISpVoice *This,
        SPVPRIORITY *pePriority);

    HRESULT (STDMETHODCALLTYPE *SetAlertBoundary)(
        ISpVoice *This,
        SPEVENTENUM eBoundary);

    HRESULT (STDMETHODCALLTYPE *GetAlertBoundary)(
        ISpVoice *This,
        SPEVENTENUM *peBoundary);

    HRESULT (STDMETHODCALLTYPE *SetRate)(
        ISpVoice *This,
        LONG RateAdjust);

    HRESULT (STDMETHODCALLTYPE *GetRate)(
        ISpVoice *This,
        LONG *pRateAdjust);

    HRESULT (STDMETHODCALLTYPE *SetVolume)(
        ISpVoice *This,
        USHORT usVolume);

    HRESULT (STDMETHODCALLTYPE *GetVolume)(
        ISpVoice *This,
        USHORT *pusVolume);

    HRESULT (STDMETHODCALLTYPE *WaitUntilDone)(
        ISpVoice *This,
        ULONG msTimeout);

    HRESULT (STDMETHODCALLTYPE *SetSyncSpeakTimeout)(
        ISpVoice *This,
        ULONG msTimeout);

    HRESULT (STDMETHODCALLTYPE *GetSyncSpeakTimeout)(
        ISpVoice *This,
        ULONG *pmsTimeout);

    HANDLE (STDMETHODCALLTYPE *SpeakCompleteEvent)(
        ISpVoice *This);

    HRESULT (STDMETHODCALLTYPE *IsUISupported)(
        ISpVoice *This,
        LPCWSTR pszTypeOfUI,
        void *pvExtraData,
        ULONG cbExtraData,
        WINBOOL *pfSupported);

    HRESULT (STDMETHODCALLTYPE *DisplayUI)(
        ISpVoice *This,
        HWND hwndParent,
        LPCWSTR pszTitle,
        LPCWSTR pszTypeOfUI,
        void *pvExtraData,
        ULONG cbExtraData);

    END_INTERFACE
} ISpVoiceVtbl;

interface ISpVoice {
    CONST_VTBL ISpVoiceVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpVoice_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpVoice_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpVoice_Release(This) (This)->lpVtbl->Release(This)
/*** ISpNotifySource methods ***/
#define ISpVoice_SetNotifySink(This,pNotifySink) (This)->lpVtbl->SetNotifySink(This,pNotifySink)
#define ISpVoice_SetNotifyWindowMessage(This,hWnd,Msg,wParam,lParam) (This)->lpVtbl->SetNotifyWindowMessage(This,hWnd,Msg,wParam,lParam)
#define ISpVoice_SetNotifyCallbackFunction(This,pfnCallback,wParam,lParam) (This)->lpVtbl->SetNotifyCallbackFunction(This,pfnCallback,wParam,lParam)
#define ISpVoice_SetNotifyCallbackInterface(This,pSpCallback,wParam,lParam) (This)->lpVtbl->SetNotifyCallbackInterface(This,pSpCallback,wParam,lParam)
#define ISpVoice_SetNotifyWin32Event(This) (This)->lpVtbl->SetNotifyWin32Event(This)
#define ISpVoice_WaitForNotifyEvent(This,dwMilliseconds) (This)->lpVtbl->WaitForNotifyEvent(This,dwMilliseconds)
#define ISpVoice_GetNotifyEventHandle(This) (This)->lpVtbl->GetNotifyEventHandle(This)
/*** ISpEventSource methods ***/
#define ISpVoice_SetInterest(This,ullEventInterest,ullQueuedInterest) (This)->lpVtbl->SetInterest(This,ullEventInterest,ullQueuedInterest)
#define ISpVoice_GetEvents(This,ulCount,pEventArray,pulFetched) (This)->lpVtbl->GetEvents(This,ulCount,pEventArray,pulFetched)
#define ISpVoice_GetInfo(This,pInfo) (This)->lpVtbl->GetInfo(This,pInfo)
/*** ISpVoice methods ***/
#define ISpVoice_SetOutput(This,pUnkOutput,fAllowFormatChanges) (This)->lpVtbl->SetOutput(This,pUnkOutput,fAllowFormatChanges)
#define ISpVoice_GetOutputObjectToken(This,ppObjectToken) (This)->lpVtbl->GetOutputObjectToken(This,ppObjectToken)
#define ISpVoice_GetOutputStream(This,ppStream) (This)->lpVtbl->GetOutputStream(This,ppStream)
#define ISpVoice_Pause(This) (This)->lpVtbl->Pause(This)
#define ISpVoice_Resume(This) (This)->lpVtbl->Resume(This)
#define ISpVoice_SetVoice(This,pToken) (This)->lpVtbl->SetVoice(This,pToken)
#define ISpVoice_GetVoice(This,ppToken) (This)->lpVtbl->GetVoice(This,ppToken)
#define ISpVoice_Speak(This,pwcs,dwFlags,pulStreamNumber) (This)->lpVtbl->Speak(This,pwcs,dwFlags,pulStreamNumber)
#define ISpVoice_SpeakStream(This,pStream,dwFlags,pulStreamNumber) (This)->lpVtbl->SpeakStream(This,pStream,dwFlags,pulStreamNumber)
#define ISpVoice_GetStatus(This,pStatus,ppszLastBookmark) (This)->lpVtbl->GetStatus(This,pStatus,ppszLastBookmark)
#define ISpVoice_Skip(This,pItemType,lNumItems,pulNumSkipped) (This)->lpVtbl->Skip(This,pItemType,lNumItems,pulNumSkipped)
#define ISpVoice_SetPriority(This,ePriority) (This)->lpVtbl->SetPriority(This,ePriority)
#define ISpVoice_GetPriority(This,pePriority) (This)->lpVtbl->GetPriority(This,pePriority)
#define ISpVoice_SetAlertBoundary(This,eBoundary) (This)->lpVtbl->SetAlertBoundary(This,eBoundary)
#define ISpVoice_GetAlertBoundary(This,peBoundary) (This)->lpVtbl->GetAlertBoundary(This,peBoundary)
#define ISpVoice_SetRate(This,RateAdjust) (This)->lpVtbl->SetRate(This,RateAdjust)
#define ISpVoice_GetRate(This,pRateAdjust) (This)->lpVtbl->GetRate(This,pRateAdjust)
#define ISpVoice_SetVolume(This,usVolume) (This)->lpVtbl->SetVolume(This,usVolume)
#define ISpVoice_GetVolume(This,pusVolume) (This)->lpVtbl->GetVolume(This,pusVolume)
#define ISpVoice_WaitUntilDone(This,msTimeout) (This)->lpVtbl->WaitUntilDone(This,msTimeout)
#define ISpVoice_SetSyncSpeakTimeout(This,msTimeout) (This)->lpVtbl->SetSyncSpeakTimeout(This,msTimeout)
#define ISpVoice_GetSyncSpeakTimeout(This,pmsTimeout) (This)->lpVtbl->GetSyncSpeakTimeout(This,pmsTimeout)
#define ISpVoice_SpeakCompleteEvent(This) (This)->lpVtbl->SpeakCompleteEvent(This)
#define ISpVoice_IsUISupported(This,pszTypeOfUI,pvExtraData,cbExtraData,pfSupported) (This)->lpVtbl->IsUISupported(This,pszTypeOfUI,pvExtraData,cbExtraData,pfSupported)
#define ISpVoice_DisplayUI(This,hwndParent,pszTitle,pszTypeOfUI,pvExtraData,cbExtraData) (This)->lpVtbl->DisplayUI(This,hwndParent,pszTitle,pszTypeOfUI,pvExtraData,cbExtraData)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpVoice_QueryInterface(ISpVoice* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpVoice_AddRef(ISpVoice* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpVoice_Release(ISpVoice* This) {
    return This->lpVtbl->Release(This);
}
/*** ISpNotifySource methods ***/
static FORCEINLINE HRESULT ISpVoice_SetNotifySink(ISpVoice* This,ISpNotifySink *pNotifySink) {
    return This->lpVtbl->SetNotifySink(This,pNotifySink);
}
static FORCEINLINE HRESULT ISpVoice_SetNotifyWindowMessage(ISpVoice* This,HWND hWnd,UINT Msg,WPARAM wParam,LPARAM lParam) {
    return This->lpVtbl->SetNotifyWindowMessage(This,hWnd,Msg,wParam,lParam);
}
static FORCEINLINE HRESULT ISpVoice_SetNotifyCallbackFunction(ISpVoice* This,SPNOTIFYCALLBACK *pfnCallback,WPARAM wParam,LPARAM lParam) {
    return This->lpVtbl->SetNotifyCallbackFunction(This,pfnCallback,wParam,lParam);
}
static FORCEINLINE HRESULT ISpVoice_SetNotifyCallbackInterface(ISpVoice* This,ISpNotifyCallback *pSpCallback,WPARAM wParam,LPARAM lParam) {
    return This->lpVtbl->SetNotifyCallbackInterface(This,pSpCallback,wParam,lParam);
}
static FORCEINLINE HRESULT ISpVoice_SetNotifyWin32Event(ISpVoice* This) {
    return This->lpVtbl->SetNotifyWin32Event(This);
}
static FORCEINLINE HRESULT ISpVoice_WaitForNotifyEvent(ISpVoice* This,DWORD dwMilliseconds) {
    return This->lpVtbl->WaitForNotifyEvent(This,dwMilliseconds);
}
static FORCEINLINE HANDLE ISpVoice_GetNotifyEventHandle(ISpVoice* This) {
    return This->lpVtbl->GetNotifyEventHandle(This);
}
/*** ISpEventSource methods ***/
static FORCEINLINE HRESULT ISpVoice_SetInterest(ISpVoice* This,ULONGLONG ullEventInterest,ULONGLONG ullQueuedInterest) {
    return This->lpVtbl->SetInterest(This,ullEventInterest,ullQueuedInterest);
}
static FORCEINLINE HRESULT ISpVoice_GetEvents(ISpVoice* This,ULONG ulCount,SPEVENT *pEventArray,ULONG *pulFetched) {
    return This->lpVtbl->GetEvents(This,ulCount,pEventArray,pulFetched);
}
static FORCEINLINE HRESULT ISpVoice_GetInfo(ISpVoice* This,SPEVENTSOURCEINFO *pInfo) {
    return This->lpVtbl->GetInfo(This,pInfo);
}
/*** ISpVoice methods ***/
static FORCEINLINE HRESULT ISpVoice_SetOutput(ISpVoice* This,IUnknown *pUnkOutput,WINBOOL fAllowFormatChanges) {
    return This->lpVtbl->SetOutput(This,pUnkOutput,fAllowFormatChanges);
}
static FORCEINLINE HRESULT ISpVoice_GetOutputObjectToken(ISpVoice* This,ISpObjectToken **ppObjectToken) {
    return This->lpVtbl->GetOutputObjectToken(This,ppObjectToken);
}
static FORCEINLINE HRESULT ISpVoice_GetOutputStream(ISpVoice* This,ISpStreamFormat **ppStream) {
    return This->lpVtbl->GetOutputStream(This,ppStream);
}
static FORCEINLINE HRESULT ISpVoice_Pause(ISpVoice* This) {
    return This->lpVtbl->Pause(This);
}
static FORCEINLINE HRESULT ISpVoice_Resume(ISpVoice* This) {
    return This->lpVtbl->Resume(This);
}
static FORCEINLINE HRESULT ISpVoice_SetVoice(ISpVoice* This,ISpObjectToken *pToken) {
    return This->lpVtbl->SetVoice(This,pToken);
}
static FORCEINLINE HRESULT ISpVoice_GetVoice(ISpVoice* This,ISpObjectToken **ppToken) {
    return This->lpVtbl->GetVoice(This,ppToken);
}
static FORCEINLINE HRESULT ISpVoice_Speak(ISpVoice* This,LPCWSTR pwcs,DWORD dwFlags,ULONG *pulStreamNumber) {
    return This->lpVtbl->Speak(This,pwcs,dwFlags,pulStreamNumber);
}
static FORCEINLINE HRESULT ISpVoice_SpeakStream(ISpVoice* This,IStream *pStream,DWORD dwFlags,ULONG *pulStreamNumber) {
    return This->lpVtbl->SpeakStream(This,pStream,dwFlags,pulStreamNumber);
}
static FORCEINLINE HRESULT ISpVoice_GetStatus(ISpVoice* This,SPVOICESTATUS *pStatus,LPWSTR *ppszLastBookmark) {
    return This->lpVtbl->GetStatus(This,pStatus,ppszLastBookmark);
}
static FORCEINLINE HRESULT ISpVoice_Skip(ISpVoice* This,LPCWSTR pItemType,LONG lNumItems,ULONG *pulNumSkipped) {
    return This->lpVtbl->Skip(This,pItemType,lNumItems,pulNumSkipped);
}
static FORCEINLINE HRESULT ISpVoice_SetPriority(ISpVoice* This,SPVPRIORITY ePriority) {
    return This->lpVtbl->SetPriority(This,ePriority);
}
static FORCEINLINE HRESULT ISpVoice_GetPriority(ISpVoice* This,SPVPRIORITY *pePriority) {
    return This->lpVtbl->GetPriority(This,pePriority);
}
static FORCEINLINE HRESULT ISpVoice_SetAlertBoundary(ISpVoice* This,SPEVENTENUM eBoundary) {
    return This->lpVtbl->SetAlertBoundary(This,eBoundary);
}
static FORCEINLINE HRESULT ISpVoice_GetAlertBoundary(ISpVoice* This,SPEVENTENUM *peBoundary) {
    return This->lpVtbl->GetAlertBoundary(This,peBoundary);
}
static FORCEINLINE HRESULT ISpVoice_SetRate(ISpVoice* This,LONG RateAdjust) {
    return This->lpVtbl->SetRate(This,RateAdjust);
}
static FORCEINLINE HRESULT ISpVoice_GetRate(ISpVoice* This,LONG *pRateAdjust) {
    return This->lpVtbl->GetRate(This,pRateAdjust);
}
static FORCEINLINE HRESULT ISpVoice_SetVolume(ISpVoice* This,USHORT usVolume) {
    return This->lpVtbl->SetVolume(This,usVolume);
}
static FORCEINLINE HRESULT ISpVoice_GetVolume(ISpVoice* This,USHORT *pusVolume) {
    return This->lpVtbl->GetVolume(This,pusVolume);
}
static FORCEINLINE HRESULT ISpVoice_WaitUntilDone(ISpVoice* This,ULONG msTimeout) {
    return This->lpVtbl->WaitUntilDone(This,msTimeout);
}
static FORCEINLINE HRESULT ISpVoice_SetSyncSpeakTimeout(ISpVoice* This,ULONG msTimeout) {
    return This->lpVtbl->SetSyncSpeakTimeout(This,msTimeout);
}
static FORCEINLINE HRESULT ISpVoice_GetSyncSpeakTimeout(ISpVoice* This,ULONG *pmsTimeout) {
    return This->lpVtbl->GetSyncSpeakTimeout(This,pmsTimeout);
}
static FORCEINLINE HANDLE ISpVoice_SpeakCompleteEvent(ISpVoice* This) {
    return This->lpVtbl->SpeakCompleteEvent(This);
}
static FORCEINLINE HRESULT ISpVoice_IsUISupported(ISpVoice* This,LPCWSTR pszTypeOfUI,void *pvExtraData,ULONG cbExtraData,WINBOOL *pfSupported) {
    return This->lpVtbl->IsUISupported(This,pszTypeOfUI,pvExtraData,cbExtraData,pfSupported);
}
static FORCEINLINE HRESULT ISpVoice_DisplayUI(ISpVoice* This,HWND hwndParent,LPCWSTR pszTitle,LPCWSTR pszTypeOfUI,void *pvExtraData,ULONG cbExtraData) {
    return This->lpVtbl->DisplayUI(This,hwndParent,pszTitle,pszTypeOfUI,pvExtraData,cbExtraData);
}
#endif
#endif

#endif


#endif  /* __ISpVoice_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpPhrase interface
 */
#ifndef __ISpPhrase_INTERFACE_DEFINED__
#define __ISpPhrase_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpPhrase, 0x1a5c0354, 0xb621, 0x4b5a, 0x87,0x91, 0xd3,0x06,0xed,0x37,0x9e,0x53);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("1a5c0354-b621-4b5a-8791-d306ed379e53")
ISpPhrase : public IUnknown
{
    virtual HRESULT STDMETHODCALLTYPE GetPhrase(
        SPPHRASE **ppCoMemPhrase) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetSerializedPhrase(
        SPSERIALIZEDPHRASE **ppCoMemPhrase) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetText(
        ULONG ulStart,
        ULONG ulCount,
        WINBOOL fUseTextReplacements,
        LPWSTR *ppszCoMemText,
        BYTE *pbDisplayAttributes) = 0;

    virtual HRESULT STDMETHODCALLTYPE Discard(
        DWORD dwValueTypes) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpPhrase, 0x1a5c0354, 0xb621, 0x4b5a, 0x87,0x91, 0xd3,0x06,0xed,0x37,0x9e,0x53)
#endif
#else
typedef struct ISpPhraseVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpPhrase *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpPhrase *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpPhrase *This);

    /*** ISpPhrase methods ***/
    HRESULT (STDMETHODCALLTYPE *GetPhrase)(
        ISpPhrase *This,
        SPPHRASE **ppCoMemPhrase);

    HRESULT (STDMETHODCALLTYPE *GetSerializedPhrase)(
        ISpPhrase *This,
        SPSERIALIZEDPHRASE **ppCoMemPhrase);

    HRESULT (STDMETHODCALLTYPE *GetText)(
        ISpPhrase *This,
        ULONG ulStart,
        ULONG ulCount,
        WINBOOL fUseTextReplacements,
        LPWSTR *ppszCoMemText,
        BYTE *pbDisplayAttributes);

    HRESULT (STDMETHODCALLTYPE *Discard)(
        ISpPhrase *This,
        DWORD dwValueTypes);

    END_INTERFACE
} ISpPhraseVtbl;

interface ISpPhrase {
    CONST_VTBL ISpPhraseVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpPhrase_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpPhrase_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpPhrase_Release(This) (This)->lpVtbl->Release(This)
/*** ISpPhrase methods ***/
#define ISpPhrase_GetPhrase(This,ppCoMemPhrase) (This)->lpVtbl->GetPhrase(This,ppCoMemPhrase)
#define ISpPhrase_GetSerializedPhrase(This,ppCoMemPhrase) (This)->lpVtbl->GetSerializedPhrase(This,ppCoMemPhrase)
#define ISpPhrase_GetText(This,ulStart,ulCount,fUseTextReplacements,ppszCoMemText,pbDisplayAttributes) (This)->lpVtbl->GetText(This,ulStart,ulCount,fUseTextReplacements,ppszCoMemText,pbDisplayAttributes)
#define ISpPhrase_Discard(This,dwValueTypes) (This)->lpVtbl->Discard(This,dwValueTypes)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpPhrase_QueryInterface(ISpPhrase* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpPhrase_AddRef(ISpPhrase* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpPhrase_Release(ISpPhrase* This) {
    return This->lpVtbl->Release(This);
}
/*** ISpPhrase methods ***/
static FORCEINLINE HRESULT ISpPhrase_GetPhrase(ISpPhrase* This,SPPHRASE **ppCoMemPhrase) {
    return This->lpVtbl->GetPhrase(This,ppCoMemPhrase);
}
static FORCEINLINE HRESULT ISpPhrase_GetSerializedPhrase(ISpPhrase* This,SPSERIALIZEDPHRASE **ppCoMemPhrase) {
    return This->lpVtbl->GetSerializedPhrase(This,ppCoMemPhrase);
}
static FORCEINLINE HRESULT ISpPhrase_GetText(ISpPhrase* This,ULONG ulStart,ULONG ulCount,WINBOOL fUseTextReplacements,LPWSTR *ppszCoMemText,BYTE *pbDisplayAttributes) {
    return This->lpVtbl->GetText(This,ulStart,ulCount,fUseTextReplacements,ppszCoMemText,pbDisplayAttributes);
}
static FORCEINLINE HRESULT ISpPhrase_Discard(ISpPhrase* This,DWORD dwValueTypes) {
    return This->lpVtbl->Discard(This,dwValueTypes);
}
#endif
#endif

#endif


#endif  /* __ISpPhrase_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpPhraseAlt interface
 */
#ifndef __ISpPhraseAlt_INTERFACE_DEFINED__
#define __ISpPhraseAlt_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpPhraseAlt, 0x8fcebc98, 0x4e49, 0x4067, 0x9c,0x6c, 0xd8,0x6a,0x0e,0x09,0x2e,0x3d);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("8fcebc98-4e49-4067-9c6c-d86a0e092e3d")
ISpPhraseAlt : public ISpPhrase
{
    virtual HRESULT STDMETHODCALLTYPE GetAltInfo(
        ISpPhrase **ppParent,
        ULONG *pulStartElementInParent,
        ULONG *pcElementsInParent,
        ULONG *pcElementsInAlt) = 0;

    virtual HRESULT STDMETHODCALLTYPE Commit(
        ) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpPhraseAlt, 0x8fcebc98, 0x4e49, 0x4067, 0x9c,0x6c, 0xd8,0x6a,0x0e,0x09,0x2e,0x3d)
#endif
#else
typedef struct ISpPhraseAltVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpPhraseAlt *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpPhraseAlt *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpPhraseAlt *This);

    /*** ISpPhrase methods ***/
    HRESULT (STDMETHODCALLTYPE *GetPhrase)(
        ISpPhraseAlt *This,
        SPPHRASE **ppCoMemPhrase);

    HRESULT (STDMETHODCALLTYPE *GetSerializedPhrase)(
        ISpPhraseAlt *This,
        SPSERIALIZEDPHRASE **ppCoMemPhrase);

    HRESULT (STDMETHODCALLTYPE *GetText)(
        ISpPhraseAlt *This,
        ULONG ulStart,
        ULONG ulCount,
        WINBOOL fUseTextReplacements,
        LPWSTR *ppszCoMemText,
        BYTE *pbDisplayAttributes);

    HRESULT (STDMETHODCALLTYPE *Discard)(
        ISpPhraseAlt *This,
        DWORD dwValueTypes);

    /*** ISpPhraseAlt methods ***/
    HRESULT (STDMETHODCALLTYPE *GetAltInfo)(
        ISpPhraseAlt *This,
        ISpPhrase **ppParent,
        ULONG *pulStartElementInParent,
        ULONG *pcElementsInParent,
        ULONG *pcElementsInAlt);

    HRESULT (STDMETHODCALLTYPE *Commit)(
        ISpPhraseAlt *This);

    END_INTERFACE
} ISpPhraseAltVtbl;

interface ISpPhraseAlt {
    CONST_VTBL ISpPhraseAltVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpPhraseAlt_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpPhraseAlt_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpPhraseAlt_Release(This) (This)->lpVtbl->Release(This)
/*** ISpPhrase methods ***/
#define ISpPhraseAlt_GetPhrase(This,ppCoMemPhrase) (This)->lpVtbl->GetPhrase(This,ppCoMemPhrase)
#define ISpPhraseAlt_GetSerializedPhrase(This,ppCoMemPhrase) (This)->lpVtbl->GetSerializedPhrase(This,ppCoMemPhrase)
#define ISpPhraseAlt_GetText(This,ulStart,ulCount,fUseTextReplacements,ppszCoMemText,pbDisplayAttributes) (This)->lpVtbl->GetText(This,ulStart,ulCount,fUseTextReplacements,ppszCoMemText,pbDisplayAttributes)
#define ISpPhraseAlt_Discard(This,dwValueTypes) (This)->lpVtbl->Discard(This,dwValueTypes)
/*** ISpPhraseAlt methods ***/
#define ISpPhraseAlt_GetAltInfo(This,ppParent,pulStartElementInParent,pcElementsInParent,pcElementsInAlt) (This)->lpVtbl->GetAltInfo(This,ppParent,pulStartElementInParent,pcElementsInParent,pcElementsInAlt)
#define ISpPhraseAlt_Commit(This) (This)->lpVtbl->Commit(This)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpPhraseAlt_QueryInterface(ISpPhraseAlt* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpPhraseAlt_AddRef(ISpPhraseAlt* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpPhraseAlt_Release(ISpPhraseAlt* This) {
    return This->lpVtbl->Release(This);
}
/*** ISpPhrase methods ***/
static FORCEINLINE HRESULT ISpPhraseAlt_GetPhrase(ISpPhraseAlt* This,SPPHRASE **ppCoMemPhrase) {
    return This->lpVtbl->GetPhrase(This,ppCoMemPhrase);
}
static FORCEINLINE HRESULT ISpPhraseAlt_GetSerializedPhrase(ISpPhraseAlt* This,SPSERIALIZEDPHRASE **ppCoMemPhrase) {
    return This->lpVtbl->GetSerializedPhrase(This,ppCoMemPhrase);
}
static FORCEINLINE HRESULT ISpPhraseAlt_GetText(ISpPhraseAlt* This,ULONG ulStart,ULONG ulCount,WINBOOL fUseTextReplacements,LPWSTR *ppszCoMemText,BYTE *pbDisplayAttributes) {
    return This->lpVtbl->GetText(This,ulStart,ulCount,fUseTextReplacements,ppszCoMemText,pbDisplayAttributes);
}
static FORCEINLINE HRESULT ISpPhraseAlt_Discard(ISpPhraseAlt* This,DWORD dwValueTypes) {
    return This->lpVtbl->Discard(This,dwValueTypes);
}
/*** ISpPhraseAlt methods ***/
static FORCEINLINE HRESULT ISpPhraseAlt_GetAltInfo(ISpPhraseAlt* This,ISpPhrase **ppParent,ULONG *pulStartElementInParent,ULONG *pcElementsInParent,ULONG *pcElementsInAlt) {
    return This->lpVtbl->GetAltInfo(This,ppParent,pulStartElementInParent,pcElementsInParent,pcElementsInAlt);
}
static FORCEINLINE HRESULT ISpPhraseAlt_Commit(ISpPhraseAlt* This) {
    return This->lpVtbl->Commit(This);
}
#endif
#endif

#endif


#endif  /* __ISpPhraseAlt_INTERFACE_DEFINED__ */

typedef enum SPXMLRESULTOPTIONS {
    SPXRO_SML = 0,
    SPXRO_Alternates_SML = 1
} SPXMLRESULTOPTIONS;
/*****************************************************************************
 * ISpPhrase2 interface
 */
#ifndef __ISpPhrase2_INTERFACE_DEFINED__
#define __ISpPhrase2_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpPhrase2, 0xf264da52, 0xe457, 0x4696, 0xb8,0x56, 0xa7,0x37,0xb7,0x17,0xaf,0x79);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("f264da52-e457-4696-b856-a737b717af79")
ISpPhrase2 : public ISpPhrase
{
    virtual HRESULT STDMETHODCALLTYPE GetXMLResult(
        LPWSTR *ppszCoMemXMLResult,
        SPXMLRESULTOPTIONS Options) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetXMLErrorInfo(
        SPSEMANTICERRORINFO *pSemanticErrorInfo) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetAudio(
        ULONG ulStartElement,
        ULONG cElements,
        ISpStreamFormat **ppStream) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpPhrase2, 0xf264da52, 0xe457, 0x4696, 0xb8,0x56, 0xa7,0x37,0xb7,0x17,0xaf,0x79)
#endif
#else
typedef struct ISpPhrase2Vtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpPhrase2 *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpPhrase2 *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpPhrase2 *This);

    /*** ISpPhrase methods ***/
    HRESULT (STDMETHODCALLTYPE *GetPhrase)(
        ISpPhrase2 *This,
        SPPHRASE **ppCoMemPhrase);

    HRESULT (STDMETHODCALLTYPE *GetSerializedPhrase)(
        ISpPhrase2 *This,
        SPSERIALIZEDPHRASE **ppCoMemPhrase);

    HRESULT (STDMETHODCALLTYPE *GetText)(
        ISpPhrase2 *This,
        ULONG ulStart,
        ULONG ulCount,
        WINBOOL fUseTextReplacements,
        LPWSTR *ppszCoMemText,
        BYTE *pbDisplayAttributes);

    HRESULT (STDMETHODCALLTYPE *Discard)(
        ISpPhrase2 *This,
        DWORD dwValueTypes);

    /*** ISpPhrase2 methods ***/
    HRESULT (STDMETHODCALLTYPE *GetXMLResult)(
        ISpPhrase2 *This,
        LPWSTR *ppszCoMemXMLResult,
        SPXMLRESULTOPTIONS Options);

    HRESULT (STDMETHODCALLTYPE *GetXMLErrorInfo)(
        ISpPhrase2 *This,
        SPSEMANTICERRORINFO *pSemanticErrorInfo);

    HRESULT (STDMETHODCALLTYPE *GetAudio)(
        ISpPhrase2 *This,
        ULONG ulStartElement,
        ULONG cElements,
        ISpStreamFormat **ppStream);

    END_INTERFACE
} ISpPhrase2Vtbl;

interface ISpPhrase2 {
    CONST_VTBL ISpPhrase2Vtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpPhrase2_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpPhrase2_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpPhrase2_Release(This) (This)->lpVtbl->Release(This)
/*** ISpPhrase methods ***/
#define ISpPhrase2_GetPhrase(This,ppCoMemPhrase) (This)->lpVtbl->GetPhrase(This,ppCoMemPhrase)
#define ISpPhrase2_GetSerializedPhrase(This,ppCoMemPhrase) (This)->lpVtbl->GetSerializedPhrase(This,ppCoMemPhrase)
#define ISpPhrase2_GetText(This,ulStart,ulCount,fUseTextReplacements,ppszCoMemText,pbDisplayAttributes) (This)->lpVtbl->GetText(This,ulStart,ulCount,fUseTextReplacements,ppszCoMemText,pbDisplayAttributes)
#define ISpPhrase2_Discard(This,dwValueTypes) (This)->lpVtbl->Discard(This,dwValueTypes)
/*** ISpPhrase2 methods ***/
#define ISpPhrase2_GetXMLResult(This,ppszCoMemXMLResult,Options) (This)->lpVtbl->GetXMLResult(This,ppszCoMemXMLResult,Options)
#define ISpPhrase2_GetXMLErrorInfo(This,pSemanticErrorInfo) (This)->lpVtbl->GetXMLErrorInfo(This,pSemanticErrorInfo)
#define ISpPhrase2_GetAudio(This,ulStartElement,cElements,ppStream) (This)->lpVtbl->GetAudio(This,ulStartElement,cElements,ppStream)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpPhrase2_QueryInterface(ISpPhrase2* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpPhrase2_AddRef(ISpPhrase2* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpPhrase2_Release(ISpPhrase2* This) {
    return This->lpVtbl->Release(This);
}
/*** ISpPhrase methods ***/
static FORCEINLINE HRESULT ISpPhrase2_GetPhrase(ISpPhrase2* This,SPPHRASE **ppCoMemPhrase) {
    return This->lpVtbl->GetPhrase(This,ppCoMemPhrase);
}
static FORCEINLINE HRESULT ISpPhrase2_GetSerializedPhrase(ISpPhrase2* This,SPSERIALIZEDPHRASE **ppCoMemPhrase) {
    return This->lpVtbl->GetSerializedPhrase(This,ppCoMemPhrase);
}
static FORCEINLINE HRESULT ISpPhrase2_GetText(ISpPhrase2* This,ULONG ulStart,ULONG ulCount,WINBOOL fUseTextReplacements,LPWSTR *ppszCoMemText,BYTE *pbDisplayAttributes) {
    return This->lpVtbl->GetText(This,ulStart,ulCount,fUseTextReplacements,ppszCoMemText,pbDisplayAttributes);
}
static FORCEINLINE HRESULT ISpPhrase2_Discard(ISpPhrase2* This,DWORD dwValueTypes) {
    return This->lpVtbl->Discard(This,dwValueTypes);
}
/*** ISpPhrase2 methods ***/
static FORCEINLINE HRESULT ISpPhrase2_GetXMLResult(ISpPhrase2* This,LPWSTR *ppszCoMemXMLResult,SPXMLRESULTOPTIONS Options) {
    return This->lpVtbl->GetXMLResult(This,ppszCoMemXMLResult,Options);
}
static FORCEINLINE HRESULT ISpPhrase2_GetXMLErrorInfo(ISpPhrase2* This,SPSEMANTICERRORINFO *pSemanticErrorInfo) {
    return This->lpVtbl->GetXMLErrorInfo(This,pSemanticErrorInfo);
}
static FORCEINLINE HRESULT ISpPhrase2_GetAudio(ISpPhrase2* This,ULONG ulStartElement,ULONG cElements,ISpStreamFormat **ppStream) {
    return This->lpVtbl->GetAudio(This,ulStartElement,cElements,ppStream);
}
#endif
#endif

#endif


#endif  /* __ISpPhrase2_INTERFACE_DEFINED__ */

typedef struct SPRECORESULTTIMES {
    FILETIME ftStreamTime;
    ULONGLONG ullLength;
    DWORD dwTickCount;
    ULONGLONG ullStart;
} SPRECORESULTTIMES;
typedef struct SPSERIALIZEDRESULT {
    ULONG ulSerializedSize;
} SPSERIALIZEDRESULT;
/*****************************************************************************
 * ISpRecoResult interface
 */
#ifndef __ISpRecoResult_INTERFACE_DEFINED__
#define __ISpRecoResult_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpRecoResult, 0x20b053be, 0xe235, 0x43cd, 0x9a,0x2a, 0x8d,0x17,0xa4,0x8b,0x78,0x42);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("20b053be-e235-43cd-9a2a-8d17a48b7842")
ISpRecoResult : public ISpPhrase
{
    virtual HRESULT STDMETHODCALLTYPE GetResultTimes(
        SPRECORESULTTIMES *pTimes) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetAlternates(
        ULONG ulStartElement,
        ULONG cElements,
        ULONG ulRequestCount,
        ISpPhraseAlt **ppPhrases,
        ULONG *pcPhrasesReturned) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetAudio(
        ULONG ulStartElement,
        ULONG cElements,
        ISpStreamFormat **ppStream) = 0;

    virtual HRESULT STDMETHODCALLTYPE SpeakAudio(
        ULONG ulStartElement,
        ULONG cElements,
        DWORD dwFlags,
        ULONG *pulStreamNumber) = 0;

    virtual HRESULT STDMETHODCALLTYPE Serialize(
        SPSERIALIZEDRESULT **ppCoMemSerializedResult) = 0;

    virtual HRESULT STDMETHODCALLTYPE ScaleAudio(
        const GUID *pAudioFormatId,
        const WAVEFORMATEX *pWaveFormatEx) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetRecoContext(
        ISpRecoContext **ppRecoContext) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpRecoResult, 0x20b053be, 0xe235, 0x43cd, 0x9a,0x2a, 0x8d,0x17,0xa4,0x8b,0x78,0x42)
#endif
#else
typedef struct ISpRecoResultVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpRecoResult *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpRecoResult *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpRecoResult *This);

    /*** ISpPhrase methods ***/
    HRESULT (STDMETHODCALLTYPE *GetPhrase)(
        ISpRecoResult *This,
        SPPHRASE **ppCoMemPhrase);

    HRESULT (STDMETHODCALLTYPE *GetSerializedPhrase)(
        ISpRecoResult *This,
        SPSERIALIZEDPHRASE **ppCoMemPhrase);

    HRESULT (STDMETHODCALLTYPE *GetText)(
        ISpRecoResult *This,
        ULONG ulStart,
        ULONG ulCount,
        WINBOOL fUseTextReplacements,
        LPWSTR *ppszCoMemText,
        BYTE *pbDisplayAttributes);

    HRESULT (STDMETHODCALLTYPE *Discard)(
        ISpRecoResult *This,
        DWORD dwValueTypes);

    /*** ISpRecoResult methods ***/
    HRESULT (STDMETHODCALLTYPE *GetResultTimes)(
        ISpRecoResult *This,
        SPRECORESULTTIMES *pTimes);

    HRESULT (STDMETHODCALLTYPE *GetAlternates)(
        ISpRecoResult *This,
        ULONG ulStartElement,
        ULONG cElements,
        ULONG ulRequestCount,
        ISpPhraseAlt **ppPhrases,
        ULONG *pcPhrasesReturned);

    HRESULT (STDMETHODCALLTYPE *GetAudio)(
        ISpRecoResult *This,
        ULONG ulStartElement,
        ULONG cElements,
        ISpStreamFormat **ppStream);

    HRESULT (STDMETHODCALLTYPE *SpeakAudio)(
        ISpRecoResult *This,
        ULONG ulStartElement,
        ULONG cElements,
        DWORD dwFlags,
        ULONG *pulStreamNumber);

    HRESULT (STDMETHODCALLTYPE *Serialize)(
        ISpRecoResult *This,
        SPSERIALIZEDRESULT **ppCoMemSerializedResult);

    HRESULT (STDMETHODCALLTYPE *ScaleAudio)(
        ISpRecoResult *This,
        const GUID *pAudioFormatId,
        const WAVEFORMATEX *pWaveFormatEx);

    HRESULT (STDMETHODCALLTYPE *GetRecoContext)(
        ISpRecoResult *This,
        ISpRecoContext **ppRecoContext);

    END_INTERFACE
} ISpRecoResultVtbl;

interface ISpRecoResult {
    CONST_VTBL ISpRecoResultVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpRecoResult_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpRecoResult_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpRecoResult_Release(This) (This)->lpVtbl->Release(This)
/*** ISpPhrase methods ***/
#define ISpRecoResult_GetPhrase(This,ppCoMemPhrase) (This)->lpVtbl->GetPhrase(This,ppCoMemPhrase)
#define ISpRecoResult_GetSerializedPhrase(This,ppCoMemPhrase) (This)->lpVtbl->GetSerializedPhrase(This,ppCoMemPhrase)
#define ISpRecoResult_GetText(This,ulStart,ulCount,fUseTextReplacements,ppszCoMemText,pbDisplayAttributes) (This)->lpVtbl->GetText(This,ulStart,ulCount,fUseTextReplacements,ppszCoMemText,pbDisplayAttributes)
#define ISpRecoResult_Discard(This,dwValueTypes) (This)->lpVtbl->Discard(This,dwValueTypes)
/*** ISpRecoResult methods ***/
#define ISpRecoResult_GetResultTimes(This,pTimes) (This)->lpVtbl->GetResultTimes(This,pTimes)
#define ISpRecoResult_GetAlternates(This,ulStartElement,cElements,ulRequestCount,ppPhrases,pcPhrasesReturned) (This)->lpVtbl->GetAlternates(This,ulStartElement,cElements,ulRequestCount,ppPhrases,pcPhrasesReturned)
#define ISpRecoResult_GetAudio(This,ulStartElement,cElements,ppStream) (This)->lpVtbl->GetAudio(This,ulStartElement,cElements,ppStream)
#define ISpRecoResult_SpeakAudio(This,ulStartElement,cElements,dwFlags,pulStreamNumber) (This)->lpVtbl->SpeakAudio(This,ulStartElement,cElements,dwFlags,pulStreamNumber)
#define ISpRecoResult_Serialize(This,ppCoMemSerializedResult) (This)->lpVtbl->Serialize(This,ppCoMemSerializedResult)
#define ISpRecoResult_ScaleAudio(This,pAudioFormatId,pWaveFormatEx) (This)->lpVtbl->ScaleAudio(This,pAudioFormatId,pWaveFormatEx)
#define ISpRecoResult_GetRecoContext(This,ppRecoContext) (This)->lpVtbl->GetRecoContext(This,ppRecoContext)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpRecoResult_QueryInterface(ISpRecoResult* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpRecoResult_AddRef(ISpRecoResult* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpRecoResult_Release(ISpRecoResult* This) {
    return This->lpVtbl->Release(This);
}
/*** ISpPhrase methods ***/
static FORCEINLINE HRESULT ISpRecoResult_GetPhrase(ISpRecoResult* This,SPPHRASE **ppCoMemPhrase) {
    return This->lpVtbl->GetPhrase(This,ppCoMemPhrase);
}
static FORCEINLINE HRESULT ISpRecoResult_GetSerializedPhrase(ISpRecoResult* This,SPSERIALIZEDPHRASE **ppCoMemPhrase) {
    return This->lpVtbl->GetSerializedPhrase(This,ppCoMemPhrase);
}
static FORCEINLINE HRESULT ISpRecoResult_GetText(ISpRecoResult* This,ULONG ulStart,ULONG ulCount,WINBOOL fUseTextReplacements,LPWSTR *ppszCoMemText,BYTE *pbDisplayAttributes) {
    return This->lpVtbl->GetText(This,ulStart,ulCount,fUseTextReplacements,ppszCoMemText,pbDisplayAttributes);
}
static FORCEINLINE HRESULT ISpRecoResult_Discard(ISpRecoResult* This,DWORD dwValueTypes) {
    return This->lpVtbl->Discard(This,dwValueTypes);
}
/*** ISpRecoResult methods ***/
static FORCEINLINE HRESULT ISpRecoResult_GetResultTimes(ISpRecoResult* This,SPRECORESULTTIMES *pTimes) {
    return This->lpVtbl->GetResultTimes(This,pTimes);
}
static FORCEINLINE HRESULT ISpRecoResult_GetAlternates(ISpRecoResult* This,ULONG ulStartElement,ULONG cElements,ULONG ulRequestCount,ISpPhraseAlt **ppPhrases,ULONG *pcPhrasesReturned) {
    return This->lpVtbl->GetAlternates(This,ulStartElement,cElements,ulRequestCount,ppPhrases,pcPhrasesReturned);
}
static FORCEINLINE HRESULT ISpRecoResult_GetAudio(ISpRecoResult* This,ULONG ulStartElement,ULONG cElements,ISpStreamFormat **ppStream) {
    return This->lpVtbl->GetAudio(This,ulStartElement,cElements,ppStream);
}
static FORCEINLINE HRESULT ISpRecoResult_SpeakAudio(ISpRecoResult* This,ULONG ulStartElement,ULONG cElements,DWORD dwFlags,ULONG *pulStreamNumber) {
    return This->lpVtbl->SpeakAudio(This,ulStartElement,cElements,dwFlags,pulStreamNumber);
}
static FORCEINLINE HRESULT ISpRecoResult_Serialize(ISpRecoResult* This,SPSERIALIZEDRESULT **ppCoMemSerializedResult) {
    return This->lpVtbl->Serialize(This,ppCoMemSerializedResult);
}
static FORCEINLINE HRESULT ISpRecoResult_ScaleAudio(ISpRecoResult* This,const GUID *pAudioFormatId,const WAVEFORMATEX *pWaveFormatEx) {
    return This->lpVtbl->ScaleAudio(This,pAudioFormatId,pWaveFormatEx);
}
static FORCEINLINE HRESULT ISpRecoResult_GetRecoContext(ISpRecoResult* This,ISpRecoContext **ppRecoContext) {
    return This->lpVtbl->GetRecoContext(This,ppRecoContext);
}
#endif
#endif

#endif


#endif  /* __ISpRecoResult_INTERFACE_DEFINED__ */

typedef enum SPCOMMITFLAGS {
    SPCF_NONE = 0,
    SPCF_ADD_TO_USER_LEXICON = 1 << 0,
    SPCF_DEFINITE_CORRECTION = 1 << 1
} SPCOMMITFLAGS;
/*****************************************************************************
 * ISpRecoResult2 interface
 */
#ifndef __ISpRecoResult2_INTERFACE_DEFINED__
#define __ISpRecoResult2_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpRecoResult2, 0x27cac6c4, 0x88f2, 0x41f2, 0x88,0x17, 0x0c,0x95,0xe5,0x9f,0x1e,0x6e);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("27cac6c4-88f2-41f2-8817-0c95e59f1e6e")
ISpRecoResult2 : public ISpRecoResult
{
    virtual HRESULT STDMETHODCALLTYPE CommitAlternate(
        ISpPhraseAlt *pPhraseAlt,
        ISpRecoResult **ppNewResult) = 0;

    virtual HRESULT STDMETHODCALLTYPE CommitText(
        ULONG ulStartElement,
        ULONG cElements,
        LPCWSTR pszCorrectedData,
        DWORD eCommitFlags) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetTextFeedback(
        LPCWSTR pszFeedback,
        WINBOOL fSuccessful) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpRecoResult2, 0x27cac6c4, 0x88f2, 0x41f2, 0x88,0x17, 0x0c,0x95,0xe5,0x9f,0x1e,0x6e)
#endif
#else
typedef struct ISpRecoResult2Vtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpRecoResult2 *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpRecoResult2 *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpRecoResult2 *This);

    /*** ISpPhrase methods ***/
    HRESULT (STDMETHODCALLTYPE *GetPhrase)(
        ISpRecoResult2 *This,
        SPPHRASE **ppCoMemPhrase);

    HRESULT (STDMETHODCALLTYPE *GetSerializedPhrase)(
        ISpRecoResult2 *This,
        SPSERIALIZEDPHRASE **ppCoMemPhrase);

    HRESULT (STDMETHODCALLTYPE *GetText)(
        ISpRecoResult2 *This,
        ULONG ulStart,
        ULONG ulCount,
        WINBOOL fUseTextReplacements,
        LPWSTR *ppszCoMemText,
        BYTE *pbDisplayAttributes);

    HRESULT (STDMETHODCALLTYPE *Discard)(
        ISpRecoResult2 *This,
        DWORD dwValueTypes);

    /*** ISpRecoResult methods ***/
    HRESULT (STDMETHODCALLTYPE *GetResultTimes)(
        ISpRecoResult2 *This,
        SPRECORESULTTIMES *pTimes);

    HRESULT (STDMETHODCALLTYPE *GetAlternates)(
        ISpRecoResult2 *This,
        ULONG ulStartElement,
        ULONG cElements,
        ULONG ulRequestCount,
        ISpPhraseAlt **ppPhrases,
        ULONG *pcPhrasesReturned);

    HRESULT (STDMETHODCALLTYPE *GetAudio)(
        ISpRecoResult2 *This,
        ULONG ulStartElement,
        ULONG cElements,
        ISpStreamFormat **ppStream);

    HRESULT (STDMETHODCALLTYPE *SpeakAudio)(
        ISpRecoResult2 *This,
        ULONG ulStartElement,
        ULONG cElements,
        DWORD dwFlags,
        ULONG *pulStreamNumber);

    HRESULT (STDMETHODCALLTYPE *Serialize)(
        ISpRecoResult2 *This,
        SPSERIALIZEDRESULT **ppCoMemSerializedResult);

    HRESULT (STDMETHODCALLTYPE *ScaleAudio)(
        ISpRecoResult2 *This,
        const GUID *pAudioFormatId,
        const WAVEFORMATEX *pWaveFormatEx);

    HRESULT (STDMETHODCALLTYPE *GetRecoContext)(
        ISpRecoResult2 *This,
        ISpRecoContext **ppRecoContext);

    /*** ISpRecoResult2 methods ***/
    HRESULT (STDMETHODCALLTYPE *CommitAlternate)(
        ISpRecoResult2 *This,
        ISpPhraseAlt *pPhraseAlt,
        ISpRecoResult **ppNewResult);

    HRESULT (STDMETHODCALLTYPE *CommitText)(
        ISpRecoResult2 *This,
        ULONG ulStartElement,
        ULONG cElements,
        LPCWSTR pszCorrectedData,
        DWORD eCommitFlags);

    HRESULT (STDMETHODCALLTYPE *SetTextFeedback)(
        ISpRecoResult2 *This,
        LPCWSTR pszFeedback,
        WINBOOL fSuccessful);

    END_INTERFACE
} ISpRecoResult2Vtbl;

interface ISpRecoResult2 {
    CONST_VTBL ISpRecoResult2Vtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpRecoResult2_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpRecoResult2_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpRecoResult2_Release(This) (This)->lpVtbl->Release(This)
/*** ISpPhrase methods ***/
#define ISpRecoResult2_GetPhrase(This,ppCoMemPhrase) (This)->lpVtbl->GetPhrase(This,ppCoMemPhrase)
#define ISpRecoResult2_GetSerializedPhrase(This,ppCoMemPhrase) (This)->lpVtbl->GetSerializedPhrase(This,ppCoMemPhrase)
#define ISpRecoResult2_GetText(This,ulStart,ulCount,fUseTextReplacements,ppszCoMemText,pbDisplayAttributes) (This)->lpVtbl->GetText(This,ulStart,ulCount,fUseTextReplacements,ppszCoMemText,pbDisplayAttributes)
#define ISpRecoResult2_Discard(This,dwValueTypes) (This)->lpVtbl->Discard(This,dwValueTypes)
/*** ISpRecoResult methods ***/
#define ISpRecoResult2_GetResultTimes(This,pTimes) (This)->lpVtbl->GetResultTimes(This,pTimes)
#define ISpRecoResult2_GetAlternates(This,ulStartElement,cElements,ulRequestCount,ppPhrases,pcPhrasesReturned) (This)->lpVtbl->GetAlternates(This,ulStartElement,cElements,ulRequestCount,ppPhrases,pcPhrasesReturned)
#define ISpRecoResult2_GetAudio(This,ulStartElement,cElements,ppStream) (This)->lpVtbl->GetAudio(This,ulStartElement,cElements,ppStream)
#define ISpRecoResult2_SpeakAudio(This,ulStartElement,cElements,dwFlags,pulStreamNumber) (This)->lpVtbl->SpeakAudio(This,ulStartElement,cElements,dwFlags,pulStreamNumber)
#define ISpRecoResult2_Serialize(This,ppCoMemSerializedResult) (This)->lpVtbl->Serialize(This,ppCoMemSerializedResult)
#define ISpRecoResult2_ScaleAudio(This,pAudioFormatId,pWaveFormatEx) (This)->lpVtbl->ScaleAudio(This,pAudioFormatId,pWaveFormatEx)
#define ISpRecoResult2_GetRecoContext(This,ppRecoContext) (This)->lpVtbl->GetRecoContext(This,ppRecoContext)
/*** ISpRecoResult2 methods ***/
#define ISpRecoResult2_CommitAlternate(This,pPhraseAlt,ppNewResult) (This)->lpVtbl->CommitAlternate(This,pPhraseAlt,ppNewResult)
#define ISpRecoResult2_CommitText(This,ulStartElement,cElements,pszCorrectedData,eCommitFlags) (This)->lpVtbl->CommitText(This,ulStartElement,cElements,pszCorrectedData,eCommitFlags)
#define ISpRecoResult2_SetTextFeedback(This,pszFeedback,fSuccessful) (This)->lpVtbl->SetTextFeedback(This,pszFeedback,fSuccessful)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpRecoResult2_QueryInterface(ISpRecoResult2* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpRecoResult2_AddRef(ISpRecoResult2* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpRecoResult2_Release(ISpRecoResult2* This) {
    return This->lpVtbl->Release(This);
}
/*** ISpPhrase methods ***/
static FORCEINLINE HRESULT ISpRecoResult2_GetPhrase(ISpRecoResult2* This,SPPHRASE **ppCoMemPhrase) {
    return This->lpVtbl->GetPhrase(This,ppCoMemPhrase);
}
static FORCEINLINE HRESULT ISpRecoResult2_GetSerializedPhrase(ISpRecoResult2* This,SPSERIALIZEDPHRASE **ppCoMemPhrase) {
    return This->lpVtbl->GetSerializedPhrase(This,ppCoMemPhrase);
}
static FORCEINLINE HRESULT ISpRecoResult2_GetText(ISpRecoResult2* This,ULONG ulStart,ULONG ulCount,WINBOOL fUseTextReplacements,LPWSTR *ppszCoMemText,BYTE *pbDisplayAttributes) {
    return This->lpVtbl->GetText(This,ulStart,ulCount,fUseTextReplacements,ppszCoMemText,pbDisplayAttributes);
}
static FORCEINLINE HRESULT ISpRecoResult2_Discard(ISpRecoResult2* This,DWORD dwValueTypes) {
    return This->lpVtbl->Discard(This,dwValueTypes);
}
/*** ISpRecoResult methods ***/
static FORCEINLINE HRESULT ISpRecoResult2_GetResultTimes(ISpRecoResult2* This,SPRECORESULTTIMES *pTimes) {
    return This->lpVtbl->GetResultTimes(This,pTimes);
}
static FORCEINLINE HRESULT ISpRecoResult2_GetAlternates(ISpRecoResult2* This,ULONG ulStartElement,ULONG cElements,ULONG ulRequestCount,ISpPhraseAlt **ppPhrases,ULONG *pcPhrasesReturned) {
    return This->lpVtbl->GetAlternates(This,ulStartElement,cElements,ulRequestCount,ppPhrases,pcPhrasesReturned);
}
static FORCEINLINE HRESULT ISpRecoResult2_GetAudio(ISpRecoResult2* This,ULONG ulStartElement,ULONG cElements,ISpStreamFormat **ppStream) {
    return This->lpVtbl->GetAudio(This,ulStartElement,cElements,ppStream);
}
static FORCEINLINE HRESULT ISpRecoResult2_SpeakAudio(ISpRecoResult2* This,ULONG ulStartElement,ULONG cElements,DWORD dwFlags,ULONG *pulStreamNumber) {
    return This->lpVtbl->SpeakAudio(This,ulStartElement,cElements,dwFlags,pulStreamNumber);
}
static FORCEINLINE HRESULT ISpRecoResult2_Serialize(ISpRecoResult2* This,SPSERIALIZEDRESULT **ppCoMemSerializedResult) {
    return This->lpVtbl->Serialize(This,ppCoMemSerializedResult);
}
static FORCEINLINE HRESULT ISpRecoResult2_ScaleAudio(ISpRecoResult2* This,const GUID *pAudioFormatId,const WAVEFORMATEX *pWaveFormatEx) {
    return This->lpVtbl->ScaleAudio(This,pAudioFormatId,pWaveFormatEx);
}
static FORCEINLINE HRESULT ISpRecoResult2_GetRecoContext(ISpRecoResult2* This,ISpRecoContext **ppRecoContext) {
    return This->lpVtbl->GetRecoContext(This,ppRecoContext);
}
/*** ISpRecoResult2 methods ***/
static FORCEINLINE HRESULT ISpRecoResult2_CommitAlternate(ISpRecoResult2* This,ISpPhraseAlt *pPhraseAlt,ISpRecoResult **ppNewResult) {
    return This->lpVtbl->CommitAlternate(This,pPhraseAlt,ppNewResult);
}
static FORCEINLINE HRESULT ISpRecoResult2_CommitText(ISpRecoResult2* This,ULONG ulStartElement,ULONG cElements,LPCWSTR pszCorrectedData,DWORD eCommitFlags) {
    return This->lpVtbl->CommitText(This,ulStartElement,cElements,pszCorrectedData,eCommitFlags);
}
static FORCEINLINE HRESULT ISpRecoResult2_SetTextFeedback(ISpRecoResult2* This,LPCWSTR pszFeedback,WINBOOL fSuccessful) {
    return This->lpVtbl->SetTextFeedback(This,pszFeedback,fSuccessful);
}
#endif
#endif

#endif


#endif  /* __ISpRecoResult2_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpXMLRecoResult interface
 */
#ifndef __ISpXMLRecoResult_INTERFACE_DEFINED__
#define __ISpXMLRecoResult_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpXMLRecoResult, 0xae39362b, 0x45a8, 0x4074, 0x9b,0x9e, 0xcc,0xf4,0x9a,0xa2,0xd0,0xb6);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("ae39362b-45a8-4074-9b9e-ccf49aa2d0b6")
ISpXMLRecoResult : public ISpRecoResult
{
    virtual HRESULT STDMETHODCALLTYPE GetXMLResult(
        LPWSTR *ppszCoMemXMLResult,
        SPXMLRESULTOPTIONS Options) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetXMLErrorInfo(
        SPSEMANTICERRORINFO *pSemanticErrorInfo) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpXMLRecoResult, 0xae39362b, 0x45a8, 0x4074, 0x9b,0x9e, 0xcc,0xf4,0x9a,0xa2,0xd0,0xb6)
#endif
#else
typedef struct ISpXMLRecoResultVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpXMLRecoResult *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpXMLRecoResult *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpXMLRecoResult *This);

    /*** ISpPhrase methods ***/
    HRESULT (STDMETHODCALLTYPE *GetPhrase)(
        ISpXMLRecoResult *This,
        SPPHRASE **ppCoMemPhrase);

    HRESULT (STDMETHODCALLTYPE *GetSerializedPhrase)(
        ISpXMLRecoResult *This,
        SPSERIALIZEDPHRASE **ppCoMemPhrase);

    HRESULT (STDMETHODCALLTYPE *GetText)(
        ISpXMLRecoResult *This,
        ULONG ulStart,
        ULONG ulCount,
        WINBOOL fUseTextReplacements,
        LPWSTR *ppszCoMemText,
        BYTE *pbDisplayAttributes);

    HRESULT (STDMETHODCALLTYPE *Discard)(
        ISpXMLRecoResult *This,
        DWORD dwValueTypes);

    /*** ISpRecoResult methods ***/
    HRESULT (STDMETHODCALLTYPE *GetResultTimes)(
        ISpXMLRecoResult *This,
        SPRECORESULTTIMES *pTimes);

    HRESULT (STDMETHODCALLTYPE *GetAlternates)(
        ISpXMLRecoResult *This,
        ULONG ulStartElement,
        ULONG cElements,
        ULONG ulRequestCount,
        ISpPhraseAlt **ppPhrases,
        ULONG *pcPhrasesReturned);

    HRESULT (STDMETHODCALLTYPE *GetAudio)(
        ISpXMLRecoResult *This,
        ULONG ulStartElement,
        ULONG cElements,
        ISpStreamFormat **ppStream);

    HRESULT (STDMETHODCALLTYPE *SpeakAudio)(
        ISpXMLRecoResult *This,
        ULONG ulStartElement,
        ULONG cElements,
        DWORD dwFlags,
        ULONG *pulStreamNumber);

    HRESULT (STDMETHODCALLTYPE *Serialize)(
        ISpXMLRecoResult *This,
        SPSERIALIZEDRESULT **ppCoMemSerializedResult);

    HRESULT (STDMETHODCALLTYPE *ScaleAudio)(
        ISpXMLRecoResult *This,
        const GUID *pAudioFormatId,
        const WAVEFORMATEX *pWaveFormatEx);

    HRESULT (STDMETHODCALLTYPE *GetRecoContext)(
        ISpXMLRecoResult *This,
        ISpRecoContext **ppRecoContext);

    /*** ISpXMLRecoResult methods ***/
    HRESULT (STDMETHODCALLTYPE *GetXMLResult)(
        ISpXMLRecoResult *This,
        LPWSTR *ppszCoMemXMLResult,
        SPXMLRESULTOPTIONS Options);

    HRESULT (STDMETHODCALLTYPE *GetXMLErrorInfo)(
        ISpXMLRecoResult *This,
        SPSEMANTICERRORINFO *pSemanticErrorInfo);

    END_INTERFACE
} ISpXMLRecoResultVtbl;

interface ISpXMLRecoResult {
    CONST_VTBL ISpXMLRecoResultVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpXMLRecoResult_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpXMLRecoResult_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpXMLRecoResult_Release(This) (This)->lpVtbl->Release(This)
/*** ISpPhrase methods ***/
#define ISpXMLRecoResult_GetPhrase(This,ppCoMemPhrase) (This)->lpVtbl->GetPhrase(This,ppCoMemPhrase)
#define ISpXMLRecoResult_GetSerializedPhrase(This,ppCoMemPhrase) (This)->lpVtbl->GetSerializedPhrase(This,ppCoMemPhrase)
#define ISpXMLRecoResult_GetText(This,ulStart,ulCount,fUseTextReplacements,ppszCoMemText,pbDisplayAttributes) (This)->lpVtbl->GetText(This,ulStart,ulCount,fUseTextReplacements,ppszCoMemText,pbDisplayAttributes)
#define ISpXMLRecoResult_Discard(This,dwValueTypes) (This)->lpVtbl->Discard(This,dwValueTypes)
/*** ISpRecoResult methods ***/
#define ISpXMLRecoResult_GetResultTimes(This,pTimes) (This)->lpVtbl->GetResultTimes(This,pTimes)
#define ISpXMLRecoResult_GetAlternates(This,ulStartElement,cElements,ulRequestCount,ppPhrases,pcPhrasesReturned) (This)->lpVtbl->GetAlternates(This,ulStartElement,cElements,ulRequestCount,ppPhrases,pcPhrasesReturned)
#define ISpXMLRecoResult_GetAudio(This,ulStartElement,cElements,ppStream) (This)->lpVtbl->GetAudio(This,ulStartElement,cElements,ppStream)
#define ISpXMLRecoResult_SpeakAudio(This,ulStartElement,cElements,dwFlags,pulStreamNumber) (This)->lpVtbl->SpeakAudio(This,ulStartElement,cElements,dwFlags,pulStreamNumber)
#define ISpXMLRecoResult_Serialize(This,ppCoMemSerializedResult) (This)->lpVtbl->Serialize(This,ppCoMemSerializedResult)
#define ISpXMLRecoResult_ScaleAudio(This,pAudioFormatId,pWaveFormatEx) (This)->lpVtbl->ScaleAudio(This,pAudioFormatId,pWaveFormatEx)
#define ISpXMLRecoResult_GetRecoContext(This,ppRecoContext) (This)->lpVtbl->GetRecoContext(This,ppRecoContext)
/*** ISpXMLRecoResult methods ***/
#define ISpXMLRecoResult_GetXMLResult(This,ppszCoMemXMLResult,Options) (This)->lpVtbl->GetXMLResult(This,ppszCoMemXMLResult,Options)
#define ISpXMLRecoResult_GetXMLErrorInfo(This,pSemanticErrorInfo) (This)->lpVtbl->GetXMLErrorInfo(This,pSemanticErrorInfo)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpXMLRecoResult_QueryInterface(ISpXMLRecoResult* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpXMLRecoResult_AddRef(ISpXMLRecoResult* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpXMLRecoResult_Release(ISpXMLRecoResult* This) {
    return This->lpVtbl->Release(This);
}
/*** ISpPhrase methods ***/
static FORCEINLINE HRESULT ISpXMLRecoResult_GetPhrase(ISpXMLRecoResult* This,SPPHRASE **ppCoMemPhrase) {
    return This->lpVtbl->GetPhrase(This,ppCoMemPhrase);
}
static FORCEINLINE HRESULT ISpXMLRecoResult_GetSerializedPhrase(ISpXMLRecoResult* This,SPSERIALIZEDPHRASE **ppCoMemPhrase) {
    return This->lpVtbl->GetSerializedPhrase(This,ppCoMemPhrase);
}
static FORCEINLINE HRESULT ISpXMLRecoResult_GetText(ISpXMLRecoResult* This,ULONG ulStart,ULONG ulCount,WINBOOL fUseTextReplacements,LPWSTR *ppszCoMemText,BYTE *pbDisplayAttributes) {
    return This->lpVtbl->GetText(This,ulStart,ulCount,fUseTextReplacements,ppszCoMemText,pbDisplayAttributes);
}
static FORCEINLINE HRESULT ISpXMLRecoResult_Discard(ISpXMLRecoResult* This,DWORD dwValueTypes) {
    return This->lpVtbl->Discard(This,dwValueTypes);
}
/*** ISpRecoResult methods ***/
static FORCEINLINE HRESULT ISpXMLRecoResult_GetResultTimes(ISpXMLRecoResult* This,SPRECORESULTTIMES *pTimes) {
    return This->lpVtbl->GetResultTimes(This,pTimes);
}
static FORCEINLINE HRESULT ISpXMLRecoResult_GetAlternates(ISpXMLRecoResult* This,ULONG ulStartElement,ULONG cElements,ULONG ulRequestCount,ISpPhraseAlt **ppPhrases,ULONG *pcPhrasesReturned) {
    return This->lpVtbl->GetAlternates(This,ulStartElement,cElements,ulRequestCount,ppPhrases,pcPhrasesReturned);
}
static FORCEINLINE HRESULT ISpXMLRecoResult_GetAudio(ISpXMLRecoResult* This,ULONG ulStartElement,ULONG cElements,ISpStreamFormat **ppStream) {
    return This->lpVtbl->GetAudio(This,ulStartElement,cElements,ppStream);
}
static FORCEINLINE HRESULT ISpXMLRecoResult_SpeakAudio(ISpXMLRecoResult* This,ULONG ulStartElement,ULONG cElements,DWORD dwFlags,ULONG *pulStreamNumber) {
    return This->lpVtbl->SpeakAudio(This,ulStartElement,cElements,dwFlags,pulStreamNumber);
}
static FORCEINLINE HRESULT ISpXMLRecoResult_Serialize(ISpXMLRecoResult* This,SPSERIALIZEDRESULT **ppCoMemSerializedResult) {
    return This->lpVtbl->Serialize(This,ppCoMemSerializedResult);
}
static FORCEINLINE HRESULT ISpXMLRecoResult_ScaleAudio(ISpXMLRecoResult* This,const GUID *pAudioFormatId,const WAVEFORMATEX *pWaveFormatEx) {
    return This->lpVtbl->ScaleAudio(This,pAudioFormatId,pWaveFormatEx);
}
static FORCEINLINE HRESULT ISpXMLRecoResult_GetRecoContext(ISpXMLRecoResult* This,ISpRecoContext **ppRecoContext) {
    return This->lpVtbl->GetRecoContext(This,ppRecoContext);
}
/*** ISpXMLRecoResult methods ***/
static FORCEINLINE HRESULT ISpXMLRecoResult_GetXMLResult(ISpXMLRecoResult* This,LPWSTR *ppszCoMemXMLResult,SPXMLRESULTOPTIONS Options) {
    return This->lpVtbl->GetXMLResult(This,ppszCoMemXMLResult,Options);
}
static FORCEINLINE HRESULT ISpXMLRecoResult_GetXMLErrorInfo(ISpXMLRecoResult* This,SPSEMANTICERRORINFO *pSemanticErrorInfo) {
    return This->lpVtbl->GetXMLErrorInfo(This,pSemanticErrorInfo);
}
#endif
#endif

#endif


#endif  /* __ISpXMLRecoResult_INTERFACE_DEFINED__ */

typedef struct tagSPTEXTSELECTIONINFO {
    ULONG ulStartActiveOffset;
    ULONG cchActiveChars;
    ULONG ulStartSelection;
    ULONG cchSelection;
} SPTEXTSELECTIONINFO;
typedef enum SPWORDPRONOUNCEABLE {
    SPWP_UNKNOWN_WORD_UNPRONOUNCEABLE = 0,
    SPWP_UNKNOWN_WORD_PRONOUNCEABLE = 1,
    SPWP_KNOWN_WORD_PRONOUNCEABLE = 2
} SPWORDPRONOUNCEABLE;
typedef enum SPGRAMMARSTATE {
    SPGS_DISABLED = 0,
    SPGS_ENABLED = 1,
    SPGS_EXCLUSIVE = 3
} SPGRAMMARSTATE;
typedef enum SPCONTEXTSTATE {
    SPCS_DISABLED = 0,
    SPCS_ENABLED = 1
} SPCONTEXTSTATE;
typedef enum SPRULESTATE {
    SPRS_INACTIVE = 0,
    SPRS_ACTIVE = 1,
    SPRS_ACTIVE_WITH_AUTO_PAUSE = 3,
    SPRS_ACTIVE_USER_DELIMITED = 4
} SPRULESTATE;
#define SP_STREAMPOS_ASAP (0)

#define SP_STREAMPOS_REALTIME (-1)

#define SPRULETRANS_TEXTBUFFER (SPSTATEHANDLE) (-1)
#define SPRULETRANS_WILDCARD (SPSTATEHANDLE) (-2)
#define SPRULETRANS_DICTATION (SPSTATEHANDLE) (-3)
typedef enum SPGRAMMARWORDTYPE {
    SPWT_DISPLAY = 0,
    SPWT_LEXICAL = 1,
    SPWT_PRONUNCIATION = 2,
    SPWT_LEXICAL_NO_SPECIAL_CHARS = 3
} SPGRAMMARWORDTYPE;
typedef struct tagSPPROPERTYINFO {
    LPCWSTR pszName;
    ULONG ulId;
    LPCWSTR pszValue;
    VARIANT vValue;
} SPPROPERTYINFO;
typedef enum SPCFGRULEATTRIBUTES {
    SPRAF_TopLevel = 0x1,
    SPRAF_Active = 0x2,
    SPRAF_Export = 0x4,
    SPRAF_Import = 0x8,
    SPRAF_Interpreter = 0x10,
    SPRAF_Dynamic = 0x20,
    SPRAF_Root = 0x40,
    SPRAF_AutoPause = 0x10000,
    SPRAF_UserDelimited = 0x20000
} SPCFGRULEATTRIBUTES;
/*****************************************************************************
 * ISpGrammarBuilder interface
 */
#ifndef __ISpGrammarBuilder_INTERFACE_DEFINED__
#define __ISpGrammarBuilder_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpGrammarBuilder, 0x8137828f, 0x591a, 0x4a42, 0xbe,0x58, 0x49,0xea,0x7e,0xba,0xac,0x68);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("8137828f-591a-4a42-be58-49ea7ebaac68")
ISpGrammarBuilder : public IUnknown
{
    virtual HRESULT STDMETHODCALLTYPE ResetGrammar(
        WORD NewLanguage) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetRule(
        LPCWSTR pszRuleName,
        DWORD dwRuleId,
        DWORD dwAttributes,
        WINBOOL fCreateIfNotExist,
        SPSTATEHANDLE *phInitialState) = 0;

    virtual HRESULT STDMETHODCALLTYPE ClearRule(
        SPSTATEHANDLE hState) = 0;

    virtual HRESULT STDMETHODCALLTYPE CreateNewState(
        SPSTATEHANDLE hState,
        SPSTATEHANDLE *phState) = 0;

    virtual HRESULT STDMETHODCALLTYPE AddWordTransition(
        SPSTATEHANDLE hFromState,
        SPSTATEHANDLE hToState,
        LPCWSTR psz,
        LPCWSTR pszSeparators,
        SPGRAMMARWORDTYPE eWordType,
        float Weight,
        const SPPROPERTYINFO *pPropInfo) = 0;

    virtual HRESULT STDMETHODCALLTYPE AddRuleTransition(
        SPSTATEHANDLE hFromState,
        SPSTATEHANDLE hToState,
        SPSTATEHANDLE hRule,
        float Weight,
        const SPPROPERTYINFO *pPropInfo) = 0;

    virtual HRESULT STDMETHODCALLTYPE AddResource(
        SPSTATEHANDLE hRuleState,
        LPCWSTR pszResourceName,
        LPCWSTR pszResourceValue) = 0;

    virtual HRESULT STDMETHODCALLTYPE Commit(
        DWORD dwReserved) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpGrammarBuilder, 0x8137828f, 0x591a, 0x4a42, 0xbe,0x58, 0x49,0xea,0x7e,0xba,0xac,0x68)
#endif
#else
typedef struct ISpGrammarBuilderVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpGrammarBuilder *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpGrammarBuilder *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpGrammarBuilder *This);

    /*** ISpGrammarBuilder methods ***/
    HRESULT (STDMETHODCALLTYPE *ResetGrammar)(
        ISpGrammarBuilder *This,
        WORD NewLanguage);

    HRESULT (STDMETHODCALLTYPE *GetRule)(
        ISpGrammarBuilder *This,
        LPCWSTR pszRuleName,
        DWORD dwRuleId,
        DWORD dwAttributes,
        WINBOOL fCreateIfNotExist,
        SPSTATEHANDLE *phInitialState);

    HRESULT (STDMETHODCALLTYPE *ClearRule)(
        ISpGrammarBuilder *This,
        SPSTATEHANDLE hState);

    HRESULT (STDMETHODCALLTYPE *CreateNewState)(
        ISpGrammarBuilder *This,
        SPSTATEHANDLE hState,
        SPSTATEHANDLE *phState);

    HRESULT (STDMETHODCALLTYPE *AddWordTransition)(
        ISpGrammarBuilder *This,
        SPSTATEHANDLE hFromState,
        SPSTATEHANDLE hToState,
        LPCWSTR psz,
        LPCWSTR pszSeparators,
        SPGRAMMARWORDTYPE eWordType,
        float Weight,
        const SPPROPERTYINFO *pPropInfo);

    HRESULT (STDMETHODCALLTYPE *AddRuleTransition)(
        ISpGrammarBuilder *This,
        SPSTATEHANDLE hFromState,
        SPSTATEHANDLE hToState,
        SPSTATEHANDLE hRule,
        float Weight,
        const SPPROPERTYINFO *pPropInfo);

    HRESULT (STDMETHODCALLTYPE *AddResource)(
        ISpGrammarBuilder *This,
        SPSTATEHANDLE hRuleState,
        LPCWSTR pszResourceName,
        LPCWSTR pszResourceValue);

    HRESULT (STDMETHODCALLTYPE *Commit)(
        ISpGrammarBuilder *This,
        DWORD dwReserved);

    END_INTERFACE
} ISpGrammarBuilderVtbl;

interface ISpGrammarBuilder {
    CONST_VTBL ISpGrammarBuilderVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpGrammarBuilder_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpGrammarBuilder_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpGrammarBuilder_Release(This) (This)->lpVtbl->Release(This)
/*** ISpGrammarBuilder methods ***/
#define ISpGrammarBuilder_ResetGrammar(This,NewLanguage) (This)->lpVtbl->ResetGrammar(This,NewLanguage)
#define ISpGrammarBuilder_GetRule(This,pszRuleName,dwRuleId,dwAttributes,fCreateIfNotExist,phInitialState) (This)->lpVtbl->GetRule(This,pszRuleName,dwRuleId,dwAttributes,fCreateIfNotExist,phInitialState)
#define ISpGrammarBuilder_ClearRule(This,hState) (This)->lpVtbl->ClearRule(This,hState)
#define ISpGrammarBuilder_CreateNewState(This,hState,phState) (This)->lpVtbl->CreateNewState(This,hState,phState)
#define ISpGrammarBuilder_AddWordTransition(This,hFromState,hToState,psz,pszSeparators,eWordType,Weight,pPropInfo) (This)->lpVtbl->AddWordTransition(This,hFromState,hToState,psz,pszSeparators,eWordType,Weight,pPropInfo)
#define ISpGrammarBuilder_AddRuleTransition(This,hFromState,hToState,hRule,Weight,pPropInfo) (This)->lpVtbl->AddRuleTransition(This,hFromState,hToState,hRule,Weight,pPropInfo)
#define ISpGrammarBuilder_AddResource(This,hRuleState,pszResourceName,pszResourceValue) (This)->lpVtbl->AddResource(This,hRuleState,pszResourceName,pszResourceValue)
#define ISpGrammarBuilder_Commit(This,dwReserved) (This)->lpVtbl->Commit(This,dwReserved)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpGrammarBuilder_QueryInterface(ISpGrammarBuilder* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpGrammarBuilder_AddRef(ISpGrammarBuilder* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpGrammarBuilder_Release(ISpGrammarBuilder* This) {
    return This->lpVtbl->Release(This);
}
/*** ISpGrammarBuilder methods ***/
static FORCEINLINE HRESULT ISpGrammarBuilder_ResetGrammar(ISpGrammarBuilder* This,WORD NewLanguage) {
    return This->lpVtbl->ResetGrammar(This,NewLanguage);
}
static FORCEINLINE HRESULT ISpGrammarBuilder_GetRule(ISpGrammarBuilder* This,LPCWSTR pszRuleName,DWORD dwRuleId,DWORD dwAttributes,WINBOOL fCreateIfNotExist,SPSTATEHANDLE *phInitialState) {
    return This->lpVtbl->GetRule(This,pszRuleName,dwRuleId,dwAttributes,fCreateIfNotExist,phInitialState);
}
static FORCEINLINE HRESULT ISpGrammarBuilder_ClearRule(ISpGrammarBuilder* This,SPSTATEHANDLE hState) {
    return This->lpVtbl->ClearRule(This,hState);
}
static FORCEINLINE HRESULT ISpGrammarBuilder_CreateNewState(ISpGrammarBuilder* This,SPSTATEHANDLE hState,SPSTATEHANDLE *phState) {
    return This->lpVtbl->CreateNewState(This,hState,phState);
}
static FORCEINLINE HRESULT ISpGrammarBuilder_AddWordTransition(ISpGrammarBuilder* This,SPSTATEHANDLE hFromState,SPSTATEHANDLE hToState,LPCWSTR psz,LPCWSTR pszSeparators,SPGRAMMARWORDTYPE eWordType,float Weight,const SPPROPERTYINFO *pPropInfo) {
    return This->lpVtbl->AddWordTransition(This,hFromState,hToState,psz,pszSeparators,eWordType,Weight,pPropInfo);
}
static FORCEINLINE HRESULT ISpGrammarBuilder_AddRuleTransition(ISpGrammarBuilder* This,SPSTATEHANDLE hFromState,SPSTATEHANDLE hToState,SPSTATEHANDLE hRule,float Weight,const SPPROPERTYINFO *pPropInfo) {
    return This->lpVtbl->AddRuleTransition(This,hFromState,hToState,hRule,Weight,pPropInfo);
}
static FORCEINLINE HRESULT ISpGrammarBuilder_AddResource(ISpGrammarBuilder* This,SPSTATEHANDLE hRuleState,LPCWSTR pszResourceName,LPCWSTR pszResourceValue) {
    return This->lpVtbl->AddResource(This,hRuleState,pszResourceName,pszResourceValue);
}
static FORCEINLINE HRESULT ISpGrammarBuilder_Commit(ISpGrammarBuilder* This,DWORD dwReserved) {
    return This->lpVtbl->Commit(This,dwReserved);
}
#endif
#endif

#endif


#endif  /* __ISpGrammarBuilder_INTERFACE_DEFINED__ */

typedef enum SPLOADOPTIONS {
    SPLO_STATIC = 0,
    SPLO_DYNAMIC = 1
} SPLOADOPTIONS;
/*****************************************************************************
 * ISpRecoGrammar interface
 */
#ifndef __ISpRecoGrammar_INTERFACE_DEFINED__
#define __ISpRecoGrammar_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpRecoGrammar, 0x2177db29, 0x7f45, 0x47d0, 0x85,0x54, 0x06,0x7e,0x91,0xc8,0x05,0x02);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("2177db29-7f45-47d0-8554-067e91c80502")
ISpRecoGrammar : public ISpGrammarBuilder
{
    virtual HRESULT STDMETHODCALLTYPE GetGrammarId(
        ULONGLONG *pullGrammarId) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetRecoContext(
        ISpRecoContext **ppRecoCtxt) = 0;

    virtual HRESULT STDMETHODCALLTYPE LoadCmdFromFile(
        LPCWSTR pszFileName,
        SPLOADOPTIONS Options) = 0;

    virtual HRESULT STDMETHODCALLTYPE LoadCmdFromObject(
        REFCLSID rcid,
        LPCWSTR pszGrammarName,
        SPLOADOPTIONS Options) = 0;

    virtual HRESULT STDMETHODCALLTYPE LoadCmdFromResource(
        HMODULE hModule,
        LPCWSTR pszResourceName,
        LPCWSTR pszResourceType,
        WORD wLanguage,
        SPLOADOPTIONS Options) = 0;

    virtual HRESULT STDMETHODCALLTYPE LoadCmdFromMemory(
        const SPBINARYGRAMMAR *pGrammar,
        SPLOADOPTIONS Options) = 0;

    virtual HRESULT STDMETHODCALLTYPE LoadCmdFromProprietaryGrammar(
        REFGUID rguidParam,
        LPCWSTR pszStringParam,
        const void *pvDataPrarm,
        ULONG cbDataSize,
        SPLOADOPTIONS Options) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetRuleState(
        LPCWSTR pszName,
        void *pReserved,
        SPRULESTATE NewState) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetRuleIdState(
        ULONG ulRuleId,
        SPRULESTATE NewState) = 0;

    virtual HRESULT STDMETHODCALLTYPE LoadDictation(
        LPCWSTR pszTopicName,
        SPLOADOPTIONS Options) = 0;

    virtual HRESULT STDMETHODCALLTYPE UnloadDictation(
        ) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetDictationState(
        SPRULESTATE NewState) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetWordSequenceData(
        const WCHAR *pText,
        ULONG cchText,
        const SPTEXTSELECTIONINFO *pInfo) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetTextSelection(
        const SPTEXTSELECTIONINFO *pInfo) = 0;

    virtual HRESULT STDMETHODCALLTYPE IsPronounceable(
        LPCWSTR pszWord,
        SPWORDPRONOUNCEABLE *pWordPronounceable) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetGrammarState(
        SPGRAMMARSTATE eGrammarState) = 0;

    virtual HRESULT STDMETHODCALLTYPE SaveCmd(
        IStream *pStream,
        LPWSTR *ppszCoMemErrorText) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetGrammarState(
        SPGRAMMARSTATE *peGrammarState) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpRecoGrammar, 0x2177db29, 0x7f45, 0x47d0, 0x85,0x54, 0x06,0x7e,0x91,0xc8,0x05,0x02)
#endif
#else
typedef struct ISpRecoGrammarVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpRecoGrammar *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpRecoGrammar *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpRecoGrammar *This);

    /*** ISpGrammarBuilder methods ***/
    HRESULT (STDMETHODCALLTYPE *ResetGrammar)(
        ISpRecoGrammar *This,
        WORD NewLanguage);

    HRESULT (STDMETHODCALLTYPE *GetRule)(
        ISpRecoGrammar *This,
        LPCWSTR pszRuleName,
        DWORD dwRuleId,
        DWORD dwAttributes,
        WINBOOL fCreateIfNotExist,
        SPSTATEHANDLE *phInitialState);

    HRESULT (STDMETHODCALLTYPE *ClearRule)(
        ISpRecoGrammar *This,
        SPSTATEHANDLE hState);

    HRESULT (STDMETHODCALLTYPE *CreateNewState)(
        ISpRecoGrammar *This,
        SPSTATEHANDLE hState,
        SPSTATEHANDLE *phState);

    HRESULT (STDMETHODCALLTYPE *AddWordTransition)(
        ISpRecoGrammar *This,
        SPSTATEHANDLE hFromState,
        SPSTATEHANDLE hToState,
        LPCWSTR psz,
        LPCWSTR pszSeparators,
        SPGRAMMARWORDTYPE eWordType,
        float Weight,
        const SPPROPERTYINFO *pPropInfo);

    HRESULT (STDMETHODCALLTYPE *AddRuleTransition)(
        ISpRecoGrammar *This,
        SPSTATEHANDLE hFromState,
        SPSTATEHANDLE hToState,
        SPSTATEHANDLE hRule,
        float Weight,
        const SPPROPERTYINFO *pPropInfo);

    HRESULT (STDMETHODCALLTYPE *AddResource)(
        ISpRecoGrammar *This,
        SPSTATEHANDLE hRuleState,
        LPCWSTR pszResourceName,
        LPCWSTR pszResourceValue);

    HRESULT (STDMETHODCALLTYPE *Commit)(
        ISpRecoGrammar *This,
        DWORD dwReserved);

    /*** ISpRecoGrammar methods ***/
    HRESULT (STDMETHODCALLTYPE *GetGrammarId)(
        ISpRecoGrammar *This,
        ULONGLONG *pullGrammarId);

    HRESULT (STDMETHODCALLTYPE *GetRecoContext)(
        ISpRecoGrammar *This,
        ISpRecoContext **ppRecoCtxt);

    HRESULT (STDMETHODCALLTYPE *LoadCmdFromFile)(
        ISpRecoGrammar *This,
        LPCWSTR pszFileName,
        SPLOADOPTIONS Options);

    HRESULT (STDMETHODCALLTYPE *LoadCmdFromObject)(
        ISpRecoGrammar *This,
        REFCLSID rcid,
        LPCWSTR pszGrammarName,
        SPLOADOPTIONS Options);

    HRESULT (STDMETHODCALLTYPE *LoadCmdFromResource)(
        ISpRecoGrammar *This,
        HMODULE hModule,
        LPCWSTR pszResourceName,
        LPCWSTR pszResourceType,
        WORD wLanguage,
        SPLOADOPTIONS Options);

    HRESULT (STDMETHODCALLTYPE *LoadCmdFromMemory)(
        ISpRecoGrammar *This,
        const SPBINARYGRAMMAR *pGrammar,
        SPLOADOPTIONS Options);

    HRESULT (STDMETHODCALLTYPE *LoadCmdFromProprietaryGrammar)(
        ISpRecoGrammar *This,
        REFGUID rguidParam,
        LPCWSTR pszStringParam,
        const void *pvDataPrarm,
        ULONG cbDataSize,
        SPLOADOPTIONS Options);

    HRESULT (STDMETHODCALLTYPE *SetRuleState)(
        ISpRecoGrammar *This,
        LPCWSTR pszName,
        void *pReserved,
        SPRULESTATE NewState);

    HRESULT (STDMETHODCALLTYPE *SetRuleIdState)(
        ISpRecoGrammar *This,
        ULONG ulRuleId,
        SPRULESTATE NewState);

    HRESULT (STDMETHODCALLTYPE *LoadDictation)(
        ISpRecoGrammar *This,
        LPCWSTR pszTopicName,
        SPLOADOPTIONS Options);

    HRESULT (STDMETHODCALLTYPE *UnloadDictation)(
        ISpRecoGrammar *This);

    HRESULT (STDMETHODCALLTYPE *SetDictationState)(
        ISpRecoGrammar *This,
        SPRULESTATE NewState);

    HRESULT (STDMETHODCALLTYPE *SetWordSequenceData)(
        ISpRecoGrammar *This,
        const WCHAR *pText,
        ULONG cchText,
        const SPTEXTSELECTIONINFO *pInfo);

    HRESULT (STDMETHODCALLTYPE *SetTextSelection)(
        ISpRecoGrammar *This,
        const SPTEXTSELECTIONINFO *pInfo);

    HRESULT (STDMETHODCALLTYPE *IsPronounceable)(
        ISpRecoGrammar *This,
        LPCWSTR pszWord,
        SPWORDPRONOUNCEABLE *pWordPronounceable);

    HRESULT (STDMETHODCALLTYPE *SetGrammarState)(
        ISpRecoGrammar *This,
        SPGRAMMARSTATE eGrammarState);

    HRESULT (STDMETHODCALLTYPE *SaveCmd)(
        ISpRecoGrammar *This,
        IStream *pStream,
        LPWSTR *ppszCoMemErrorText);

    HRESULT (STDMETHODCALLTYPE *GetGrammarState)(
        ISpRecoGrammar *This,
        SPGRAMMARSTATE *peGrammarState);

    END_INTERFACE
} ISpRecoGrammarVtbl;

interface ISpRecoGrammar {
    CONST_VTBL ISpRecoGrammarVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpRecoGrammar_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpRecoGrammar_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpRecoGrammar_Release(This) (This)->lpVtbl->Release(This)
/*** ISpGrammarBuilder methods ***/
#define ISpRecoGrammar_ResetGrammar(This,NewLanguage) (This)->lpVtbl->ResetGrammar(This,NewLanguage)
#define ISpRecoGrammar_GetRule(This,pszRuleName,dwRuleId,dwAttributes,fCreateIfNotExist,phInitialState) (This)->lpVtbl->GetRule(This,pszRuleName,dwRuleId,dwAttributes,fCreateIfNotExist,phInitialState)
#define ISpRecoGrammar_ClearRule(This,hState) (This)->lpVtbl->ClearRule(This,hState)
#define ISpRecoGrammar_CreateNewState(This,hState,phState) (This)->lpVtbl->CreateNewState(This,hState,phState)
#define ISpRecoGrammar_AddWordTransition(This,hFromState,hToState,psz,pszSeparators,eWordType,Weight,pPropInfo) (This)->lpVtbl->AddWordTransition(This,hFromState,hToState,psz,pszSeparators,eWordType,Weight,pPropInfo)
#define ISpRecoGrammar_AddRuleTransition(This,hFromState,hToState,hRule,Weight,pPropInfo) (This)->lpVtbl->AddRuleTransition(This,hFromState,hToState,hRule,Weight,pPropInfo)
#define ISpRecoGrammar_AddResource(This,hRuleState,pszResourceName,pszResourceValue) (This)->lpVtbl->AddResource(This,hRuleState,pszResourceName,pszResourceValue)
#define ISpRecoGrammar_Commit(This,dwReserved) (This)->lpVtbl->Commit(This,dwReserved)
/*** ISpRecoGrammar methods ***/
#define ISpRecoGrammar_GetGrammarId(This,pullGrammarId) (This)->lpVtbl->GetGrammarId(This,pullGrammarId)
#define ISpRecoGrammar_GetRecoContext(This,ppRecoCtxt) (This)->lpVtbl->GetRecoContext(This,ppRecoCtxt)
#define ISpRecoGrammar_LoadCmdFromFile(This,pszFileName,Options) (This)->lpVtbl->LoadCmdFromFile(This,pszFileName,Options)
#define ISpRecoGrammar_LoadCmdFromObject(This,rcid,pszGrammarName,Options) (This)->lpVtbl->LoadCmdFromObject(This,rcid,pszGrammarName,Options)
#define ISpRecoGrammar_LoadCmdFromResource(This,hModule,pszResourceName,pszResourceType,wLanguage,Options) (This)->lpVtbl->LoadCmdFromResource(This,hModule,pszResourceName,pszResourceType,wLanguage,Options)
#define ISpRecoGrammar_LoadCmdFromMemory(This,pGrammar,Options) (This)->lpVtbl->LoadCmdFromMemory(This,pGrammar,Options)
#define ISpRecoGrammar_LoadCmdFromProprietaryGrammar(This,rguidParam,pszStringParam,pvDataPrarm,cbDataSize,Options) (This)->lpVtbl->LoadCmdFromProprietaryGrammar(This,rguidParam,pszStringParam,pvDataPrarm,cbDataSize,Options)
#define ISpRecoGrammar_SetRuleState(This,pszName,pReserved,NewState) (This)->lpVtbl->SetRuleState(This,pszName,pReserved,NewState)
#define ISpRecoGrammar_SetRuleIdState(This,ulRuleId,NewState) (This)->lpVtbl->SetRuleIdState(This,ulRuleId,NewState)
#define ISpRecoGrammar_LoadDictation(This,pszTopicName,Options) (This)->lpVtbl->LoadDictation(This,pszTopicName,Options)
#define ISpRecoGrammar_UnloadDictation(This) (This)->lpVtbl->UnloadDictation(This)
#define ISpRecoGrammar_SetDictationState(This,NewState) (This)->lpVtbl->SetDictationState(This,NewState)
#define ISpRecoGrammar_SetWordSequenceData(This,pText,cchText,pInfo) (This)->lpVtbl->SetWordSequenceData(This,pText,cchText,pInfo)
#define ISpRecoGrammar_SetTextSelection(This,pInfo) (This)->lpVtbl->SetTextSelection(This,pInfo)
#define ISpRecoGrammar_IsPronounceable(This,pszWord,pWordPronounceable) (This)->lpVtbl->IsPronounceable(This,pszWord,pWordPronounceable)
#define ISpRecoGrammar_SetGrammarState(This,eGrammarState) (This)->lpVtbl->SetGrammarState(This,eGrammarState)
#define ISpRecoGrammar_SaveCmd(This,pStream,ppszCoMemErrorText) (This)->lpVtbl->SaveCmd(This,pStream,ppszCoMemErrorText)
#define ISpRecoGrammar_GetGrammarState(This,peGrammarState) (This)->lpVtbl->GetGrammarState(This,peGrammarState)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpRecoGrammar_QueryInterface(ISpRecoGrammar* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpRecoGrammar_AddRef(ISpRecoGrammar* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpRecoGrammar_Release(ISpRecoGrammar* This) {
    return This->lpVtbl->Release(This);
}
/*** ISpGrammarBuilder methods ***/
static FORCEINLINE HRESULT ISpRecoGrammar_ResetGrammar(ISpRecoGrammar* This,WORD NewLanguage) {
    return This->lpVtbl->ResetGrammar(This,NewLanguage);
}
static FORCEINLINE HRESULT ISpRecoGrammar_GetRule(ISpRecoGrammar* This,LPCWSTR pszRuleName,DWORD dwRuleId,DWORD dwAttributes,WINBOOL fCreateIfNotExist,SPSTATEHANDLE *phInitialState) {
    return This->lpVtbl->GetRule(This,pszRuleName,dwRuleId,dwAttributes,fCreateIfNotExist,phInitialState);
}
static FORCEINLINE HRESULT ISpRecoGrammar_ClearRule(ISpRecoGrammar* This,SPSTATEHANDLE hState) {
    return This->lpVtbl->ClearRule(This,hState);
}
static FORCEINLINE HRESULT ISpRecoGrammar_CreateNewState(ISpRecoGrammar* This,SPSTATEHANDLE hState,SPSTATEHANDLE *phState) {
    return This->lpVtbl->CreateNewState(This,hState,phState);
}
static FORCEINLINE HRESULT ISpRecoGrammar_AddWordTransition(ISpRecoGrammar* This,SPSTATEHANDLE hFromState,SPSTATEHANDLE hToState,LPCWSTR psz,LPCWSTR pszSeparators,SPGRAMMARWORDTYPE eWordType,float Weight,const SPPROPERTYINFO *pPropInfo) {
    return This->lpVtbl->AddWordTransition(This,hFromState,hToState,psz,pszSeparators,eWordType,Weight,pPropInfo);
}
static FORCEINLINE HRESULT ISpRecoGrammar_AddRuleTransition(ISpRecoGrammar* This,SPSTATEHANDLE hFromState,SPSTATEHANDLE hToState,SPSTATEHANDLE hRule,float Weight,const SPPROPERTYINFO *pPropInfo) {
    return This->lpVtbl->AddRuleTransition(This,hFromState,hToState,hRule,Weight,pPropInfo);
}
static FORCEINLINE HRESULT ISpRecoGrammar_AddResource(ISpRecoGrammar* This,SPSTATEHANDLE hRuleState,LPCWSTR pszResourceName,LPCWSTR pszResourceValue) {
    return This->lpVtbl->AddResource(This,hRuleState,pszResourceName,pszResourceValue);
}
static FORCEINLINE HRESULT ISpRecoGrammar_Commit(ISpRecoGrammar* This,DWORD dwReserved) {
    return This->lpVtbl->Commit(This,dwReserved);
}
/*** ISpRecoGrammar methods ***/
static FORCEINLINE HRESULT ISpRecoGrammar_GetGrammarId(ISpRecoGrammar* This,ULONGLONG *pullGrammarId) {
    return This->lpVtbl->GetGrammarId(This,pullGrammarId);
}
static FORCEINLINE HRESULT ISpRecoGrammar_GetRecoContext(ISpRecoGrammar* This,ISpRecoContext **ppRecoCtxt) {
    return This->lpVtbl->GetRecoContext(This,ppRecoCtxt);
}
static FORCEINLINE HRESULT ISpRecoGrammar_LoadCmdFromFile(ISpRecoGrammar* This,LPCWSTR pszFileName,SPLOADOPTIONS Options) {
    return This->lpVtbl->LoadCmdFromFile(This,pszFileName,Options);
}
static FORCEINLINE HRESULT ISpRecoGrammar_LoadCmdFromObject(ISpRecoGrammar* This,REFCLSID rcid,LPCWSTR pszGrammarName,SPLOADOPTIONS Options) {
    return This->lpVtbl->LoadCmdFromObject(This,rcid,pszGrammarName,Options);
}
static FORCEINLINE HRESULT ISpRecoGrammar_LoadCmdFromResource(ISpRecoGrammar* This,HMODULE hModule,LPCWSTR pszResourceName,LPCWSTR pszResourceType,WORD wLanguage,SPLOADOPTIONS Options) {
    return This->lpVtbl->LoadCmdFromResource(This,hModule,pszResourceName,pszResourceType,wLanguage,Options);
}
static FORCEINLINE HRESULT ISpRecoGrammar_LoadCmdFromMemory(ISpRecoGrammar* This,const SPBINARYGRAMMAR *pGrammar,SPLOADOPTIONS Options) {
    return This->lpVtbl->LoadCmdFromMemory(This,pGrammar,Options);
}
static FORCEINLINE HRESULT ISpRecoGrammar_LoadCmdFromProprietaryGrammar(ISpRecoGrammar* This,REFGUID rguidParam,LPCWSTR pszStringParam,const void *pvDataPrarm,ULONG cbDataSize,SPLOADOPTIONS Options) {
    return This->lpVtbl->LoadCmdFromProprietaryGrammar(This,rguidParam,pszStringParam,pvDataPrarm,cbDataSize,Options);
}
static FORCEINLINE HRESULT ISpRecoGrammar_SetRuleState(ISpRecoGrammar* This,LPCWSTR pszName,void *pReserved,SPRULESTATE NewState) {
    return This->lpVtbl->SetRuleState(This,pszName,pReserved,NewState);
}
static FORCEINLINE HRESULT ISpRecoGrammar_SetRuleIdState(ISpRecoGrammar* This,ULONG ulRuleId,SPRULESTATE NewState) {
    return This->lpVtbl->SetRuleIdState(This,ulRuleId,NewState);
}
static FORCEINLINE HRESULT ISpRecoGrammar_LoadDictation(ISpRecoGrammar* This,LPCWSTR pszTopicName,SPLOADOPTIONS Options) {
    return This->lpVtbl->LoadDictation(This,pszTopicName,Options);
}
static FORCEINLINE HRESULT ISpRecoGrammar_UnloadDictation(ISpRecoGrammar* This) {
    return This->lpVtbl->UnloadDictation(This);
}
static FORCEINLINE HRESULT ISpRecoGrammar_SetDictationState(ISpRecoGrammar* This,SPRULESTATE NewState) {
    return This->lpVtbl->SetDictationState(This,NewState);
}
static FORCEINLINE HRESULT ISpRecoGrammar_SetWordSequenceData(ISpRecoGrammar* This,const WCHAR *pText,ULONG cchText,const SPTEXTSELECTIONINFO *pInfo) {
    return This->lpVtbl->SetWordSequenceData(This,pText,cchText,pInfo);
}
static FORCEINLINE HRESULT ISpRecoGrammar_SetTextSelection(ISpRecoGrammar* This,const SPTEXTSELECTIONINFO *pInfo) {
    return This->lpVtbl->SetTextSelection(This,pInfo);
}
static FORCEINLINE HRESULT ISpRecoGrammar_IsPronounceable(ISpRecoGrammar* This,LPCWSTR pszWord,SPWORDPRONOUNCEABLE *pWordPronounceable) {
    return This->lpVtbl->IsPronounceable(This,pszWord,pWordPronounceable);
}
static FORCEINLINE HRESULT ISpRecoGrammar_SetGrammarState(ISpRecoGrammar* This,SPGRAMMARSTATE eGrammarState) {
    return This->lpVtbl->SetGrammarState(This,eGrammarState);
}
static FORCEINLINE HRESULT ISpRecoGrammar_SaveCmd(ISpRecoGrammar* This,IStream *pStream,LPWSTR *ppszCoMemErrorText) {
    return This->lpVtbl->SaveCmd(This,pStream,ppszCoMemErrorText);
}
static FORCEINLINE HRESULT ISpRecoGrammar_GetGrammarState(ISpRecoGrammar* This,SPGRAMMARSTATE *peGrammarState) {
    return This->lpVtbl->GetGrammarState(This,peGrammarState);
}
#endif
#endif

#endif


#endif  /* __ISpRecoGrammar_INTERFACE_DEFINED__ */

typedef enum SPMATCHINGMODE {
    AllWords = 0,
    Subsequence = 1,
    OrderedSubset = 3,
    SubsequenceContentRequired = 5,
    OrderedSubsetContentRequired = 7
} SPMATCHINGMODE;
typedef enum PHONETICALPHABET {
    PA_Ipa = 0,
    PA_Ups = 1,
    PA_Sapi = 2
} PHONETICALPHABET;
/*****************************************************************************
 * ISpGrammarBuilder2 interface
 */
#ifndef __ISpGrammarBuilder2_INTERFACE_DEFINED__
#define __ISpGrammarBuilder2_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpGrammarBuilder2, 0x8ab10026, 0x20cc, 0x4b20, 0x8c,0x22, 0xa4,0x9c,0x9b,0xa7,0x8f,0x60);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("8ab10026-20cc-4b20-8c22-a49c9ba78f60")
ISpGrammarBuilder2 : public IUnknown
{
    virtual HRESULT STDMETHODCALLTYPE AddTextSubset(
        SPSTATEHANDLE hFromState,
        SPSTATEHANDLE hToState,
        LPCWSTR psz,
        SPMATCHINGMODE eMatchMode) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetPhoneticAlphabet(
        PHONETICALPHABET phoneticALphabet) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpGrammarBuilder2, 0x8ab10026, 0x20cc, 0x4b20, 0x8c,0x22, 0xa4,0x9c,0x9b,0xa7,0x8f,0x60)
#endif
#else
typedef struct ISpGrammarBuilder2Vtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpGrammarBuilder2 *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpGrammarBuilder2 *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpGrammarBuilder2 *This);

    /*** ISpGrammarBuilder2 methods ***/
    HRESULT (STDMETHODCALLTYPE *AddTextSubset)(
        ISpGrammarBuilder2 *This,
        SPSTATEHANDLE hFromState,
        SPSTATEHANDLE hToState,
        LPCWSTR psz,
        SPMATCHINGMODE eMatchMode);

    HRESULT (STDMETHODCALLTYPE *SetPhoneticAlphabet)(
        ISpGrammarBuilder2 *This,
        PHONETICALPHABET phoneticALphabet);

    END_INTERFACE
} ISpGrammarBuilder2Vtbl;

interface ISpGrammarBuilder2 {
    CONST_VTBL ISpGrammarBuilder2Vtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpGrammarBuilder2_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpGrammarBuilder2_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpGrammarBuilder2_Release(This) (This)->lpVtbl->Release(This)
/*** ISpGrammarBuilder2 methods ***/
#define ISpGrammarBuilder2_AddTextSubset(This,hFromState,hToState,psz,eMatchMode) (This)->lpVtbl->AddTextSubset(This,hFromState,hToState,psz,eMatchMode)
#define ISpGrammarBuilder2_SetPhoneticAlphabet(This,phoneticALphabet) (This)->lpVtbl->SetPhoneticAlphabet(This,phoneticALphabet)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpGrammarBuilder2_QueryInterface(ISpGrammarBuilder2* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpGrammarBuilder2_AddRef(ISpGrammarBuilder2* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpGrammarBuilder2_Release(ISpGrammarBuilder2* This) {
    return This->lpVtbl->Release(This);
}
/*** ISpGrammarBuilder2 methods ***/
static FORCEINLINE HRESULT ISpGrammarBuilder2_AddTextSubset(ISpGrammarBuilder2* This,SPSTATEHANDLE hFromState,SPSTATEHANDLE hToState,LPCWSTR psz,SPMATCHINGMODE eMatchMode) {
    return This->lpVtbl->AddTextSubset(This,hFromState,hToState,psz,eMatchMode);
}
static FORCEINLINE HRESULT ISpGrammarBuilder2_SetPhoneticAlphabet(ISpGrammarBuilder2* This,PHONETICALPHABET phoneticALphabet) {
    return This->lpVtbl->SetPhoneticAlphabet(This,phoneticALphabet);
}
#endif
#endif

#endif


#endif  /* __ISpGrammarBuilder2_INTERFACE_DEFINED__ */

#define SPRP_NORMAL 0
/*****************************************************************************
 * ISpRecoGrammar2 interface
 */
#ifndef __ISpRecoGrammar2_INTERFACE_DEFINED__
#define __ISpRecoGrammar2_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpRecoGrammar2, 0x4b37bc9e, 0x9ed6, 0x44a3, 0x93,0xd3, 0x18,0xf0,0x22,0xb7,0x9e,0xc3);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("4b37bc9e-9ed6-44a3-93d3-18f022b79ec3")
ISpRecoGrammar2 : public IUnknown
{
    virtual HRESULT STDMETHODCALLTYPE GetRules(
        SPRULE **ppCoMemRules,
        UINT *puNumRules) = 0;

    virtual HRESULT STDMETHODCALLTYPE LoadCmdFromFile2(
        LPCWSTR pszFileName,
        SPLOADOPTIONS Options,
        LPCWSTR pszSharingUri,
        LPCWSTR pszBaseUri) = 0;

    virtual HRESULT STDMETHODCALLTYPE LoadCmdFromMemory2(
        const SPBINARYGRAMMAR *pGrammar,
        SPLOADOPTIONS Options,
        LPCWSTR pszSharingUri,
        LPCWSTR pszBaseUri) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetRulePriority(
        LPCWSTR pszRuleName,
        ULONG ulRuleId,
        int nRulePriority) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetRuleWeight(
        LPCWSTR pszRuleName,
        ULONG ulRuleId,
        float flWeight) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetDictationWeight(
        float flWeight) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetGrammarLoader(
        ISpeechResourceLoader *pLoader) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetSMLSecurityManager(
        IInternetSecurityManager *pSMLSecurityManager) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpRecoGrammar2, 0x4b37bc9e, 0x9ed6, 0x44a3, 0x93,0xd3, 0x18,0xf0,0x22,0xb7,0x9e,0xc3)
#endif
#else
typedef struct ISpRecoGrammar2Vtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpRecoGrammar2 *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpRecoGrammar2 *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpRecoGrammar2 *This);

    /*** ISpRecoGrammar2 methods ***/
    HRESULT (STDMETHODCALLTYPE *GetRules)(
        ISpRecoGrammar2 *This,
        SPRULE **ppCoMemRules,
        UINT *puNumRules);

    HRESULT (STDMETHODCALLTYPE *LoadCmdFromFile2)(
        ISpRecoGrammar2 *This,
        LPCWSTR pszFileName,
        SPLOADOPTIONS Options,
        LPCWSTR pszSharingUri,
        LPCWSTR pszBaseUri);

    HRESULT (STDMETHODCALLTYPE *LoadCmdFromMemory2)(
        ISpRecoGrammar2 *This,
        const SPBINARYGRAMMAR *pGrammar,
        SPLOADOPTIONS Options,
        LPCWSTR pszSharingUri,
        LPCWSTR pszBaseUri);

    HRESULT (STDMETHODCALLTYPE *SetRulePriority)(
        ISpRecoGrammar2 *This,
        LPCWSTR pszRuleName,
        ULONG ulRuleId,
        int nRulePriority);

    HRESULT (STDMETHODCALLTYPE *SetRuleWeight)(
        ISpRecoGrammar2 *This,
        LPCWSTR pszRuleName,
        ULONG ulRuleId,
        float flWeight);

    HRESULT (STDMETHODCALLTYPE *SetDictationWeight)(
        ISpRecoGrammar2 *This,
        float flWeight);

    HRESULT (STDMETHODCALLTYPE *SetGrammarLoader)(
        ISpRecoGrammar2 *This,
        ISpeechResourceLoader *pLoader);

    HRESULT (STDMETHODCALLTYPE *SetSMLSecurityManager)(
        ISpRecoGrammar2 *This,
        IInternetSecurityManager *pSMLSecurityManager);

    END_INTERFACE
} ISpRecoGrammar2Vtbl;

interface ISpRecoGrammar2 {
    CONST_VTBL ISpRecoGrammar2Vtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpRecoGrammar2_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpRecoGrammar2_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpRecoGrammar2_Release(This) (This)->lpVtbl->Release(This)
/*** ISpRecoGrammar2 methods ***/
#define ISpRecoGrammar2_GetRules(This,ppCoMemRules,puNumRules) (This)->lpVtbl->GetRules(This,ppCoMemRules,puNumRules)
#define ISpRecoGrammar2_LoadCmdFromFile2(This,pszFileName,Options,pszSharingUri,pszBaseUri) (This)->lpVtbl->LoadCmdFromFile2(This,pszFileName,Options,pszSharingUri,pszBaseUri)
#define ISpRecoGrammar2_LoadCmdFromMemory2(This,pGrammar,Options,pszSharingUri,pszBaseUri) (This)->lpVtbl->LoadCmdFromMemory2(This,pGrammar,Options,pszSharingUri,pszBaseUri)
#define ISpRecoGrammar2_SetRulePriority(This,pszRuleName,ulRuleId,nRulePriority) (This)->lpVtbl->SetRulePriority(This,pszRuleName,ulRuleId,nRulePriority)
#define ISpRecoGrammar2_SetRuleWeight(This,pszRuleName,ulRuleId,flWeight) (This)->lpVtbl->SetRuleWeight(This,pszRuleName,ulRuleId,flWeight)
#define ISpRecoGrammar2_SetDictationWeight(This,flWeight) (This)->lpVtbl->SetDictationWeight(This,flWeight)
#define ISpRecoGrammar2_SetGrammarLoader(This,pLoader) (This)->lpVtbl->SetGrammarLoader(This,pLoader)
#define ISpRecoGrammar2_SetSMLSecurityManager(This,pSMLSecurityManager) (This)->lpVtbl->SetSMLSecurityManager(This,pSMLSecurityManager)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpRecoGrammar2_QueryInterface(ISpRecoGrammar2* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpRecoGrammar2_AddRef(ISpRecoGrammar2* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpRecoGrammar2_Release(ISpRecoGrammar2* This) {
    return This->lpVtbl->Release(This);
}
/*** ISpRecoGrammar2 methods ***/
static FORCEINLINE HRESULT ISpRecoGrammar2_GetRules(ISpRecoGrammar2* This,SPRULE **ppCoMemRules,UINT *puNumRules) {
    return This->lpVtbl->GetRules(This,ppCoMemRules,puNumRules);
}
static FORCEINLINE HRESULT ISpRecoGrammar2_LoadCmdFromFile2(ISpRecoGrammar2* This,LPCWSTR pszFileName,SPLOADOPTIONS Options,LPCWSTR pszSharingUri,LPCWSTR pszBaseUri) {
    return This->lpVtbl->LoadCmdFromFile2(This,pszFileName,Options,pszSharingUri,pszBaseUri);
}
static FORCEINLINE HRESULT ISpRecoGrammar2_LoadCmdFromMemory2(ISpRecoGrammar2* This,const SPBINARYGRAMMAR *pGrammar,SPLOADOPTIONS Options,LPCWSTR pszSharingUri,LPCWSTR pszBaseUri) {
    return This->lpVtbl->LoadCmdFromMemory2(This,pGrammar,Options,pszSharingUri,pszBaseUri);
}
static FORCEINLINE HRESULT ISpRecoGrammar2_SetRulePriority(ISpRecoGrammar2* This,LPCWSTR pszRuleName,ULONG ulRuleId,int nRulePriority) {
    return This->lpVtbl->SetRulePriority(This,pszRuleName,ulRuleId,nRulePriority);
}
static FORCEINLINE HRESULT ISpRecoGrammar2_SetRuleWeight(ISpRecoGrammar2* This,LPCWSTR pszRuleName,ULONG ulRuleId,float flWeight) {
    return This->lpVtbl->SetRuleWeight(This,pszRuleName,ulRuleId,flWeight);
}
static FORCEINLINE HRESULT ISpRecoGrammar2_SetDictationWeight(ISpRecoGrammar2* This,float flWeight) {
    return This->lpVtbl->SetDictationWeight(This,flWeight);
}
static FORCEINLINE HRESULT ISpRecoGrammar2_SetGrammarLoader(ISpRecoGrammar2* This,ISpeechResourceLoader *pLoader) {
    return This->lpVtbl->SetGrammarLoader(This,pLoader);
}
static FORCEINLINE HRESULT ISpRecoGrammar2_SetSMLSecurityManager(ISpRecoGrammar2* This,IInternetSecurityManager *pSMLSecurityManager) {
    return This->lpVtbl->SetSMLSecurityManager(This,pSMLSecurityManager);
}
#endif
#endif

#endif


#endif  /* __ISpRecoGrammar2_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpeechResourceLoader interface
 */
#ifndef __ISpeechResourceLoader_INTERFACE_DEFINED__
#define __ISpeechResourceLoader_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpeechResourceLoader, 0xb9ac5783, 0xfcd0, 0x4b21, 0xb1,0x19, 0xb4,0xf8,0xda,0x8f,0xd2,0xc3);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("b9ac5783-fcd0-4b21-b119-b4f8da8fd2c3")
ISpeechResourceLoader : public IDispatch
{
    virtual HRESULT STDMETHODCALLTYPE LoadResource(
        BSTR bstrResourceUri,
        VARIANT_BOOL fAlwaysReload,
        IUnknown **pStream,
        BSTR *pbstrMIMEType,
        VARIANT_BOOL *pfModified,
        BSTR *pbstrRedirectUrl) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetLocalCopy(
        BSTR bstrResourceUri,
        BSTR *pbstrLocalPath,
        BSTR *pbstrMIMEType,
        BSTR *pbstrRedirectUrl) = 0;

    virtual HRESULT STDMETHODCALLTYPE ReleaseLocalCopy(
        BSTR pbstrLocalPath) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpeechResourceLoader, 0xb9ac5783, 0xfcd0, 0x4b21, 0xb1,0x19, 0xb4,0xf8,0xda,0x8f,0xd2,0xc3)
#endif
#else
typedef struct ISpeechResourceLoaderVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpeechResourceLoader *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpeechResourceLoader *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpeechResourceLoader *This);

    /*** IDispatch methods ***/
    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
        ISpeechResourceLoader *This,
        UINT *pctinfo);

    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
        ISpeechResourceLoader *This,
        UINT iTInfo,
        LCID lcid,
        ITypeInfo **ppTInfo);

    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
        ISpeechResourceLoader *This,
        REFIID riid,
        LPOLESTR *rgszNames,
        UINT cNames,
        LCID lcid,
        DISPID *rgDispId);

    HRESULT (STDMETHODCALLTYPE *Invoke)(
        ISpeechResourceLoader *This,
        DISPID dispIdMember,
        REFIID riid,
        LCID lcid,
        WORD wFlags,
        DISPPARAMS *pDispParams,
        VARIANT *pVarResult,
        EXCEPINFO *pExcepInfo,
        UINT *puArgErr);

    /*** ISpeechResourceLoader methods ***/
    HRESULT (STDMETHODCALLTYPE *LoadResource)(
        ISpeechResourceLoader *This,
        BSTR bstrResourceUri,
        VARIANT_BOOL fAlwaysReload,
        IUnknown **pStream,
        BSTR *pbstrMIMEType,
        VARIANT_BOOL *pfModified,
        BSTR *pbstrRedirectUrl);

    HRESULT (STDMETHODCALLTYPE *GetLocalCopy)(
        ISpeechResourceLoader *This,
        BSTR bstrResourceUri,
        BSTR *pbstrLocalPath,
        BSTR *pbstrMIMEType,
        BSTR *pbstrRedirectUrl);

    HRESULT (STDMETHODCALLTYPE *ReleaseLocalCopy)(
        ISpeechResourceLoader *This,
        BSTR pbstrLocalPath);

    END_INTERFACE
} ISpeechResourceLoaderVtbl;

interface ISpeechResourceLoader {
    CONST_VTBL ISpeechResourceLoaderVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpeechResourceLoader_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpeechResourceLoader_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpeechResourceLoader_Release(This) (This)->lpVtbl->Release(This)
/*** IDispatch methods ***/
#define ISpeechResourceLoader_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
#define ISpeechResourceLoader_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
#define ISpeechResourceLoader_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
#define ISpeechResourceLoader_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
/*** ISpeechResourceLoader methods ***/
#define ISpeechResourceLoader_LoadResource(This,bstrResourceUri,fAlwaysReload,pStream,pbstrMIMEType,pfModified,pbstrRedirectUrl) (This)->lpVtbl->LoadResource(This,bstrResourceUri,fAlwaysReload,pStream,pbstrMIMEType,pfModified,pbstrRedirectUrl)
#define ISpeechResourceLoader_GetLocalCopy(This,bstrResourceUri,pbstrLocalPath,pbstrMIMEType,pbstrRedirectUrl) (This)->lpVtbl->GetLocalCopy(This,bstrResourceUri,pbstrLocalPath,pbstrMIMEType,pbstrRedirectUrl)
#define ISpeechResourceLoader_ReleaseLocalCopy(This,pbstrLocalPath) (This)->lpVtbl->ReleaseLocalCopy(This,pbstrLocalPath)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpeechResourceLoader_QueryInterface(ISpeechResourceLoader* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpeechResourceLoader_AddRef(ISpeechResourceLoader* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpeechResourceLoader_Release(ISpeechResourceLoader* This) {
    return This->lpVtbl->Release(This);
}
/*** IDispatch methods ***/
static FORCEINLINE HRESULT ISpeechResourceLoader_GetTypeInfoCount(ISpeechResourceLoader* This,UINT *pctinfo) {
    return This->lpVtbl->GetTypeInfoCount(This,pctinfo);
}
static FORCEINLINE HRESULT ISpeechResourceLoader_GetTypeInfo(ISpeechResourceLoader* This,UINT iTInfo,LCID lcid,ITypeInfo **ppTInfo) {
    return This->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo);
}
static FORCEINLINE HRESULT ISpeechResourceLoader_GetIDsOfNames(ISpeechResourceLoader* This,REFIID riid,LPOLESTR *rgszNames,UINT cNames,LCID lcid,DISPID *rgDispId) {
    return This->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId);
}
static FORCEINLINE HRESULT ISpeechResourceLoader_Invoke(ISpeechResourceLoader* This,DISPID dispIdMember,REFIID riid,LCID lcid,WORD wFlags,DISPPARAMS *pDispParams,VARIANT *pVarResult,EXCEPINFO *pExcepInfo,UINT *puArgErr) {
    return This->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr);
}
/*** ISpeechResourceLoader methods ***/
static FORCEINLINE HRESULT ISpeechResourceLoader_LoadResource(ISpeechResourceLoader* This,BSTR bstrResourceUri,VARIANT_BOOL fAlwaysReload,IUnknown **pStream,BSTR *pbstrMIMEType,VARIANT_BOOL *pfModified,BSTR *pbstrRedirectUrl) {
    return This->lpVtbl->LoadResource(This,bstrResourceUri,fAlwaysReload,pStream,pbstrMIMEType,pfModified,pbstrRedirectUrl);
}
static FORCEINLINE HRESULT ISpeechResourceLoader_GetLocalCopy(ISpeechResourceLoader* This,BSTR bstrResourceUri,BSTR *pbstrLocalPath,BSTR *pbstrMIMEType,BSTR *pbstrRedirectUrl) {
    return This->lpVtbl->GetLocalCopy(This,bstrResourceUri,pbstrLocalPath,pbstrMIMEType,pbstrRedirectUrl);
}
static FORCEINLINE HRESULT ISpeechResourceLoader_ReleaseLocalCopy(ISpeechResourceLoader* This,BSTR pbstrLocalPath) {
    return This->lpVtbl->ReleaseLocalCopy(This,pbstrLocalPath);
}
#endif
#endif

#endif


#endif  /* __ISpeechResourceLoader_INTERFACE_DEFINED__ */

typedef struct SPRECOCONTEXTSTATUS {
    SPINTERFERENCE eInterference;
    WCHAR szRequestTypeOfUI[255];
    DWORD dwReserved1;
    DWORD dwReserved2;
} SPRECOCONTEXTSTATUS;
typedef enum SPBOOKMARKOPTIONS {
    SPBO_NONE = 0,
    SPBO_PAUSE = 0x1,
    SPBO_AHEAD = 0x2,
    SPBO_TIME_UNITS = 0x4
} SPBOOKMARKOPTIONS;
typedef enum SPAUDIOOPTIONS {
    SPAO_NONE = 0,
    SPAO_RETAIN_AUDIO = 0x1
} SPAUDIOOPTIONS;
/*****************************************************************************
 * ISpRecoContext interface
 */
#ifndef __ISpRecoContext_INTERFACE_DEFINED__
#define __ISpRecoContext_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpRecoContext, 0xf740a62f, 0x7c15, 0x489e, 0x82,0x34, 0x94,0x0a,0x33,0xd9,0x27,0x2d);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("f740a62f-7c15-489e-8234-940a33d9272d")
ISpRecoContext : public ISpEventSource
{
    virtual HRESULT STDMETHODCALLTYPE GetRecognizer(
        ISpRecognizer **ppRecognizer) = 0;

    virtual HRESULT STDMETHODCALLTYPE CreateGrammar(
        ULONGLONG ullGrammarId,
        ISpRecoGrammar **ppGrammar) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetStatus(
        SPRECOCONTEXTSTATUS *pStatus) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetMaxAlternates(
        ULONG *pcAlternates) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetMaxAlternates(
        ULONG cAlternates) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetAudioOptions(
        SPAUDIOOPTIONS Options,
        const GUID *pAudioFormatId,
        const WAVEFORMATEX *pWaveFormatEx) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetAudioOptions(
        SPAUDIOOPTIONS *pOptions,
        GUID *pAudioFormatId,
        WAVEFORMATEX **ppCoMemWFEX) = 0;

    virtual HRESULT STDMETHODCALLTYPE DeserializeResult(
        const SPSERIALIZEDRESULT *pSerializedResult,
        ISpRecoResult **ppResult) = 0;

    virtual HRESULT STDMETHODCALLTYPE Bookmark(
        SPBOOKMARKOPTIONS Options,
        ULONGLONG ullStreamPosition,
        LPARAM lparamEvent) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetAdaptationData(
        LPCWSTR pAdaptationData,
        const ULONG cch) = 0;

    virtual HRESULT STDMETHODCALLTYPE Pause(
        DWORD dwReserved) = 0;

    virtual HRESULT STDMETHODCALLTYPE Resume(
        DWORD dwReserved) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetVoice(
        ISpVoice *pVoice,
        WINBOOL fAllowFormatChanges) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetVoice(
        ISpVoice **ppVoice) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetVoicePurgeEvent(
        ULONGLONG ullEventInterest) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetVoicePurgeEvent(
        ULONGLONG *pullEventInterest) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetContextState(
        SPCONTEXTSTATE eContextState) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetContextState(
        SPCONTEXTSTATE *peContextState) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpRecoContext, 0xf740a62f, 0x7c15, 0x489e, 0x82,0x34, 0x94,0x0a,0x33,0xd9,0x27,0x2d)
#endif
#else
typedef struct ISpRecoContextVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpRecoContext *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpRecoContext *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpRecoContext *This);

    /*** ISpNotifySource methods ***/
    HRESULT (STDMETHODCALLTYPE *SetNotifySink)(
        ISpRecoContext *This,
        ISpNotifySink *pNotifySink);

    HRESULT (STDMETHODCALLTYPE *SetNotifyWindowMessage)(
        ISpRecoContext *This,
        HWND hWnd,
        UINT Msg,
        WPARAM wParam,
        LPARAM lParam);

    HRESULT (STDMETHODCALLTYPE *SetNotifyCallbackFunction)(
        ISpRecoContext *This,
        SPNOTIFYCALLBACK *pfnCallback,
        WPARAM wParam,
        LPARAM lParam);

    HRESULT (STDMETHODCALLTYPE *SetNotifyCallbackInterface)(
        ISpRecoContext *This,
        ISpNotifyCallback *pSpCallback,
        WPARAM wParam,
        LPARAM lParam);

    HRESULT (STDMETHODCALLTYPE *SetNotifyWin32Event)(
        ISpRecoContext *This);

    HRESULT (STDMETHODCALLTYPE *WaitForNotifyEvent)(
        ISpRecoContext *This,
        DWORD dwMilliseconds);

    HANDLE (STDMETHODCALLTYPE *GetNotifyEventHandle)(
        ISpRecoContext *This);

    /*** ISpEventSource methods ***/
    HRESULT (STDMETHODCALLTYPE *SetInterest)(
        ISpRecoContext *This,
        ULONGLONG ullEventInterest,
        ULONGLONG ullQueuedInterest);

    HRESULT (STDMETHODCALLTYPE *GetEvents)(
        ISpRecoContext *This,
        ULONG ulCount,
        SPEVENT *pEventArray,
        ULONG *pulFetched);

    HRESULT (STDMETHODCALLTYPE *GetInfo)(
        ISpRecoContext *This,
        SPEVENTSOURCEINFO *pInfo);

    /*** ISpRecoContext methods ***/
    HRESULT (STDMETHODCALLTYPE *GetRecognizer)(
        ISpRecoContext *This,
        ISpRecognizer **ppRecognizer);

    HRESULT (STDMETHODCALLTYPE *CreateGrammar)(
        ISpRecoContext *This,
        ULONGLONG ullGrammarId,
        ISpRecoGrammar **ppGrammar);

    HRESULT (STDMETHODCALLTYPE *GetStatus)(
        ISpRecoContext *This,
        SPRECOCONTEXTSTATUS *pStatus);

    HRESULT (STDMETHODCALLTYPE *GetMaxAlternates)(
        ISpRecoContext *This,
        ULONG *pcAlternates);

    HRESULT (STDMETHODCALLTYPE *SetMaxAlternates)(
        ISpRecoContext *This,
        ULONG cAlternates);

    HRESULT (STDMETHODCALLTYPE *SetAudioOptions)(
        ISpRecoContext *This,
        SPAUDIOOPTIONS Options,
        const GUID *pAudioFormatId,
        const WAVEFORMATEX *pWaveFormatEx);

    HRESULT (STDMETHODCALLTYPE *GetAudioOptions)(
        ISpRecoContext *This,
        SPAUDIOOPTIONS *pOptions,
        GUID *pAudioFormatId,
        WAVEFORMATEX **ppCoMemWFEX);

    HRESULT (STDMETHODCALLTYPE *DeserializeResult)(
        ISpRecoContext *This,
        const SPSERIALIZEDRESULT *pSerializedResult,
        ISpRecoResult **ppResult);

    HRESULT (STDMETHODCALLTYPE *Bookmark)(
        ISpRecoContext *This,
        SPBOOKMARKOPTIONS Options,
        ULONGLONG ullStreamPosition,
        LPARAM lparamEvent);

    HRESULT (STDMETHODCALLTYPE *SetAdaptationData)(
        ISpRecoContext *This,
        LPCWSTR pAdaptationData,
        const ULONG cch);

    HRESULT (STDMETHODCALLTYPE *Pause)(
        ISpRecoContext *This,
        DWORD dwReserved);

    HRESULT (STDMETHODCALLTYPE *Resume)(
        ISpRecoContext *This,
        DWORD dwReserved);

    HRESULT (STDMETHODCALLTYPE *SetVoice)(
        ISpRecoContext *This,
        ISpVoice *pVoice,
        WINBOOL fAllowFormatChanges);

    HRESULT (STDMETHODCALLTYPE *GetVoice)(
        ISpRecoContext *This,
        ISpVoice **ppVoice);

    HRESULT (STDMETHODCALLTYPE *SetVoicePurgeEvent)(
        ISpRecoContext *This,
        ULONGLONG ullEventInterest);

    HRESULT (STDMETHODCALLTYPE *GetVoicePurgeEvent)(
        ISpRecoContext *This,
        ULONGLONG *pullEventInterest);

    HRESULT (STDMETHODCALLTYPE *SetContextState)(
        ISpRecoContext *This,
        SPCONTEXTSTATE eContextState);

    HRESULT (STDMETHODCALLTYPE *GetContextState)(
        ISpRecoContext *This,
        SPCONTEXTSTATE *peContextState);

    END_INTERFACE
} ISpRecoContextVtbl;

interface ISpRecoContext {
    CONST_VTBL ISpRecoContextVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpRecoContext_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpRecoContext_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpRecoContext_Release(This) (This)->lpVtbl->Release(This)
/*** ISpNotifySource methods ***/
#define ISpRecoContext_SetNotifySink(This,pNotifySink) (This)->lpVtbl->SetNotifySink(This,pNotifySink)
#define ISpRecoContext_SetNotifyWindowMessage(This,hWnd,Msg,wParam,lParam) (This)->lpVtbl->SetNotifyWindowMessage(This,hWnd,Msg,wParam,lParam)
#define ISpRecoContext_SetNotifyCallbackFunction(This,pfnCallback,wParam,lParam) (This)->lpVtbl->SetNotifyCallbackFunction(This,pfnCallback,wParam,lParam)
#define ISpRecoContext_SetNotifyCallbackInterface(This,pSpCallback,wParam,lParam) (This)->lpVtbl->SetNotifyCallbackInterface(This,pSpCallback,wParam,lParam)
#define ISpRecoContext_SetNotifyWin32Event(This) (This)->lpVtbl->SetNotifyWin32Event(This)
#define ISpRecoContext_WaitForNotifyEvent(This,dwMilliseconds) (This)->lpVtbl->WaitForNotifyEvent(This,dwMilliseconds)
#define ISpRecoContext_GetNotifyEventHandle(This) (This)->lpVtbl->GetNotifyEventHandle(This)
/*** ISpEventSource methods ***/
#define ISpRecoContext_SetInterest(This,ullEventInterest,ullQueuedInterest) (This)->lpVtbl->SetInterest(This,ullEventInterest,ullQueuedInterest)
#define ISpRecoContext_GetEvents(This,ulCount,pEventArray,pulFetched) (This)->lpVtbl->GetEvents(This,ulCount,pEventArray,pulFetched)
#define ISpRecoContext_GetInfo(This,pInfo) (This)->lpVtbl->GetInfo(This,pInfo)
/*** ISpRecoContext methods ***/
#define ISpRecoContext_GetRecognizer(This,ppRecognizer) (This)->lpVtbl->GetRecognizer(This,ppRecognizer)
#define ISpRecoContext_CreateGrammar(This,ullGrammarId,ppGrammar) (This)->lpVtbl->CreateGrammar(This,ullGrammarId,ppGrammar)
#define ISpRecoContext_GetStatus(This,pStatus) (This)->lpVtbl->GetStatus(This,pStatus)
#define ISpRecoContext_GetMaxAlternates(This,pcAlternates) (This)->lpVtbl->GetMaxAlternates(This,pcAlternates)
#define ISpRecoContext_SetMaxAlternates(This,cAlternates) (This)->lpVtbl->SetMaxAlternates(This,cAlternates)
#define ISpRecoContext_SetAudioOptions(This,Options,pAudioFormatId,pWaveFormatEx) (This)->lpVtbl->SetAudioOptions(This,Options,pAudioFormatId,pWaveFormatEx)
#define ISpRecoContext_GetAudioOptions(This,pOptions,pAudioFormatId,ppCoMemWFEX) (This)->lpVtbl->GetAudioOptions(This,pOptions,pAudioFormatId,ppCoMemWFEX)
#define ISpRecoContext_DeserializeResult(This,pSerializedResult,ppResult) (This)->lpVtbl->DeserializeResult(This,pSerializedResult,ppResult)
#define ISpRecoContext_Bookmark(This,Options,ullStreamPosition,lparamEvent) (This)->lpVtbl->Bookmark(This,Options,ullStreamPosition,lparamEvent)
#define ISpRecoContext_SetAdaptationData(This,pAdaptationData,cch) (This)->lpVtbl->SetAdaptationData(This,pAdaptationData,cch)
#define ISpRecoContext_Pause(This,dwReserved) (This)->lpVtbl->Pause(This,dwReserved)
#define ISpRecoContext_Resume(This,dwReserved) (This)->lpVtbl->Resume(This,dwReserved)
#define ISpRecoContext_SetVoice(This,pVoice,fAllowFormatChanges) (This)->lpVtbl->SetVoice(This,pVoice,fAllowFormatChanges)
#define ISpRecoContext_GetVoice(This,ppVoice) (This)->lpVtbl->GetVoice(This,ppVoice)
#define ISpRecoContext_SetVoicePurgeEvent(This,ullEventInterest) (This)->lpVtbl->SetVoicePurgeEvent(This,ullEventInterest)
#define ISpRecoContext_GetVoicePurgeEvent(This,pullEventInterest) (This)->lpVtbl->GetVoicePurgeEvent(This,pullEventInterest)
#define ISpRecoContext_SetContextState(This,eContextState) (This)->lpVtbl->SetContextState(This,eContextState)
#define ISpRecoContext_GetContextState(This,peContextState) (This)->lpVtbl->GetContextState(This,peContextState)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpRecoContext_QueryInterface(ISpRecoContext* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpRecoContext_AddRef(ISpRecoContext* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpRecoContext_Release(ISpRecoContext* This) {
    return This->lpVtbl->Release(This);
}
/*** ISpNotifySource methods ***/
static FORCEINLINE HRESULT ISpRecoContext_SetNotifySink(ISpRecoContext* This,ISpNotifySink *pNotifySink) {
    return This->lpVtbl->SetNotifySink(This,pNotifySink);
}
static FORCEINLINE HRESULT ISpRecoContext_SetNotifyWindowMessage(ISpRecoContext* This,HWND hWnd,UINT Msg,WPARAM wParam,LPARAM lParam) {
    return This->lpVtbl->SetNotifyWindowMessage(This,hWnd,Msg,wParam,lParam);
}
static FORCEINLINE HRESULT ISpRecoContext_SetNotifyCallbackFunction(ISpRecoContext* This,SPNOTIFYCALLBACK *pfnCallback,WPARAM wParam,LPARAM lParam) {
    return This->lpVtbl->SetNotifyCallbackFunction(This,pfnCallback,wParam,lParam);
}
static FORCEINLINE HRESULT ISpRecoContext_SetNotifyCallbackInterface(ISpRecoContext* This,ISpNotifyCallback *pSpCallback,WPARAM wParam,LPARAM lParam) {
    return This->lpVtbl->SetNotifyCallbackInterface(This,pSpCallback,wParam,lParam);
}
static FORCEINLINE HRESULT ISpRecoContext_SetNotifyWin32Event(ISpRecoContext* This) {
    return This->lpVtbl->SetNotifyWin32Event(This);
}
static FORCEINLINE HRESULT ISpRecoContext_WaitForNotifyEvent(ISpRecoContext* This,DWORD dwMilliseconds) {
    return This->lpVtbl->WaitForNotifyEvent(This,dwMilliseconds);
}
static FORCEINLINE HANDLE ISpRecoContext_GetNotifyEventHandle(ISpRecoContext* This) {
    return This->lpVtbl->GetNotifyEventHandle(This);
}
/*** ISpEventSource methods ***/
static FORCEINLINE HRESULT ISpRecoContext_SetInterest(ISpRecoContext* This,ULONGLONG ullEventInterest,ULONGLONG ullQueuedInterest) {
    return This->lpVtbl->SetInterest(This,ullEventInterest,ullQueuedInterest);
}
static FORCEINLINE HRESULT ISpRecoContext_GetEvents(ISpRecoContext* This,ULONG ulCount,SPEVENT *pEventArray,ULONG *pulFetched) {
    return This->lpVtbl->GetEvents(This,ulCount,pEventArray,pulFetched);
}
static FORCEINLINE HRESULT ISpRecoContext_GetInfo(ISpRecoContext* This,SPEVENTSOURCEINFO *pInfo) {
    return This->lpVtbl->GetInfo(This,pInfo);
}
/*** ISpRecoContext methods ***/
static FORCEINLINE HRESULT ISpRecoContext_GetRecognizer(ISpRecoContext* This,ISpRecognizer **ppRecognizer) {
    return This->lpVtbl->GetRecognizer(This,ppRecognizer);
}
static FORCEINLINE HRESULT ISpRecoContext_CreateGrammar(ISpRecoContext* This,ULONGLONG ullGrammarId,ISpRecoGrammar **ppGrammar) {
    return This->lpVtbl->CreateGrammar(This,ullGrammarId,ppGrammar);
}
static FORCEINLINE HRESULT ISpRecoContext_GetStatus(ISpRecoContext* This,SPRECOCONTEXTSTATUS *pStatus) {
    return This->lpVtbl->GetStatus(This,pStatus);
}
static FORCEINLINE HRESULT ISpRecoContext_GetMaxAlternates(ISpRecoContext* This,ULONG *pcAlternates) {
    return This->lpVtbl->GetMaxAlternates(This,pcAlternates);
}
static FORCEINLINE HRESULT ISpRecoContext_SetMaxAlternates(ISpRecoContext* This,ULONG cAlternates) {
    return This->lpVtbl->SetMaxAlternates(This,cAlternates);
}
static FORCEINLINE HRESULT ISpRecoContext_SetAudioOptions(ISpRecoContext* This,SPAUDIOOPTIONS Options,const GUID *pAudioFormatId,const WAVEFORMATEX *pWaveFormatEx) {
    return This->lpVtbl->SetAudioOptions(This,Options,pAudioFormatId,pWaveFormatEx);
}
static FORCEINLINE HRESULT ISpRecoContext_GetAudioOptions(ISpRecoContext* This,SPAUDIOOPTIONS *pOptions,GUID *pAudioFormatId,WAVEFORMATEX **ppCoMemWFEX) {
    return This->lpVtbl->GetAudioOptions(This,pOptions,pAudioFormatId,ppCoMemWFEX);
}
static FORCEINLINE HRESULT ISpRecoContext_DeserializeResult(ISpRecoContext* This,const SPSERIALIZEDRESULT *pSerializedResult,ISpRecoResult **ppResult) {
    return This->lpVtbl->DeserializeResult(This,pSerializedResult,ppResult);
}
static FORCEINLINE HRESULT ISpRecoContext_Bookmark(ISpRecoContext* This,SPBOOKMARKOPTIONS Options,ULONGLONG ullStreamPosition,LPARAM lparamEvent) {
    return This->lpVtbl->Bookmark(This,Options,ullStreamPosition,lparamEvent);
}
static FORCEINLINE HRESULT ISpRecoContext_SetAdaptationData(ISpRecoContext* This,LPCWSTR pAdaptationData,const ULONG cch) {
    return This->lpVtbl->SetAdaptationData(This,pAdaptationData,cch);
}
static FORCEINLINE HRESULT ISpRecoContext_Pause(ISpRecoContext* This,DWORD dwReserved) {
    return This->lpVtbl->Pause(This,dwReserved);
}
static FORCEINLINE HRESULT ISpRecoContext_Resume(ISpRecoContext* This,DWORD dwReserved) {
    return This->lpVtbl->Resume(This,dwReserved);
}
static FORCEINLINE HRESULT ISpRecoContext_SetVoice(ISpRecoContext* This,ISpVoice *pVoice,WINBOOL fAllowFormatChanges) {
    return This->lpVtbl->SetVoice(This,pVoice,fAllowFormatChanges);
}
static FORCEINLINE HRESULT ISpRecoContext_GetVoice(ISpRecoContext* This,ISpVoice **ppVoice) {
    return This->lpVtbl->GetVoice(This,ppVoice);
}
static FORCEINLINE HRESULT ISpRecoContext_SetVoicePurgeEvent(ISpRecoContext* This,ULONGLONG ullEventInterest) {
    return This->lpVtbl->SetVoicePurgeEvent(This,ullEventInterest);
}
static FORCEINLINE HRESULT ISpRecoContext_GetVoicePurgeEvent(ISpRecoContext* This,ULONGLONG *pullEventInterest) {
    return This->lpVtbl->GetVoicePurgeEvent(This,pullEventInterest);
}
static FORCEINLINE HRESULT ISpRecoContext_SetContextState(ISpRecoContext* This,SPCONTEXTSTATE eContextState) {
    return This->lpVtbl->SetContextState(This,eContextState);
}
static FORCEINLINE HRESULT ISpRecoContext_GetContextState(ISpRecoContext* This,SPCONTEXTSTATE *peContextState) {
    return This->lpVtbl->GetContextState(This,peContextState);
}
#endif
#endif

#endif


#endif  /* __ISpRecoContext_INTERFACE_DEFINED__ */

typedef enum SPGRAMMAROPTIONS {
    SPGO_SAPI = 0x1,
    SPGO_SRGS = 0x2,
    SPGO_UPS = 0x4,
    SPGO_SRGS_MS_SCRIPT = 0x8,
    SPGO_FILE = 0x10,
    SPGO_HTTP = 0x20,
    SPGO_RES = 0x40,
    SPGO_OBJECT = 0x80,
    SPGO_SRGS_W3C_SCRIPT = 0x100,
    SPGO_SRGS_STG_SCRIPT = 0x200,
    SPGO_SRGS_SCRIPT = ((SPGO_SRGS | SPGO_SRGS_MS_SCRIPT) | SPGO_SRGS_W3C_SCRIPT) | SPGO_SRGS_STG_SCRIPT,
    SPGO_DEFAULT = 0x3fb,
    SPGO_ALL = 0x3ff
} SPGRAMMAROPTIONS;
typedef enum SPADAPTATIONSETTINGS {
    SPADS_Default = 0x0,
    SPADS_CurrentRecognizer = 0x1,
    SPADS_RecoProfile = 0x2,
    SPADS_Immediate = 0x4,
    SPADS_Reset = 0x8,
    SPADS_HighVolumeDataSource = 0x10
} SPADAPTATIONSETTINGS;
typedef enum SPADAPTATIONRELEVANCE {
    SPAR_Unknown = 0,
    SPAR_Low = 1,
    SPAR_Medium = 2,
    SPAR_High = 3
} SPADAPTATIONRELEVANCE;
/*****************************************************************************
 * ISpRecoContext2 interface
 */
#ifndef __ISpRecoContext2_INTERFACE_DEFINED__
#define __ISpRecoContext2_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpRecoContext2, 0xbead311c, 0x52ff, 0x437f, 0x94,0x64, 0x6b,0x21,0x05,0x4c,0xa7,0x3d);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("bead311c-52ff-437f-9464-6b21054ca73d")
ISpRecoContext2 : public IUnknown
{
    virtual HRESULT STDMETHODCALLTYPE SetGrammarOptions(
        DWORD eGrammarOptions) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetGrammarOptions(
        DWORD *peGrammarOptions) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetAdaptationData2(
        LPCWSTR pAdaptationData,
        const ULONG cch,
        LPCWSTR pTopicName,
        DWORD eAdaptationSettings,
        SPADAPTATIONRELEVANCE eRelevance) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpRecoContext2, 0xbead311c, 0x52ff, 0x437f, 0x94,0x64, 0x6b,0x21,0x05,0x4c,0xa7,0x3d)
#endif
#else
typedef struct ISpRecoContext2Vtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpRecoContext2 *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpRecoContext2 *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpRecoContext2 *This);

    /*** ISpRecoContext2 methods ***/
    HRESULT (STDMETHODCALLTYPE *SetGrammarOptions)(
        ISpRecoContext2 *This,
        DWORD eGrammarOptions);

    HRESULT (STDMETHODCALLTYPE *GetGrammarOptions)(
        ISpRecoContext2 *This,
        DWORD *peGrammarOptions);

    HRESULT (STDMETHODCALLTYPE *SetAdaptationData2)(
        ISpRecoContext2 *This,
        LPCWSTR pAdaptationData,
        const ULONG cch,
        LPCWSTR pTopicName,
        DWORD eAdaptationSettings,
        SPADAPTATIONRELEVANCE eRelevance);

    END_INTERFACE
} ISpRecoContext2Vtbl;

interface ISpRecoContext2 {
    CONST_VTBL ISpRecoContext2Vtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpRecoContext2_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpRecoContext2_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpRecoContext2_Release(This) (This)->lpVtbl->Release(This)
/*** ISpRecoContext2 methods ***/
#define ISpRecoContext2_SetGrammarOptions(This,eGrammarOptions) (This)->lpVtbl->SetGrammarOptions(This,eGrammarOptions)
#define ISpRecoContext2_GetGrammarOptions(This,peGrammarOptions) (This)->lpVtbl->GetGrammarOptions(This,peGrammarOptions)
#define ISpRecoContext2_SetAdaptationData2(This,pAdaptationData,cch,pTopicName,eAdaptationSettings,eRelevance) (This)->lpVtbl->SetAdaptationData2(This,pAdaptationData,cch,pTopicName,eAdaptationSettings,eRelevance)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpRecoContext2_QueryInterface(ISpRecoContext2* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpRecoContext2_AddRef(ISpRecoContext2* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpRecoContext2_Release(ISpRecoContext2* This) {
    return This->lpVtbl->Release(This);
}
/*** ISpRecoContext2 methods ***/
static FORCEINLINE HRESULT ISpRecoContext2_SetGrammarOptions(ISpRecoContext2* This,DWORD eGrammarOptions) {
    return This->lpVtbl->SetGrammarOptions(This,eGrammarOptions);
}
static FORCEINLINE HRESULT ISpRecoContext2_GetGrammarOptions(ISpRecoContext2* This,DWORD *peGrammarOptions) {
    return This->lpVtbl->GetGrammarOptions(This,peGrammarOptions);
}
static FORCEINLINE HRESULT ISpRecoContext2_SetAdaptationData2(ISpRecoContext2* This,LPCWSTR pAdaptationData,const ULONG cch,LPCWSTR pTopicName,DWORD eAdaptationSettings,SPADAPTATIONRELEVANCE eRelevance) {
    return This->lpVtbl->SetAdaptationData2(This,pAdaptationData,cch,pTopicName,eAdaptationSettings,eRelevance);
}
#endif
#endif

#endif


#endif  /* __ISpRecoContext2_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpProperties interface
 */
#ifndef __ISpProperties_INTERFACE_DEFINED__
#define __ISpProperties_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpProperties, 0x5b4fb971, 0xb115, 0x4de1, 0xad,0x97, 0xe4,0x82,0xe3,0xbf,0x6e,0xe4);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("5b4fb971-b115-4de1-ad97-e482e3bf6ee4")
ISpProperties : public IUnknown
{
    virtual HRESULT STDMETHODCALLTYPE SetPropertyNum(
        LPCWSTR pName,
        LONG lValue) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetPropertyNum(
        LPCWSTR pName,
        LONG *plValue) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetPropertyString(
        LPCWSTR pName,
        LPCWSTR pValue) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetPropertyString(
        LPCWSTR pName,
        LPWSTR *ppCoMemValue) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpProperties, 0x5b4fb971, 0xb115, 0x4de1, 0xad,0x97, 0xe4,0x82,0xe3,0xbf,0x6e,0xe4)
#endif
#else
typedef struct ISpPropertiesVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpProperties *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpProperties *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpProperties *This);

    /*** ISpProperties methods ***/
    HRESULT (STDMETHODCALLTYPE *SetPropertyNum)(
        ISpProperties *This,
        LPCWSTR pName,
        LONG lValue);

    HRESULT (STDMETHODCALLTYPE *GetPropertyNum)(
        ISpProperties *This,
        LPCWSTR pName,
        LONG *plValue);

    HRESULT (STDMETHODCALLTYPE *SetPropertyString)(
        ISpProperties *This,
        LPCWSTR pName,
        LPCWSTR pValue);

    HRESULT (STDMETHODCALLTYPE *GetPropertyString)(
        ISpProperties *This,
        LPCWSTR pName,
        LPWSTR *ppCoMemValue);

    END_INTERFACE
} ISpPropertiesVtbl;

interface ISpProperties {
    CONST_VTBL ISpPropertiesVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpProperties_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpProperties_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpProperties_Release(This) (This)->lpVtbl->Release(This)
/*** ISpProperties methods ***/
#define ISpProperties_SetPropertyNum(This,pName,lValue) (This)->lpVtbl->SetPropertyNum(This,pName,lValue)
#define ISpProperties_GetPropertyNum(This,pName,plValue) (This)->lpVtbl->GetPropertyNum(This,pName,plValue)
#define ISpProperties_SetPropertyString(This,pName,pValue) (This)->lpVtbl->SetPropertyString(This,pName,pValue)
#define ISpProperties_GetPropertyString(This,pName,ppCoMemValue) (This)->lpVtbl->GetPropertyString(This,pName,ppCoMemValue)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpProperties_QueryInterface(ISpProperties* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpProperties_AddRef(ISpProperties* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpProperties_Release(ISpProperties* This) {
    return This->lpVtbl->Release(This);
}
/*** ISpProperties methods ***/
static FORCEINLINE HRESULT ISpProperties_SetPropertyNum(ISpProperties* This,LPCWSTR pName,LONG lValue) {
    return This->lpVtbl->SetPropertyNum(This,pName,lValue);
}
static FORCEINLINE HRESULT ISpProperties_GetPropertyNum(ISpProperties* This,LPCWSTR pName,LONG *plValue) {
    return This->lpVtbl->GetPropertyNum(This,pName,plValue);
}
static FORCEINLINE HRESULT ISpProperties_SetPropertyString(ISpProperties* This,LPCWSTR pName,LPCWSTR pValue) {
    return This->lpVtbl->SetPropertyString(This,pName,pValue);
}
static FORCEINLINE HRESULT ISpProperties_GetPropertyString(ISpProperties* This,LPCWSTR pName,LPWSTR *ppCoMemValue) {
    return This->lpVtbl->GetPropertyString(This,pName,ppCoMemValue);
}
#endif
#endif

#endif


#endif  /* __ISpProperties_INTERFACE_DEFINED__ */

#define SP_MAX_LANGIDS (20)

typedef struct SPRECOGNIZERSTATUS {
    SPAUDIOSTATUS AudioStatus;
    ULONGLONG ullRecognitionStreamPos;
    ULONG ulStreamNumber;
    ULONG ulNumActive;
    CLSID clsidEngine;
    ULONG cLangIDs;
    WORD aLangID[20];
    ULONGLONG ullRecognitionStreamTime;
} SPRECOGNIZERSTATUS;
typedef enum SPWAVEFORMATTYPE {
    SPWF_INPUT = 0,
    SPWF_SRENGINE = 1
} SPSTREAMFORMATTYPE;
typedef enum SPRECOSTATE {
    SPRST_INACTIVE = 0,
    SPRST_ACTIVE = 1,
    SPRST_ACTIVE_ALWAYS = 2,
    SPRST_INACTIVE_WITH_PURGE = 3,
    SPRST_NUM_STATES = 4
} SPRECOSTATE;
/*****************************************************************************
 * ISpRecognizer interface
 */
#ifndef __ISpRecognizer_INTERFACE_DEFINED__
#define __ISpRecognizer_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpRecognizer, 0xc2b5f241, 0xdaa0, 0x4507, 0x9e,0x16, 0x5a,0x1e,0xaa,0x2b,0x7a,0x5c);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("c2b5f241-daa0-4507-9e16-5a1eaa2b7a5c")
ISpRecognizer : public ISpProperties
{
    virtual HRESULT STDMETHODCALLTYPE SetRecognizer(
        ISpObjectToken *pRecognizer) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetRecognizer(
        ISpObjectToken **ppRecognizer) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetInput(
        IUnknown *pUnkInput,
        WINBOOL fAllowFormatChanges) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetInputObjectToken(
        ISpObjectToken **ppToken) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetInputStream(
        ISpStreamFormat **ppStream) = 0;

    virtual HRESULT STDMETHODCALLTYPE CreateRecoContext(
        ISpRecoContext **ppNewCtxt) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetRecoProfile(
        ISpObjectToken **ppToken) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetRecoProfile(
        ISpObjectToken *pToken) = 0;

    virtual HRESULT STDMETHODCALLTYPE IsSharedInstance(
        ) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetRecoState(
        SPRECOSTATE *pState) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetRecoState(
        SPRECOSTATE NewState) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetStatus(
        SPRECOGNIZERSTATUS *pStatus) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetFormat(
        SPSTREAMFORMATTYPE WaveFormatType,
        GUID *pFormatId,
        WAVEFORMATEX **ppCoMemWFEX) = 0;

    virtual HRESULT STDMETHODCALLTYPE IsUISupported(
        LPCWSTR pszTypeOfUI,
        void *pvExtraData,
        ULONG cbExtraData,
        WINBOOL *pfSupported) = 0;

    virtual HRESULT STDMETHODCALLTYPE DisplayUI(
        HWND hwndParent,
        LPCWSTR pszTitle,
        LPCWSTR pszTypeOfUI,
        void *pvExtraData,
        ULONG cbExtraData) = 0;

    virtual HRESULT STDMETHODCALLTYPE EmulateRecognition(
        ISpPhrase *pPhrase) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpRecognizer, 0xc2b5f241, 0xdaa0, 0x4507, 0x9e,0x16, 0x5a,0x1e,0xaa,0x2b,0x7a,0x5c)
#endif
#else
typedef struct ISpRecognizerVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpRecognizer *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpRecognizer *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpRecognizer *This);

    /*** ISpProperties methods ***/
    HRESULT (STDMETHODCALLTYPE *SetPropertyNum)(
        ISpRecognizer *This,
        LPCWSTR pName,
        LONG lValue);

    HRESULT (STDMETHODCALLTYPE *GetPropertyNum)(
        ISpRecognizer *This,
        LPCWSTR pName,
        LONG *plValue);

    HRESULT (STDMETHODCALLTYPE *SetPropertyString)(
        ISpRecognizer *This,
        LPCWSTR pName,
        LPCWSTR pValue);

    HRESULT (STDMETHODCALLTYPE *GetPropertyString)(
        ISpRecognizer *This,
        LPCWSTR pName,
        LPWSTR *ppCoMemValue);

    /*** ISpRecognizer methods ***/
    HRESULT (STDMETHODCALLTYPE *SetRecognizer)(
        ISpRecognizer *This,
        ISpObjectToken *pRecognizer);

    HRESULT (STDMETHODCALLTYPE *GetRecognizer)(
        ISpRecognizer *This,
        ISpObjectToken **ppRecognizer);

    HRESULT (STDMETHODCALLTYPE *SetInput)(
        ISpRecognizer *This,
        IUnknown *pUnkInput,
        WINBOOL fAllowFormatChanges);

    HRESULT (STDMETHODCALLTYPE *GetInputObjectToken)(
        ISpRecognizer *This,
        ISpObjectToken **ppToken);

    HRESULT (STDMETHODCALLTYPE *GetInputStream)(
        ISpRecognizer *This,
        ISpStreamFormat **ppStream);

    HRESULT (STDMETHODCALLTYPE *CreateRecoContext)(
        ISpRecognizer *This,
        ISpRecoContext **ppNewCtxt);

    HRESULT (STDMETHODCALLTYPE *GetRecoProfile)(
        ISpRecognizer *This,
        ISpObjectToken **ppToken);

    HRESULT (STDMETHODCALLTYPE *SetRecoProfile)(
        ISpRecognizer *This,
        ISpObjectToken *pToken);

    HRESULT (STDMETHODCALLTYPE *IsSharedInstance)(
        ISpRecognizer *This);

    HRESULT (STDMETHODCALLTYPE *GetRecoState)(
        ISpRecognizer *This,
        SPRECOSTATE *pState);

    HRESULT (STDMETHODCALLTYPE *SetRecoState)(
        ISpRecognizer *This,
        SPRECOSTATE NewState);

    HRESULT (STDMETHODCALLTYPE *GetStatus)(
        ISpRecognizer *This,
        SPRECOGNIZERSTATUS *pStatus);

    HRESULT (STDMETHODCALLTYPE *GetFormat)(
        ISpRecognizer *This,
        SPSTREAMFORMATTYPE WaveFormatType,
        GUID *pFormatId,
        WAVEFORMATEX **ppCoMemWFEX);

    HRESULT (STDMETHODCALLTYPE *IsUISupported)(
        ISpRecognizer *This,
        LPCWSTR pszTypeOfUI,
        void *pvExtraData,
        ULONG cbExtraData,
        WINBOOL *pfSupported);

    HRESULT (STDMETHODCALLTYPE *DisplayUI)(
        ISpRecognizer *This,
        HWND hwndParent,
        LPCWSTR pszTitle,
        LPCWSTR pszTypeOfUI,
        void *pvExtraData,
        ULONG cbExtraData);

    HRESULT (STDMETHODCALLTYPE *EmulateRecognition)(
        ISpRecognizer *This,
        ISpPhrase *pPhrase);

    END_INTERFACE
} ISpRecognizerVtbl;

interface ISpRecognizer {
    CONST_VTBL ISpRecognizerVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpRecognizer_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpRecognizer_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpRecognizer_Release(This) (This)->lpVtbl->Release(This)
/*** ISpProperties methods ***/
#define ISpRecognizer_SetPropertyNum(This,pName,lValue) (This)->lpVtbl->SetPropertyNum(This,pName,lValue)
#define ISpRecognizer_GetPropertyNum(This,pName,plValue) (This)->lpVtbl->GetPropertyNum(This,pName,plValue)
#define ISpRecognizer_SetPropertyString(This,pName,pValue) (This)->lpVtbl->SetPropertyString(This,pName,pValue)
#define ISpRecognizer_GetPropertyString(This,pName,ppCoMemValue) (This)->lpVtbl->GetPropertyString(This,pName,ppCoMemValue)
/*** ISpRecognizer methods ***/
#define ISpRecognizer_SetRecognizer(This,pRecognizer) (This)->lpVtbl->SetRecognizer(This,pRecognizer)
#define ISpRecognizer_GetRecognizer(This,ppRecognizer) (This)->lpVtbl->GetRecognizer(This,ppRecognizer)
#define ISpRecognizer_SetInput(This,pUnkInput,fAllowFormatChanges) (This)->lpVtbl->SetInput(This,pUnkInput,fAllowFormatChanges)
#define ISpRecognizer_GetInputObjectToken(This,ppToken) (This)->lpVtbl->GetInputObjectToken(This,ppToken)
#define ISpRecognizer_GetInputStream(This,ppStream) (This)->lpVtbl->GetInputStream(This,ppStream)
#define ISpRecognizer_CreateRecoContext(This,ppNewCtxt) (This)->lpVtbl->CreateRecoContext(This,ppNewCtxt)
#define ISpRecognizer_GetRecoProfile(This,ppToken) (This)->lpVtbl->GetRecoProfile(This,ppToken)
#define ISpRecognizer_SetRecoProfile(This,pToken) (This)->lpVtbl->SetRecoProfile(This,pToken)
#define ISpRecognizer_IsSharedInstance(This) (This)->lpVtbl->IsSharedInstance(This)
#define ISpRecognizer_GetRecoState(This,pState) (This)->lpVtbl->GetRecoState(This,pState)
#define ISpRecognizer_SetRecoState(This,NewState) (This)->lpVtbl->SetRecoState(This,NewState)
#define ISpRecognizer_GetStatus(This,pStatus) (This)->lpVtbl->GetStatus(This,pStatus)
#define ISpRecognizer_GetFormat(This,WaveFormatType,pFormatId,ppCoMemWFEX) (This)->lpVtbl->GetFormat(This,WaveFormatType,pFormatId,ppCoMemWFEX)
#define ISpRecognizer_IsUISupported(This,pszTypeOfUI,pvExtraData,cbExtraData,pfSupported) (This)->lpVtbl->IsUISupported(This,pszTypeOfUI,pvExtraData,cbExtraData,pfSupported)
#define ISpRecognizer_DisplayUI(This,hwndParent,pszTitle,pszTypeOfUI,pvExtraData,cbExtraData) (This)->lpVtbl->DisplayUI(This,hwndParent,pszTitle,pszTypeOfUI,pvExtraData,cbExtraData)
#define ISpRecognizer_EmulateRecognition(This,pPhrase) (This)->lpVtbl->EmulateRecognition(This,pPhrase)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpRecognizer_QueryInterface(ISpRecognizer* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpRecognizer_AddRef(ISpRecognizer* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpRecognizer_Release(ISpRecognizer* This) {
    return This->lpVtbl->Release(This);
}
/*** ISpProperties methods ***/
static FORCEINLINE HRESULT ISpRecognizer_SetPropertyNum(ISpRecognizer* This,LPCWSTR pName,LONG lValue) {
    return This->lpVtbl->SetPropertyNum(This,pName,lValue);
}
static FORCEINLINE HRESULT ISpRecognizer_GetPropertyNum(ISpRecognizer* This,LPCWSTR pName,LONG *plValue) {
    return This->lpVtbl->GetPropertyNum(This,pName,plValue);
}
static FORCEINLINE HRESULT ISpRecognizer_SetPropertyString(ISpRecognizer* This,LPCWSTR pName,LPCWSTR pValue) {
    return This->lpVtbl->SetPropertyString(This,pName,pValue);
}
static FORCEINLINE HRESULT ISpRecognizer_GetPropertyString(ISpRecognizer* This,LPCWSTR pName,LPWSTR *ppCoMemValue) {
    return This->lpVtbl->GetPropertyString(This,pName,ppCoMemValue);
}
/*** ISpRecognizer methods ***/
static FORCEINLINE HRESULT ISpRecognizer_SetRecognizer(ISpRecognizer* This,ISpObjectToken *pRecognizer) {
    return This->lpVtbl->SetRecognizer(This,pRecognizer);
}
static FORCEINLINE HRESULT ISpRecognizer_GetRecognizer(ISpRecognizer* This,ISpObjectToken **ppRecognizer) {
    return This->lpVtbl->GetRecognizer(This,ppRecognizer);
}
static FORCEINLINE HRESULT ISpRecognizer_SetInput(ISpRecognizer* This,IUnknown *pUnkInput,WINBOOL fAllowFormatChanges) {
    return This->lpVtbl->SetInput(This,pUnkInput,fAllowFormatChanges);
}
static FORCEINLINE HRESULT ISpRecognizer_GetInputObjectToken(ISpRecognizer* This,ISpObjectToken **ppToken) {
    return This->lpVtbl->GetInputObjectToken(This,ppToken);
}
static FORCEINLINE HRESULT ISpRecognizer_GetInputStream(ISpRecognizer* This,ISpStreamFormat **ppStream) {
    return This->lpVtbl->GetInputStream(This,ppStream);
}
static FORCEINLINE HRESULT ISpRecognizer_CreateRecoContext(ISpRecognizer* This,ISpRecoContext **ppNewCtxt) {
    return This->lpVtbl->CreateRecoContext(This,ppNewCtxt);
}
static FORCEINLINE HRESULT ISpRecognizer_GetRecoProfile(ISpRecognizer* This,ISpObjectToken **ppToken) {
    return This->lpVtbl->GetRecoProfile(This,ppToken);
}
static FORCEINLINE HRESULT ISpRecognizer_SetRecoProfile(ISpRecognizer* This,ISpObjectToken *pToken) {
    return This->lpVtbl->SetRecoProfile(This,pToken);
}
static FORCEINLINE HRESULT ISpRecognizer_IsSharedInstance(ISpRecognizer* This) {
    return This->lpVtbl->IsSharedInstance(This);
}
static FORCEINLINE HRESULT ISpRecognizer_GetRecoState(ISpRecognizer* This,SPRECOSTATE *pState) {
    return This->lpVtbl->GetRecoState(This,pState);
}
static FORCEINLINE HRESULT ISpRecognizer_SetRecoState(ISpRecognizer* This,SPRECOSTATE NewState) {
    return This->lpVtbl->SetRecoState(This,NewState);
}
static FORCEINLINE HRESULT ISpRecognizer_GetStatus(ISpRecognizer* This,SPRECOGNIZERSTATUS *pStatus) {
    return This->lpVtbl->GetStatus(This,pStatus);
}
static FORCEINLINE HRESULT ISpRecognizer_GetFormat(ISpRecognizer* This,SPSTREAMFORMATTYPE WaveFormatType,GUID *pFormatId,WAVEFORMATEX **ppCoMemWFEX) {
    return This->lpVtbl->GetFormat(This,WaveFormatType,pFormatId,ppCoMemWFEX);
}
static FORCEINLINE HRESULT ISpRecognizer_IsUISupported(ISpRecognizer* This,LPCWSTR pszTypeOfUI,void *pvExtraData,ULONG cbExtraData,WINBOOL *pfSupported) {
    return This->lpVtbl->IsUISupported(This,pszTypeOfUI,pvExtraData,cbExtraData,pfSupported);
}
static FORCEINLINE HRESULT ISpRecognizer_DisplayUI(ISpRecognizer* This,HWND hwndParent,LPCWSTR pszTitle,LPCWSTR pszTypeOfUI,void *pvExtraData,ULONG cbExtraData) {
    return This->lpVtbl->DisplayUI(This,hwndParent,pszTitle,pszTypeOfUI,pvExtraData,cbExtraData);
}
static FORCEINLINE HRESULT ISpRecognizer_EmulateRecognition(ISpRecognizer* This,ISpPhrase *pPhrase) {
    return This->lpVtbl->EmulateRecognition(This,pPhrase);
}
#endif
#endif

#endif


#endif  /* __ISpRecognizer_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpSerializeState interface
 */
#ifndef __ISpSerializeState_INTERFACE_DEFINED__
#define __ISpSerializeState_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpSerializeState, 0x21b501a0, 0x0ec7, 0x46c9, 0x92,0xc3, 0xa2,0xbc,0x78,0x4c,0x54,0xb9);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("21b501a0-0ec7-46c9-92c3-a2bc784c54b9")
ISpSerializeState : public IUnknown
{
    virtual HRESULT STDMETHODCALLTYPE GetSerializedState(
        BYTE **ppbData,
        ULONG *pulSize,
        DWORD dwReserved) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetSerializedState(
        BYTE *pbData,
        ULONG ulSize,
        DWORD dwReserved) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpSerializeState, 0x21b501a0, 0x0ec7, 0x46c9, 0x92,0xc3, 0xa2,0xbc,0x78,0x4c,0x54,0xb9)
#endif
#else
typedef struct ISpSerializeStateVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpSerializeState *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpSerializeState *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpSerializeState *This);

    /*** ISpSerializeState methods ***/
    HRESULT (STDMETHODCALLTYPE *GetSerializedState)(
        ISpSerializeState *This,
        BYTE **ppbData,
        ULONG *pulSize,
        DWORD dwReserved);

    HRESULT (STDMETHODCALLTYPE *SetSerializedState)(
        ISpSerializeState *This,
        BYTE *pbData,
        ULONG ulSize,
        DWORD dwReserved);

    END_INTERFACE
} ISpSerializeStateVtbl;

interface ISpSerializeState {
    CONST_VTBL ISpSerializeStateVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpSerializeState_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpSerializeState_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpSerializeState_Release(This) (This)->lpVtbl->Release(This)
/*** ISpSerializeState methods ***/
#define ISpSerializeState_GetSerializedState(This,ppbData,pulSize,dwReserved) (This)->lpVtbl->GetSerializedState(This,ppbData,pulSize,dwReserved)
#define ISpSerializeState_SetSerializedState(This,pbData,ulSize,dwReserved) (This)->lpVtbl->SetSerializedState(This,pbData,ulSize,dwReserved)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpSerializeState_QueryInterface(ISpSerializeState* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpSerializeState_AddRef(ISpSerializeState* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpSerializeState_Release(ISpSerializeState* This) {
    return This->lpVtbl->Release(This);
}
/*** ISpSerializeState methods ***/
static FORCEINLINE HRESULT ISpSerializeState_GetSerializedState(ISpSerializeState* This,BYTE **ppbData,ULONG *pulSize,DWORD dwReserved) {
    return This->lpVtbl->GetSerializedState(This,ppbData,pulSize,dwReserved);
}
static FORCEINLINE HRESULT ISpSerializeState_SetSerializedState(ISpSerializeState* This,BYTE *pbData,ULONG ulSize,DWORD dwReserved) {
    return This->lpVtbl->SetSerializedState(This,pbData,ulSize,dwReserved);
}
#endif
#endif

#endif


#endif  /* __ISpSerializeState_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpRecognizer2 interface
 */
#ifndef __ISpRecognizer2_INTERFACE_DEFINED__
#define __ISpRecognizer2_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpRecognizer2, 0x8fc6d974, 0xc81e, 0x4098, 0x93,0xc5, 0x01,0x47,0xf6,0x1e,0xd4,0xd3);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("8fc6d974-c81e-4098-93c5-0147f61ed4d3")
ISpRecognizer2 : public IUnknown
{
    virtual HRESULT STDMETHODCALLTYPE EmulateRecognitionEx(
        ISpPhrase *pPhrase,
        DWORD dwCompareFlags) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetTrainingState(
        WINBOOL fDoingTraining,
        WINBOOL fAdaptFromTrainingData) = 0;

    virtual HRESULT STDMETHODCALLTYPE ResetAcousticModelAdaptation(
        ) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpRecognizer2, 0x8fc6d974, 0xc81e, 0x4098, 0x93,0xc5, 0x01,0x47,0xf6,0x1e,0xd4,0xd3)
#endif
#else
typedef struct ISpRecognizer2Vtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpRecognizer2 *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpRecognizer2 *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpRecognizer2 *This);

    /*** ISpRecognizer2 methods ***/
    HRESULT (STDMETHODCALLTYPE *EmulateRecognitionEx)(
        ISpRecognizer2 *This,
        ISpPhrase *pPhrase,
        DWORD dwCompareFlags);

    HRESULT (STDMETHODCALLTYPE *SetTrainingState)(
        ISpRecognizer2 *This,
        WINBOOL fDoingTraining,
        WINBOOL fAdaptFromTrainingData);

    HRESULT (STDMETHODCALLTYPE *ResetAcousticModelAdaptation)(
        ISpRecognizer2 *This);

    END_INTERFACE
} ISpRecognizer2Vtbl;

interface ISpRecognizer2 {
    CONST_VTBL ISpRecognizer2Vtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpRecognizer2_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpRecognizer2_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpRecognizer2_Release(This) (This)->lpVtbl->Release(This)
/*** ISpRecognizer2 methods ***/
#define ISpRecognizer2_EmulateRecognitionEx(This,pPhrase,dwCompareFlags) (This)->lpVtbl->EmulateRecognitionEx(This,pPhrase,dwCompareFlags)
#define ISpRecognizer2_SetTrainingState(This,fDoingTraining,fAdaptFromTrainingData) (This)->lpVtbl->SetTrainingState(This,fDoingTraining,fAdaptFromTrainingData)
#define ISpRecognizer2_ResetAcousticModelAdaptation(This) (This)->lpVtbl->ResetAcousticModelAdaptation(This)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpRecognizer2_QueryInterface(ISpRecognizer2* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpRecognizer2_AddRef(ISpRecognizer2* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpRecognizer2_Release(ISpRecognizer2* This) {
    return This->lpVtbl->Release(This);
}
/*** ISpRecognizer2 methods ***/
static FORCEINLINE HRESULT ISpRecognizer2_EmulateRecognitionEx(ISpRecognizer2* This,ISpPhrase *pPhrase,DWORD dwCompareFlags) {
    return This->lpVtbl->EmulateRecognitionEx(This,pPhrase,dwCompareFlags);
}
static FORCEINLINE HRESULT ISpRecognizer2_SetTrainingState(ISpRecognizer2* This,WINBOOL fDoingTraining,WINBOOL fAdaptFromTrainingData) {
    return This->lpVtbl->SetTrainingState(This,fDoingTraining,fAdaptFromTrainingData);
}
static FORCEINLINE HRESULT ISpRecognizer2_ResetAcousticModelAdaptation(ISpRecognizer2* This) {
    return This->lpVtbl->ResetAcousticModelAdaptation(This);
}
#endif
#endif

#endif


#endif  /* __ISpRecognizer2_INTERFACE_DEFINED__ */

typedef struct SPNORMALIZATIONLIST {
    ULONG ulSize;
    WCHAR **ppszzNormalizedList;
} SPNORMALIZATIONLIST;
/*****************************************************************************
 * ISpEnginePronunciation interface
 */
#ifndef __ISpEnginePronunciation_INTERFACE_DEFINED__
#define __ISpEnginePronunciation_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpEnginePronunciation, 0xc360ce4b, 0x76d1, 0x4214, 0xad,0x68, 0x52,0x65,0x7d,0x50,0x83,0xda);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("c360ce4b-76d1-4214-ad68-52657d5083da")
ISpEnginePronunciation : public IUnknown
{
    virtual HRESULT STDMETHODCALLTYPE Normalize(
        LPCWSTR pszWord,
        LPCWSTR pszLeftContext,
        LPCWSTR pszRightContext,
        WORD LangID,
        SPNORMALIZATIONLIST *pNormalizationList) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetPronunciations(
        LPCWSTR pszWord,
        LPCWSTR pszLeftContext,
        LPCWSTR pszRightContext,
        WORD LangID,
        SPWORDPRONUNCIATIONLIST *pEnginePronunciationList) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpEnginePronunciation, 0xc360ce4b, 0x76d1, 0x4214, 0xad,0x68, 0x52,0x65,0x7d,0x50,0x83,0xda)
#endif
#else
typedef struct ISpEnginePronunciationVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpEnginePronunciation *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpEnginePronunciation *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpEnginePronunciation *This);

    /*** ISpEnginePronunciation methods ***/
    HRESULT (STDMETHODCALLTYPE *Normalize)(
        ISpEnginePronunciation *This,
        LPCWSTR pszWord,
        LPCWSTR pszLeftContext,
        LPCWSTR pszRightContext,
        WORD LangID,
        SPNORMALIZATIONLIST *pNormalizationList);

    HRESULT (STDMETHODCALLTYPE *GetPronunciations)(
        ISpEnginePronunciation *This,
        LPCWSTR pszWord,
        LPCWSTR pszLeftContext,
        LPCWSTR pszRightContext,
        WORD LangID,
        SPWORDPRONUNCIATIONLIST *pEnginePronunciationList);

    END_INTERFACE
} ISpEnginePronunciationVtbl;

interface ISpEnginePronunciation {
    CONST_VTBL ISpEnginePronunciationVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpEnginePronunciation_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpEnginePronunciation_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpEnginePronunciation_Release(This) (This)->lpVtbl->Release(This)
/*** ISpEnginePronunciation methods ***/
#define ISpEnginePronunciation_Normalize(This,pszWord,pszLeftContext,pszRightContext,LangID,pNormalizationList) (This)->lpVtbl->Normalize(This,pszWord,pszLeftContext,pszRightContext,LangID,pNormalizationList)
#define ISpEnginePronunciation_GetPronunciations(This,pszWord,pszLeftContext,pszRightContext,LangID,pEnginePronunciationList) (This)->lpVtbl->GetPronunciations(This,pszWord,pszLeftContext,pszRightContext,LangID,pEnginePronunciationList)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpEnginePronunciation_QueryInterface(ISpEnginePronunciation* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpEnginePronunciation_AddRef(ISpEnginePronunciation* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpEnginePronunciation_Release(ISpEnginePronunciation* This) {
    return This->lpVtbl->Release(This);
}
/*** ISpEnginePronunciation methods ***/
static FORCEINLINE HRESULT ISpEnginePronunciation_Normalize(ISpEnginePronunciation* This,LPCWSTR pszWord,LPCWSTR pszLeftContext,LPCWSTR pszRightContext,WORD LangID,SPNORMALIZATIONLIST *pNormalizationList) {
    return This->lpVtbl->Normalize(This,pszWord,pszLeftContext,pszRightContext,LangID,pNormalizationList);
}
static FORCEINLINE HRESULT ISpEnginePronunciation_GetPronunciations(ISpEnginePronunciation* This,LPCWSTR pszWord,LPCWSTR pszLeftContext,LPCWSTR pszRightContext,WORD LangID,SPWORDPRONUNCIATIONLIST *pEnginePronunciationList) {
    return This->lpVtbl->GetPronunciations(This,pszWord,pszLeftContext,pszRightContext,LangID,pEnginePronunciationList);
}
#endif
#endif

#endif


#endif  /* __ISpEnginePronunciation_INTERFACE_DEFINED__ */

typedef struct SPDISPLAYTOKEN {
    const WCHAR *pszLexical;
    const WCHAR *pszDisplay;
    BYTE bDisplayAttributes;
} SPDISPLAYTOKEN;
typedef struct SPDISPLAYPHRASE {
    ULONG ulNumTokens;
    SPDISPLAYTOKEN *pTokens;
} SPDISPLAYPHRASE;
/*****************************************************************************
 * ISpDisplayAlternates interface
 */
#ifndef __ISpDisplayAlternates_INTERFACE_DEFINED__
#define __ISpDisplayAlternates_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpDisplayAlternates, 0xc8d7c7e2, 0x0dde, 0x44b7, 0xaf,0xe3, 0xb0,0xc9,0x91,0xfb,0xeb,0x5e);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("c8d7c7e2-0dde-44b7-afe3-b0c991fbeb5e")
ISpDisplayAlternates : public IUnknown
{
    virtual HRESULT STDMETHODCALLTYPE GetDisplayAlternates(
        const SPDISPLAYPHRASE *pPhrase,
        ULONG cRequestCount,
        SPDISPLAYPHRASE **ppCoMemPhrases,
        ULONG *pcPhrasesReturned) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetFullStopTrailSpace(
        ULONG ulTrailSpace) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpDisplayAlternates, 0xc8d7c7e2, 0x0dde, 0x44b7, 0xaf,0xe3, 0xb0,0xc9,0x91,0xfb,0xeb,0x5e)
#endif
#else
typedef struct ISpDisplayAlternatesVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpDisplayAlternates *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpDisplayAlternates *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpDisplayAlternates *This);

    /*** ISpDisplayAlternates methods ***/
    HRESULT (STDMETHODCALLTYPE *GetDisplayAlternates)(
        ISpDisplayAlternates *This,
        const SPDISPLAYPHRASE *pPhrase,
        ULONG cRequestCount,
        SPDISPLAYPHRASE **ppCoMemPhrases,
        ULONG *pcPhrasesReturned);

    HRESULT (STDMETHODCALLTYPE *SetFullStopTrailSpace)(
        ISpDisplayAlternates *This,
        ULONG ulTrailSpace);

    END_INTERFACE
} ISpDisplayAlternatesVtbl;

interface ISpDisplayAlternates {
    CONST_VTBL ISpDisplayAlternatesVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpDisplayAlternates_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpDisplayAlternates_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpDisplayAlternates_Release(This) (This)->lpVtbl->Release(This)
/*** ISpDisplayAlternates methods ***/
#define ISpDisplayAlternates_GetDisplayAlternates(This,pPhrase,cRequestCount,ppCoMemPhrases,pcPhrasesReturned) (This)->lpVtbl->GetDisplayAlternates(This,pPhrase,cRequestCount,ppCoMemPhrases,pcPhrasesReturned)
#define ISpDisplayAlternates_SetFullStopTrailSpace(This,ulTrailSpace) (This)->lpVtbl->SetFullStopTrailSpace(This,ulTrailSpace)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpDisplayAlternates_QueryInterface(ISpDisplayAlternates* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpDisplayAlternates_AddRef(ISpDisplayAlternates* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpDisplayAlternates_Release(ISpDisplayAlternates* This) {
    return This->lpVtbl->Release(This);
}
/*** ISpDisplayAlternates methods ***/
static FORCEINLINE HRESULT ISpDisplayAlternates_GetDisplayAlternates(ISpDisplayAlternates* This,const SPDISPLAYPHRASE *pPhrase,ULONG cRequestCount,SPDISPLAYPHRASE **ppCoMemPhrases,ULONG *pcPhrasesReturned) {
    return This->lpVtbl->GetDisplayAlternates(This,pPhrase,cRequestCount,ppCoMemPhrases,pcPhrasesReturned);
}
static FORCEINLINE HRESULT ISpDisplayAlternates_SetFullStopTrailSpace(ISpDisplayAlternates* This,ULONG ulTrailSpace) {
    return This->lpVtbl->SetFullStopTrailSpace(This,ulTrailSpace);
}
#endif
#endif

#endif


#endif  /* __ISpDisplayAlternates_INTERFACE_DEFINED__ */

#ifndef __SpeechLib_LIBRARY_DEFINED__
#define __SpeechLib_LIBRARY_DEFINED__

DEFINE_GUID(LIBID_SpeechLib, 0xc866ca3a, 0x32f7, 0x11d2, 0x96,0x02, 0x00,0xc0,0x4f,0x8e,0xe6,0x28);

#ifndef __ISpeechDataKey_FWD_DEFINED__
#define __ISpeechDataKey_FWD_DEFINED__
typedef interface ISpeechDataKey ISpeechDataKey;
#ifdef __cplusplus
interface ISpeechDataKey;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechObjectToken_FWD_DEFINED__
#define __ISpeechObjectToken_FWD_DEFINED__
typedef interface ISpeechObjectToken ISpeechObjectToken;
#ifdef __cplusplus
interface ISpeechObjectToken;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechObjectTokens_FWD_DEFINED__
#define __ISpeechObjectTokens_FWD_DEFINED__
typedef interface ISpeechObjectTokens ISpeechObjectTokens;
#ifdef __cplusplus
interface ISpeechObjectTokens;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechObjectTokenCategory_FWD_DEFINED__
#define __ISpeechObjectTokenCategory_FWD_DEFINED__
typedef interface ISpeechObjectTokenCategory ISpeechObjectTokenCategory;
#ifdef __cplusplus
interface ISpeechObjectTokenCategory;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechAudioBufferInfo_FWD_DEFINED__
#define __ISpeechAudioBufferInfo_FWD_DEFINED__
typedef interface ISpeechAudioBufferInfo ISpeechAudioBufferInfo;
#ifdef __cplusplus
interface ISpeechAudioBufferInfo;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechAudioStatus_FWD_DEFINED__
#define __ISpeechAudioStatus_FWD_DEFINED__
typedef interface ISpeechAudioStatus ISpeechAudioStatus;
#ifdef __cplusplus
interface ISpeechAudioStatus;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechAudioFormat_FWD_DEFINED__
#define __ISpeechAudioFormat_FWD_DEFINED__
typedef interface ISpeechAudioFormat ISpeechAudioFormat;
#ifdef __cplusplus
interface ISpeechAudioFormat;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechWaveFormatEx_FWD_DEFINED__
#define __ISpeechWaveFormatEx_FWD_DEFINED__
typedef interface ISpeechWaveFormatEx ISpeechWaveFormatEx;
#ifdef __cplusplus
interface ISpeechWaveFormatEx;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechBaseStream_FWD_DEFINED__
#define __ISpeechBaseStream_FWD_DEFINED__
typedef interface ISpeechBaseStream ISpeechBaseStream;
#ifdef __cplusplus
interface ISpeechBaseStream;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechFileStream_FWD_DEFINED__
#define __ISpeechFileStream_FWD_DEFINED__
typedef interface ISpeechFileStream ISpeechFileStream;
#ifdef __cplusplus
interface ISpeechFileStream;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechMemoryStream_FWD_DEFINED__
#define __ISpeechMemoryStream_FWD_DEFINED__
typedef interface ISpeechMemoryStream ISpeechMemoryStream;
#ifdef __cplusplus
interface ISpeechMemoryStream;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechCustomStream_FWD_DEFINED__
#define __ISpeechCustomStream_FWD_DEFINED__
typedef interface ISpeechCustomStream ISpeechCustomStream;
#ifdef __cplusplus
interface ISpeechCustomStream;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechAudio_FWD_DEFINED__
#define __ISpeechAudio_FWD_DEFINED__
typedef interface ISpeechAudio ISpeechAudio;
#ifdef __cplusplus
interface ISpeechAudio;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechMMSysAudio_FWD_DEFINED__
#define __ISpeechMMSysAudio_FWD_DEFINED__
typedef interface ISpeechMMSysAudio ISpeechMMSysAudio;
#ifdef __cplusplus
interface ISpeechMMSysAudio;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechVoice_FWD_DEFINED__
#define __ISpeechVoice_FWD_DEFINED__
typedef interface ISpeechVoice ISpeechVoice;
#ifdef __cplusplus
interface ISpeechVoice;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechVoiceStatus_FWD_DEFINED__
#define __ISpeechVoiceStatus_FWD_DEFINED__
typedef interface ISpeechVoiceStatus ISpeechVoiceStatus;
#ifdef __cplusplus
interface ISpeechVoiceStatus;
#endif /* __cplusplus */
#endif

#ifndef ___ISpeechVoiceEvents_FWD_DEFINED__
#define ___ISpeechVoiceEvents_FWD_DEFINED__
typedef interface _ISpeechVoiceEvents _ISpeechVoiceEvents;
#ifdef __cplusplus
interface _ISpeechVoiceEvents;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechRecognizer_FWD_DEFINED__
#define __ISpeechRecognizer_FWD_DEFINED__
typedef interface ISpeechRecognizer ISpeechRecognizer;
#ifdef __cplusplus
interface ISpeechRecognizer;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechRecognizerStatus_FWD_DEFINED__
#define __ISpeechRecognizerStatus_FWD_DEFINED__
typedef interface ISpeechRecognizerStatus ISpeechRecognizerStatus;
#ifdef __cplusplus
interface ISpeechRecognizerStatus;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechRecoContext_FWD_DEFINED__
#define __ISpeechRecoContext_FWD_DEFINED__
typedef interface ISpeechRecoContext ISpeechRecoContext;
#ifdef __cplusplus
interface ISpeechRecoContext;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechRecoGrammar_FWD_DEFINED__
#define __ISpeechRecoGrammar_FWD_DEFINED__
typedef interface ISpeechRecoGrammar ISpeechRecoGrammar;
#ifdef __cplusplus
interface ISpeechRecoGrammar;
#endif /* __cplusplus */
#endif

#ifndef ___ISpeechRecoContextEvents_FWD_DEFINED__
#define ___ISpeechRecoContextEvents_FWD_DEFINED__
typedef interface _ISpeechRecoContextEvents _ISpeechRecoContextEvents;
#ifdef __cplusplus
interface _ISpeechRecoContextEvents;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechGrammarRule_FWD_DEFINED__
#define __ISpeechGrammarRule_FWD_DEFINED__
typedef interface ISpeechGrammarRule ISpeechGrammarRule;
#ifdef __cplusplus
interface ISpeechGrammarRule;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechGrammarRules_FWD_DEFINED__
#define __ISpeechGrammarRules_FWD_DEFINED__
typedef interface ISpeechGrammarRules ISpeechGrammarRules;
#ifdef __cplusplus
interface ISpeechGrammarRules;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechGrammarRuleState_FWD_DEFINED__
#define __ISpeechGrammarRuleState_FWD_DEFINED__
typedef interface ISpeechGrammarRuleState ISpeechGrammarRuleState;
#ifdef __cplusplus
interface ISpeechGrammarRuleState;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechGrammarRuleStateTransition_FWD_DEFINED__
#define __ISpeechGrammarRuleStateTransition_FWD_DEFINED__
typedef interface ISpeechGrammarRuleStateTransition ISpeechGrammarRuleStateTransition;
#ifdef __cplusplus
interface ISpeechGrammarRuleStateTransition;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechGrammarRuleStateTransitions_FWD_DEFINED__
#define __ISpeechGrammarRuleStateTransitions_FWD_DEFINED__
typedef interface ISpeechGrammarRuleStateTransitions ISpeechGrammarRuleStateTransitions;
#ifdef __cplusplus
interface ISpeechGrammarRuleStateTransitions;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechTextSelectionInformation_FWD_DEFINED__
#define __ISpeechTextSelectionInformation_FWD_DEFINED__
typedef interface ISpeechTextSelectionInformation ISpeechTextSelectionInformation;
#ifdef __cplusplus
interface ISpeechTextSelectionInformation;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechRecoResult_FWD_DEFINED__
#define __ISpeechRecoResult_FWD_DEFINED__
typedef interface ISpeechRecoResult ISpeechRecoResult;
#ifdef __cplusplus
interface ISpeechRecoResult;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechRecoResult2_FWD_DEFINED__
#define __ISpeechRecoResult2_FWD_DEFINED__
typedef interface ISpeechRecoResult2 ISpeechRecoResult2;
#ifdef __cplusplus
interface ISpeechRecoResult2;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechRecoResultTimes_FWD_DEFINED__
#define __ISpeechRecoResultTimes_FWD_DEFINED__
typedef interface ISpeechRecoResultTimes ISpeechRecoResultTimes;
#ifdef __cplusplus
interface ISpeechRecoResultTimes;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechPhraseAlternate_FWD_DEFINED__
#define __ISpeechPhraseAlternate_FWD_DEFINED__
typedef interface ISpeechPhraseAlternate ISpeechPhraseAlternate;
#ifdef __cplusplus
interface ISpeechPhraseAlternate;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechPhraseAlternates_FWD_DEFINED__
#define __ISpeechPhraseAlternates_FWD_DEFINED__
typedef interface ISpeechPhraseAlternates ISpeechPhraseAlternates;
#ifdef __cplusplus
interface ISpeechPhraseAlternates;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechPhraseInfo_FWD_DEFINED__
#define __ISpeechPhraseInfo_FWD_DEFINED__
typedef interface ISpeechPhraseInfo ISpeechPhraseInfo;
#ifdef __cplusplus
interface ISpeechPhraseInfo;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechPhraseElement_FWD_DEFINED__
#define __ISpeechPhraseElement_FWD_DEFINED__
typedef interface ISpeechPhraseElement ISpeechPhraseElement;
#ifdef __cplusplus
interface ISpeechPhraseElement;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechPhraseElements_FWD_DEFINED__
#define __ISpeechPhraseElements_FWD_DEFINED__
typedef interface ISpeechPhraseElements ISpeechPhraseElements;
#ifdef __cplusplus
interface ISpeechPhraseElements;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechPhraseReplacement_FWD_DEFINED__
#define __ISpeechPhraseReplacement_FWD_DEFINED__
typedef interface ISpeechPhraseReplacement ISpeechPhraseReplacement;
#ifdef __cplusplus
interface ISpeechPhraseReplacement;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechPhraseReplacements_FWD_DEFINED__
#define __ISpeechPhraseReplacements_FWD_DEFINED__
typedef interface ISpeechPhraseReplacements ISpeechPhraseReplacements;
#ifdef __cplusplus
interface ISpeechPhraseReplacements;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechPhraseProperty_FWD_DEFINED__
#define __ISpeechPhraseProperty_FWD_DEFINED__
typedef interface ISpeechPhraseProperty ISpeechPhraseProperty;
#ifdef __cplusplus
interface ISpeechPhraseProperty;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechPhraseProperties_FWD_DEFINED__
#define __ISpeechPhraseProperties_FWD_DEFINED__
typedef interface ISpeechPhraseProperties ISpeechPhraseProperties;
#ifdef __cplusplus
interface ISpeechPhraseProperties;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechPhraseRule_FWD_DEFINED__
#define __ISpeechPhraseRule_FWD_DEFINED__
typedef interface ISpeechPhraseRule ISpeechPhraseRule;
#ifdef __cplusplus
interface ISpeechPhraseRule;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechPhraseRules_FWD_DEFINED__
#define __ISpeechPhraseRules_FWD_DEFINED__
typedef interface ISpeechPhraseRules ISpeechPhraseRules;
#ifdef __cplusplus
interface ISpeechPhraseRules;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechLexicon_FWD_DEFINED__
#define __ISpeechLexicon_FWD_DEFINED__
typedef interface ISpeechLexicon ISpeechLexicon;
#ifdef __cplusplus
interface ISpeechLexicon;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechLexiconWords_FWD_DEFINED__
#define __ISpeechLexiconWords_FWD_DEFINED__
typedef interface ISpeechLexiconWords ISpeechLexiconWords;
#ifdef __cplusplus
interface ISpeechLexiconWords;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechLexiconWord_FWD_DEFINED__
#define __ISpeechLexiconWord_FWD_DEFINED__
typedef interface ISpeechLexiconWord ISpeechLexiconWord;
#ifdef __cplusplus
interface ISpeechLexiconWord;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechLexiconPronunciations_FWD_DEFINED__
#define __ISpeechLexiconPronunciations_FWD_DEFINED__
typedef interface ISpeechLexiconPronunciations ISpeechLexiconPronunciations;
#ifdef __cplusplus
interface ISpeechLexiconPronunciations;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechLexiconPronunciation_FWD_DEFINED__
#define __ISpeechLexiconPronunciation_FWD_DEFINED__
typedef interface ISpeechLexiconPronunciation ISpeechLexiconPronunciation;
#ifdef __cplusplus
interface ISpeechLexiconPronunciation;
#endif /* __cplusplus */
#endif

typedef LONG SpeechLanguageId;
#define __SpeechStringConstants_MODULE_DEFINED__
typedef enum DISPID_SpeechDataKey {
    DISPID_SDKSetBinaryValue = 1,
    DISPID_SDKGetBinaryValue = 2,
    DISPID_SDKSetStringValue = 3,
    DISPID_SDKGetStringValue = 4,
    DISPID_SDKSetLongValue = 5,
    DISPID_SDKGetlongValue = 6,
    DISPID_SDKOpenKey = 7,
    DISPID_SDKCreateKey = 8,
    DISPID_SDKDeleteKey = 9,
    DISPID_SDKDeleteValue = 10,
    DISPID_SDKEnumKeys = 11,
    DISPID_SDKEnumValues = 12
} DISPID_SpeechDataKey;
typedef enum DISPID_SpeechObjectToken {
    DISPID_SOTId = 1,
    DISPID_SOTDataKey = 2,
    DISPID_SOTCategory = 3,
    DISPID_SOTGetDescription = 4,
    DISPID_SOTSetId = 5,
    DISPID_SOTGetAttribute = 6,
    DISPID_SOTCreateInstance = 7,
    DISPID_SOTRemove = 8,
    DISPID_SOTGetStorageFileName = 9,
    DISPID_SOTRemoveStorageFileName = 10,
    DISPID_SOTIsUISupported = 11,
    DISPID_SOTDisplayUI = 12,
    DISPID_SOTMatchesAttributes = 13
} DISPID_SpeechObjectToken;
typedef enum SpeechDataKeyLocation {
    SDKLDefaultLocation = SPDKL_DefaultLocation,
    SDKLCurrentUser = SPDKL_CurrentUser,
    SDKLLocalMachine = SPDKL_LocalMachine,
    SDKLCurrentConfig = SPDKL_CurrentConfig
} SpeechDataKeyLocation;
typedef enum SpeechTokenContext {
    STCInprocServer = CLSCTX_INPROC_SERVER,
    STCInprocHandler = CLSCTX_INPROC_HANDLER,
    STCLocalServer = CLSCTX_LOCAL_SERVER,
    STCRemoteServer = CLSCTX_REMOTE_SERVER,
    STCAll = ((CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER) | CLSCTX_LOCAL_SERVER) | CLSCTX_REMOTE_SERVER
} SpeechTokenContext;
typedef enum SpeechTokenShellFolder {
    STSF_AppData = 0x1a,
    STSF_LocalAppData = 0x1c,
    STSF_CommonAppData = 0x23,
    STSF_FlagCreate = 0x8000
} SpeechTokenShellFolder;
typedef enum DISPID_SpeechObjectTokens {
    DISPID_SOTsCount = 1,
    DISPID_SOTsItem = DISPID_VALUE,
    DISPID_SOTs_NewEnum = DISPID_NEWENUM
} DISPID_SpeechObjectTokens;
typedef enum DISPID_SpeechObjectTokenCategory {
    DISPID_SOTCId = 1,
    DISPID_SOTCDefault = 2,
    DISPID_SOTCSetId = 3,
    DISPID_SOTCGetDataKey = 4,
    DISPID_SOTCEnumerateTokens = 5
} DISPID_SpeechObjectTokenCategory;
/*****************************************************************************
 * ISpeechDataKey interface
 */
#ifndef __ISpeechDataKey_INTERFACE_DEFINED__
#define __ISpeechDataKey_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpeechDataKey, 0xce17c09b, 0x4efa, 0x44d5, 0xa4,0xc9, 0x59,0xd9,0x58,0x5a,0xb0,0xcd);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("ce17c09b-4efa-44d5-a4c9-59d9585ab0cd")
ISpeechDataKey : public IDispatch
{
    virtual HRESULT STDMETHODCALLTYPE SetBinaryValue(
        const BSTR ValueName,
        VARIANT Value) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetBinaryValue(
        const BSTR ValueName,
        VARIANT *Value) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetStringValue(
        const BSTR ValueName,
        const BSTR Value) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetStringValue(
        const BSTR ValueName,
        BSTR *Value) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetLongValue(
        const BSTR ValueName,
        LONG Value) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetLongValue(
        const BSTR ValueName,
        LONG *Value) = 0;

    virtual HRESULT STDMETHODCALLTYPE OpenKey(
        const BSTR SubKeyName,
        ISpeechDataKey **SubKey) = 0;

    virtual HRESULT STDMETHODCALLTYPE CreateKey(
        const BSTR SubKeyName,
        ISpeechDataKey **SubKey) = 0;

    virtual HRESULT STDMETHODCALLTYPE DeleteKey(
        const BSTR SubKeyName) = 0;

    virtual HRESULT STDMETHODCALLTYPE DeleteValue(
        const BSTR ValueName) = 0;

    virtual HRESULT STDMETHODCALLTYPE EnumKeys(
        LONG Index,
        BSTR *SubKeyName) = 0;

    virtual HRESULT STDMETHODCALLTYPE EnumValues(
        LONG Index,
        BSTR *ValueName) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpeechDataKey, 0xce17c09b, 0x4efa, 0x44d5, 0xa4,0xc9, 0x59,0xd9,0x58,0x5a,0xb0,0xcd)
#endif
#else
typedef struct ISpeechDataKeyVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpeechDataKey *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpeechDataKey *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpeechDataKey *This);

    /*** IDispatch methods ***/
    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
        ISpeechDataKey *This,
        UINT *pctinfo);

    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
        ISpeechDataKey *This,
        UINT iTInfo,
        LCID lcid,
        ITypeInfo **ppTInfo);

    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
        ISpeechDataKey *This,
        REFIID riid,
        LPOLESTR *rgszNames,
        UINT cNames,
        LCID lcid,
        DISPID *rgDispId);

    HRESULT (STDMETHODCALLTYPE *Invoke)(
        ISpeechDataKey *This,
        DISPID dispIdMember,
        REFIID riid,
        LCID lcid,
        WORD wFlags,
        DISPPARAMS *pDispParams,
        VARIANT *pVarResult,
        EXCEPINFO *pExcepInfo,
        UINT *puArgErr);

    /*** ISpeechDataKey methods ***/
    HRESULT (STDMETHODCALLTYPE *SetBinaryValue)(
        ISpeechDataKey *This,
        const BSTR ValueName,
        VARIANT Value);

    HRESULT (STDMETHODCALLTYPE *GetBinaryValue)(
        ISpeechDataKey *This,
        const BSTR ValueName,
        VARIANT *Value);

    HRESULT (STDMETHODCALLTYPE *SetStringValue)(
        ISpeechDataKey *This,
        const BSTR ValueName,
        const BSTR Value);

    HRESULT (STDMETHODCALLTYPE *GetStringValue)(
        ISpeechDataKey *This,
        const BSTR ValueName,
        BSTR *Value);

    HRESULT (STDMETHODCALLTYPE *SetLongValue)(
        ISpeechDataKey *This,
        const BSTR ValueName,
        LONG Value);

    HRESULT (STDMETHODCALLTYPE *GetLongValue)(
        ISpeechDataKey *This,
        const BSTR ValueName,
        LONG *Value);

    HRESULT (STDMETHODCALLTYPE *OpenKey)(
        ISpeechDataKey *This,
        const BSTR SubKeyName,
        ISpeechDataKey **SubKey);

    HRESULT (STDMETHODCALLTYPE *CreateKey)(
        ISpeechDataKey *This,
        const BSTR SubKeyName,
        ISpeechDataKey **SubKey);

    HRESULT (STDMETHODCALLTYPE *DeleteKey)(
        ISpeechDataKey *This,
        const BSTR SubKeyName);

    HRESULT (STDMETHODCALLTYPE *DeleteValue)(
        ISpeechDataKey *This,
        const BSTR ValueName);

    HRESULT (STDMETHODCALLTYPE *EnumKeys)(
        ISpeechDataKey *This,
        LONG Index,
        BSTR *SubKeyName);

    HRESULT (STDMETHODCALLTYPE *EnumValues)(
        ISpeechDataKey *This,
        LONG Index,
        BSTR *ValueName);

    END_INTERFACE
} ISpeechDataKeyVtbl;

interface ISpeechDataKey {
    CONST_VTBL ISpeechDataKeyVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpeechDataKey_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpeechDataKey_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpeechDataKey_Release(This) (This)->lpVtbl->Release(This)
/*** IDispatch methods ***/
#define ISpeechDataKey_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
#define ISpeechDataKey_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
#define ISpeechDataKey_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
#define ISpeechDataKey_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
/*** ISpeechDataKey methods ***/
#define ISpeechDataKey_SetBinaryValue(This,ValueName,Value) (This)->lpVtbl->SetBinaryValue(This,ValueName,Value)
#define ISpeechDataKey_GetBinaryValue(This,ValueName,Value) (This)->lpVtbl->GetBinaryValue(This,ValueName,Value)
#define ISpeechDataKey_SetStringValue(This,ValueName,Value) (This)->lpVtbl->SetStringValue(This,ValueName,Value)
#define ISpeechDataKey_GetStringValue(This,ValueName,Value) (This)->lpVtbl->GetStringValue(This,ValueName,Value)
#define ISpeechDataKey_SetLongValue(This,ValueName,Value) (This)->lpVtbl->SetLongValue(This,ValueName,Value)
#define ISpeechDataKey_GetLongValue(This,ValueName,Value) (This)->lpVtbl->GetLongValue(This,ValueName,Value)
#define ISpeechDataKey_OpenKey(This,SubKeyName,SubKey) (This)->lpVtbl->OpenKey(This,SubKeyName,SubKey)
#define ISpeechDataKey_CreateKey(This,SubKeyName,SubKey) (This)->lpVtbl->CreateKey(This,SubKeyName,SubKey)
#define ISpeechDataKey_DeleteKey(This,SubKeyName) (This)->lpVtbl->DeleteKey(This,SubKeyName)
#define ISpeechDataKey_DeleteValue(This,ValueName) (This)->lpVtbl->DeleteValue(This,ValueName)
#define ISpeechDataKey_EnumKeys(This,Index,SubKeyName) (This)->lpVtbl->EnumKeys(This,Index,SubKeyName)
#define ISpeechDataKey_EnumValues(This,Index,ValueName) (This)->lpVtbl->EnumValues(This,Index,ValueName)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpeechDataKey_QueryInterface(ISpeechDataKey* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpeechDataKey_AddRef(ISpeechDataKey* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpeechDataKey_Release(ISpeechDataKey* This) {
    return This->lpVtbl->Release(This);
}
/*** IDispatch methods ***/
static FORCEINLINE HRESULT ISpeechDataKey_GetTypeInfoCount(ISpeechDataKey* This,UINT *pctinfo) {
    return This->lpVtbl->GetTypeInfoCount(This,pctinfo);
}
static FORCEINLINE HRESULT ISpeechDataKey_GetTypeInfo(ISpeechDataKey* This,UINT iTInfo,LCID lcid,ITypeInfo **ppTInfo) {
    return This->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo);
}
static FORCEINLINE HRESULT ISpeechDataKey_GetIDsOfNames(ISpeechDataKey* This,REFIID riid,LPOLESTR *rgszNames,UINT cNames,LCID lcid,DISPID *rgDispId) {
    return This->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId);
}
static FORCEINLINE HRESULT ISpeechDataKey_Invoke(ISpeechDataKey* This,DISPID dispIdMember,REFIID riid,LCID lcid,WORD wFlags,DISPPARAMS *pDispParams,VARIANT *pVarResult,EXCEPINFO *pExcepInfo,UINT *puArgErr) {
    return This->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr);
}
/*** ISpeechDataKey methods ***/
static FORCEINLINE HRESULT ISpeechDataKey_SetBinaryValue(ISpeechDataKey* This,const BSTR ValueName,VARIANT Value) {
    return This->lpVtbl->SetBinaryValue(This,ValueName,Value);
}
static FORCEINLINE HRESULT ISpeechDataKey_GetBinaryValue(ISpeechDataKey* This,const BSTR ValueName,VARIANT *Value) {
    return This->lpVtbl->GetBinaryValue(This,ValueName,Value);
}
static FORCEINLINE HRESULT ISpeechDataKey_SetStringValue(ISpeechDataKey* This,const BSTR ValueName,const BSTR Value) {
    return This->lpVtbl->SetStringValue(This,ValueName,Value);
}
static FORCEINLINE HRESULT ISpeechDataKey_GetStringValue(ISpeechDataKey* This,const BSTR ValueName,BSTR *Value) {
    return This->lpVtbl->GetStringValue(This,ValueName,Value);
}
static FORCEINLINE HRESULT ISpeechDataKey_SetLongValue(ISpeechDataKey* This,const BSTR ValueName,LONG Value) {
    return This->lpVtbl->SetLongValue(This,ValueName,Value);
}
static FORCEINLINE HRESULT ISpeechDataKey_GetLongValue(ISpeechDataKey* This,const BSTR ValueName,LONG *Value) {
    return This->lpVtbl->GetLongValue(This,ValueName,Value);
}
static FORCEINLINE HRESULT ISpeechDataKey_OpenKey(ISpeechDataKey* This,const BSTR SubKeyName,ISpeechDataKey **SubKey) {
    return This->lpVtbl->OpenKey(This,SubKeyName,SubKey);
}
static FORCEINLINE HRESULT ISpeechDataKey_CreateKey(ISpeechDataKey* This,const BSTR SubKeyName,ISpeechDataKey **SubKey) {
    return This->lpVtbl->CreateKey(This,SubKeyName,SubKey);
}
static FORCEINLINE HRESULT ISpeechDataKey_DeleteKey(ISpeechDataKey* This,const BSTR SubKeyName) {
    return This->lpVtbl->DeleteKey(This,SubKeyName);
}
static FORCEINLINE HRESULT ISpeechDataKey_DeleteValue(ISpeechDataKey* This,const BSTR ValueName) {
    return This->lpVtbl->DeleteValue(This,ValueName);
}
static FORCEINLINE HRESULT ISpeechDataKey_EnumKeys(ISpeechDataKey* This,LONG Index,BSTR *SubKeyName) {
    return This->lpVtbl->EnumKeys(This,Index,SubKeyName);
}
static FORCEINLINE HRESULT ISpeechDataKey_EnumValues(ISpeechDataKey* This,LONG Index,BSTR *ValueName) {
    return This->lpVtbl->EnumValues(This,Index,ValueName);
}
#endif
#endif

#endif


#endif  /* __ISpeechDataKey_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpeechObjectToken interface
 */
#ifndef __ISpeechObjectToken_INTERFACE_DEFINED__
#define __ISpeechObjectToken_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpeechObjectToken, 0xc74a3adc, 0xb727, 0x4500, 0xa8,0x4a, 0xb5,0x26,0x72,0x1c,0x8b,0x8c);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("c74a3adc-b727-4500-a84a-b526721c8b8c")
ISpeechObjectToken : public IDispatch
{
    virtual HRESULT STDMETHODCALLTYPE get_Id(
        BSTR *ObjectId) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_DataKey(
        ISpeechDataKey **DataKey) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_Category(
        ISpeechObjectTokenCategory **Category) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetDescription(
        LONG Locale,
        BSTR *Description) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetId(
        BSTR Id,
        BSTR CategoryID = L"",
        VARIANT_BOOL CreateIfNotExist = 0) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetAttribute(
        BSTR AttributeName,
        BSTR *AttributeValue) = 0;

    virtual HRESULT STDMETHODCALLTYPE CreateInstance(
        IUnknown *pUnkOuter,
        SpeechTokenContext ClsContext,
        IUnknown **Object) = 0;

    virtual HRESULT STDMETHODCALLTYPE Remove(
        BSTR ObjectStorageCLSID) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetStorageFileName(
        BSTR ObjectStorageCLSID,
        BSTR KeyName,
        BSTR FileName,
        SpeechTokenShellFolder Folder,
        BSTR *FilePath) = 0;

    virtual HRESULT STDMETHODCALLTYPE RemoveStorageFileName(
        BSTR ObjectStorageCLSID,
        BSTR KeyName,
        VARIANT_BOOL DeleteFile) = 0;

    virtual HRESULT STDMETHODCALLTYPE IsUISupported(
        const BSTR TypeOfUI,
        const VARIANT *ExtraData,
        IUnknown *Object,
        VARIANT_BOOL *Supported) = 0;

    virtual HRESULT STDMETHODCALLTYPE DisplayUI(
        LONG hWnd,
        BSTR Title,
        const BSTR TypeOfUI,
        const VARIANT *ExtraData = 0,
        IUnknown *Object = 0) = 0;

    virtual HRESULT STDMETHODCALLTYPE MatchesAttributes(
        BSTR Attributes,
        VARIANT_BOOL *Matches) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpeechObjectToken, 0xc74a3adc, 0xb727, 0x4500, 0xa8,0x4a, 0xb5,0x26,0x72,0x1c,0x8b,0x8c)
#endif
#else
typedef struct ISpeechObjectTokenVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpeechObjectToken *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpeechObjectToken *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpeechObjectToken *This);

    /*** IDispatch methods ***/
    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
        ISpeechObjectToken *This,
        UINT *pctinfo);

    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
        ISpeechObjectToken *This,
        UINT iTInfo,
        LCID lcid,
        ITypeInfo **ppTInfo);

    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
        ISpeechObjectToken *This,
        REFIID riid,
        LPOLESTR *rgszNames,
        UINT cNames,
        LCID lcid,
        DISPID *rgDispId);

    HRESULT (STDMETHODCALLTYPE *Invoke)(
        ISpeechObjectToken *This,
        DISPID dispIdMember,
        REFIID riid,
        LCID lcid,
        WORD wFlags,
        DISPPARAMS *pDispParams,
        VARIANT *pVarResult,
        EXCEPINFO *pExcepInfo,
        UINT *puArgErr);

    /*** ISpeechObjectToken methods ***/
    HRESULT (STDMETHODCALLTYPE *get_Id)(
        ISpeechObjectToken *This,
        BSTR *ObjectId);

    HRESULT (STDMETHODCALLTYPE *get_DataKey)(
        ISpeechObjectToken *This,
        ISpeechDataKey **DataKey);

    HRESULT (STDMETHODCALLTYPE *get_Category)(
        ISpeechObjectToken *This,
        ISpeechObjectTokenCategory **Category);

    HRESULT (STDMETHODCALLTYPE *GetDescription)(
        ISpeechObjectToken *This,
        LONG Locale,
        BSTR *Description);

    HRESULT (STDMETHODCALLTYPE *SetId)(
        ISpeechObjectToken *This,
        BSTR Id,
        BSTR CategoryID,
        VARIANT_BOOL CreateIfNotExist);

    HRESULT (STDMETHODCALLTYPE *GetAttribute)(
        ISpeechObjectToken *This,
        BSTR AttributeName,
        BSTR *AttributeValue);

    HRESULT (STDMETHODCALLTYPE *CreateInstance)(
        ISpeechObjectToken *This,
        IUnknown *pUnkOuter,
        SpeechTokenContext ClsContext,
        IUnknown **Object);

    HRESULT (STDMETHODCALLTYPE *Remove)(
        ISpeechObjectToken *This,
        BSTR ObjectStorageCLSID);

    HRESULT (STDMETHODCALLTYPE *GetStorageFileName)(
        ISpeechObjectToken *This,
        BSTR ObjectStorageCLSID,
        BSTR KeyName,
        BSTR FileName,
        SpeechTokenShellFolder Folder,
        BSTR *FilePath);

    HRESULT (STDMETHODCALLTYPE *RemoveStorageFileName)(
        ISpeechObjectToken *This,
        BSTR ObjectStorageCLSID,
        BSTR KeyName,
        VARIANT_BOOL DeleteFile);

    HRESULT (STDMETHODCALLTYPE *IsUISupported)(
        ISpeechObjectToken *This,
        const BSTR TypeOfUI,
        const VARIANT *ExtraData,
        IUnknown *Object,
        VARIANT_BOOL *Supported);

    HRESULT (STDMETHODCALLTYPE *DisplayUI)(
        ISpeechObjectToken *This,
        LONG hWnd,
        BSTR Title,
        const BSTR TypeOfUI,
        const VARIANT *ExtraData,
        IUnknown *Object);

    HRESULT (STDMETHODCALLTYPE *MatchesAttributes)(
        ISpeechObjectToken *This,
        BSTR Attributes,
        VARIANT_BOOL *Matches);

    END_INTERFACE
} ISpeechObjectTokenVtbl;

interface ISpeechObjectToken {
    CONST_VTBL ISpeechObjectTokenVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpeechObjectToken_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpeechObjectToken_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpeechObjectToken_Release(This) (This)->lpVtbl->Release(This)
/*** IDispatch methods ***/
#define ISpeechObjectToken_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
#define ISpeechObjectToken_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
#define ISpeechObjectToken_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
#define ISpeechObjectToken_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
/*** ISpeechObjectToken methods ***/
#define ISpeechObjectToken_get_Id(This,ObjectId) (This)->lpVtbl->get_Id(This,ObjectId)
#define ISpeechObjectToken_get_DataKey(This,DataKey) (This)->lpVtbl->get_DataKey(This,DataKey)
#define ISpeechObjectToken_get_Category(This,Category) (This)->lpVtbl->get_Category(This,Category)
#define ISpeechObjectToken_GetDescription(This,Locale,Description) (This)->lpVtbl->GetDescription(This,Locale,Description)
#define ISpeechObjectToken_SetId(This,Id,CategoryID,CreateIfNotExist) (This)->lpVtbl->SetId(This,Id,CategoryID,CreateIfNotExist)
#define ISpeechObjectToken_GetAttribute(This,AttributeName,AttributeValue) (This)->lpVtbl->GetAttribute(This,AttributeName,AttributeValue)
#define ISpeechObjectToken_CreateInstance(This,pUnkOuter,ClsContext,Object) (This)->lpVtbl->CreateInstance(This,pUnkOuter,ClsContext,Object)
#define ISpeechObjectToken_Remove(This,ObjectStorageCLSID) (This)->lpVtbl->Remove(This,ObjectStorageCLSID)
#define ISpeechObjectToken_GetStorageFileName(This,ObjectStorageCLSID,KeyName,FileName,Folder,FilePath) (This)->lpVtbl->GetStorageFileName(This,ObjectStorageCLSID,KeyName,FileName,Folder,FilePath)
#define ISpeechObjectToken_RemoveStorageFileName(This,ObjectStorageCLSID,KeyName,DeleteFile) (This)->lpVtbl->RemoveStorageFileName(This,ObjectStorageCLSID,KeyName,DeleteFile)
#define ISpeechObjectToken_IsUISupported(This,TypeOfUI,ExtraData,Object,Supported) (This)->lpVtbl->IsUISupported(This,TypeOfUI,ExtraData,Object,Supported)
#define ISpeechObjectToken_DisplayUI(This,hWnd,Title,TypeOfUI,ExtraData,Object) (This)->lpVtbl->DisplayUI(This,hWnd,Title,TypeOfUI,ExtraData,Object)
#define ISpeechObjectToken_MatchesAttributes(This,Attributes,Matches) (This)->lpVtbl->MatchesAttributes(This,Attributes,Matches)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpeechObjectToken_QueryInterface(ISpeechObjectToken* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpeechObjectToken_AddRef(ISpeechObjectToken* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpeechObjectToken_Release(ISpeechObjectToken* This) {
    return This->lpVtbl->Release(This);
}
/*** IDispatch methods ***/
static FORCEINLINE HRESULT ISpeechObjectToken_GetTypeInfoCount(ISpeechObjectToken* This,UINT *pctinfo) {
    return This->lpVtbl->GetTypeInfoCount(This,pctinfo);
}
static FORCEINLINE HRESULT ISpeechObjectToken_GetTypeInfo(ISpeechObjectToken* This,UINT iTInfo,LCID lcid,ITypeInfo **ppTInfo) {
    return This->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo);
}
static FORCEINLINE HRESULT ISpeechObjectToken_GetIDsOfNames(ISpeechObjectToken* This,REFIID riid,LPOLESTR *rgszNames,UINT cNames,LCID lcid,DISPID *rgDispId) {
    return This->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId);
}
static FORCEINLINE HRESULT ISpeechObjectToken_Invoke(ISpeechObjectToken* This,DISPID dispIdMember,REFIID riid,LCID lcid,WORD wFlags,DISPPARAMS *pDispParams,VARIANT *pVarResult,EXCEPINFO *pExcepInfo,UINT *puArgErr) {
    return This->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr);
}
/*** ISpeechObjectToken methods ***/
static FORCEINLINE HRESULT ISpeechObjectToken_get_Id(ISpeechObjectToken* This,BSTR *ObjectId) {
    return This->lpVtbl->get_Id(This,ObjectId);
}
static FORCEINLINE HRESULT ISpeechObjectToken_get_DataKey(ISpeechObjectToken* This,ISpeechDataKey **DataKey) {
    return This->lpVtbl->get_DataKey(This,DataKey);
}
static FORCEINLINE HRESULT ISpeechObjectToken_get_Category(ISpeechObjectToken* This,ISpeechObjectTokenCategory **Category) {
    return This->lpVtbl->get_Category(This,Category);
}
static FORCEINLINE HRESULT ISpeechObjectToken_GetDescription(ISpeechObjectToken* This,LONG Locale,BSTR *Description) {
    return This->lpVtbl->GetDescription(This,Locale,Description);
}
static FORCEINLINE HRESULT ISpeechObjectToken_SetId(ISpeechObjectToken* This,BSTR Id,BSTR CategoryID,VARIANT_BOOL CreateIfNotExist) {
    return This->lpVtbl->SetId(This,Id,CategoryID,CreateIfNotExist);
}
static FORCEINLINE HRESULT ISpeechObjectToken_GetAttribute(ISpeechObjectToken* This,BSTR AttributeName,BSTR *AttributeValue) {
    return This->lpVtbl->GetAttribute(This,AttributeName,AttributeValue);
}
static FORCEINLINE HRESULT ISpeechObjectToken_CreateInstance(ISpeechObjectToken* This,IUnknown *pUnkOuter,SpeechTokenContext ClsContext,IUnknown **Object) {
    return This->lpVtbl->CreateInstance(This,pUnkOuter,ClsContext,Object);
}
static FORCEINLINE HRESULT ISpeechObjectToken_Remove(ISpeechObjectToken* This,BSTR ObjectStorageCLSID) {
    return This->lpVtbl->Remove(This,ObjectStorageCLSID);
}
static FORCEINLINE HRESULT ISpeechObjectToken_GetStorageFileName(ISpeechObjectToken* This,BSTR ObjectStorageCLSID,BSTR KeyName,BSTR FileName,SpeechTokenShellFolder Folder,BSTR *FilePath) {
    return This->lpVtbl->GetStorageFileName(This,ObjectStorageCLSID,KeyName,FileName,Folder,FilePath);
}
static FORCEINLINE HRESULT ISpeechObjectToken_RemoveStorageFileName(ISpeechObjectToken* This,BSTR ObjectStorageCLSID,BSTR KeyName,VARIANT_BOOL DeleteFile) {
    return This->lpVtbl->RemoveStorageFileName(This,ObjectStorageCLSID,KeyName,DeleteFile);
}
static FORCEINLINE HRESULT ISpeechObjectToken_IsUISupported(ISpeechObjectToken* This,const BSTR TypeOfUI,const VARIANT *ExtraData,IUnknown *Object,VARIANT_BOOL *Supported) {
    return This->lpVtbl->IsUISupported(This,TypeOfUI,ExtraData,Object,Supported);
}
static FORCEINLINE HRESULT ISpeechObjectToken_DisplayUI(ISpeechObjectToken* This,LONG hWnd,BSTR Title,const BSTR TypeOfUI,const VARIANT *ExtraData,IUnknown *Object) {
    return This->lpVtbl->DisplayUI(This,hWnd,Title,TypeOfUI,ExtraData,Object);
}
static FORCEINLINE HRESULT ISpeechObjectToken_MatchesAttributes(ISpeechObjectToken* This,BSTR Attributes,VARIANT_BOOL *Matches) {
    return This->lpVtbl->MatchesAttributes(This,Attributes,Matches);
}
#endif
#endif

#endif


#endif  /* __ISpeechObjectToken_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpeechObjectTokens interface
 */
#ifndef __ISpeechObjectTokens_INTERFACE_DEFINED__
#define __ISpeechObjectTokens_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpeechObjectTokens, 0x9285b776, 0x2e7b, 0x4bc0, 0xb5,0x3e, 0x58,0x0e,0xb6,0xfa,0x96,0x7f);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("9285b776-2e7b-4bc0-b53e-580eb6fa967f")
ISpeechObjectTokens : public IDispatch
{
    virtual HRESULT STDMETHODCALLTYPE get_Count(
        LONG *Count) = 0;

    virtual HRESULT STDMETHODCALLTYPE Item(
        LONG Index,
        ISpeechObjectToken **Token) = 0;

    virtual HRESULT STDMETHODCALLTYPE get__NewEnum(
        IUnknown **ppEnumVARIANT) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpeechObjectTokens, 0x9285b776, 0x2e7b, 0x4bc0, 0xb5,0x3e, 0x58,0x0e,0xb6,0xfa,0x96,0x7f)
#endif
#else
typedef struct ISpeechObjectTokensVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpeechObjectTokens *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpeechObjectTokens *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpeechObjectTokens *This);

    /*** IDispatch methods ***/
    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
        ISpeechObjectTokens *This,
        UINT *pctinfo);

    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
        ISpeechObjectTokens *This,
        UINT iTInfo,
        LCID lcid,
        ITypeInfo **ppTInfo);

    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
        ISpeechObjectTokens *This,
        REFIID riid,
        LPOLESTR *rgszNames,
        UINT cNames,
        LCID lcid,
        DISPID *rgDispId);

    HRESULT (STDMETHODCALLTYPE *Invoke)(
        ISpeechObjectTokens *This,
        DISPID dispIdMember,
        REFIID riid,
        LCID lcid,
        WORD wFlags,
        DISPPARAMS *pDispParams,
        VARIANT *pVarResult,
        EXCEPINFO *pExcepInfo,
        UINT *puArgErr);

    /*** ISpeechObjectTokens methods ***/
    HRESULT (STDMETHODCALLTYPE *get_Count)(
        ISpeechObjectTokens *This,
        LONG *Count);

    HRESULT (STDMETHODCALLTYPE *Item)(
        ISpeechObjectTokens *This,
        LONG Index,
        ISpeechObjectToken **Token);

    HRESULT (STDMETHODCALLTYPE *get__NewEnum)(
        ISpeechObjectTokens *This,
        IUnknown **ppEnumVARIANT);

    END_INTERFACE
} ISpeechObjectTokensVtbl;

interface ISpeechObjectTokens {
    CONST_VTBL ISpeechObjectTokensVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpeechObjectTokens_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpeechObjectTokens_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpeechObjectTokens_Release(This) (This)->lpVtbl->Release(This)
/*** IDispatch methods ***/
#define ISpeechObjectTokens_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
#define ISpeechObjectTokens_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
#define ISpeechObjectTokens_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
#define ISpeechObjectTokens_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
/*** ISpeechObjectTokens methods ***/
#define ISpeechObjectTokens_get_Count(This,Count) (This)->lpVtbl->get_Count(This,Count)
#define ISpeechObjectTokens_Item(This,Index,Token) (This)->lpVtbl->Item(This,Index,Token)
#define ISpeechObjectTokens_get__NewEnum(This,ppEnumVARIANT) (This)->lpVtbl->get__NewEnum(This,ppEnumVARIANT)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpeechObjectTokens_QueryInterface(ISpeechObjectTokens* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpeechObjectTokens_AddRef(ISpeechObjectTokens* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpeechObjectTokens_Release(ISpeechObjectTokens* This) {
    return This->lpVtbl->Release(This);
}
/*** IDispatch methods ***/
static FORCEINLINE HRESULT ISpeechObjectTokens_GetTypeInfoCount(ISpeechObjectTokens* This,UINT *pctinfo) {
    return This->lpVtbl->GetTypeInfoCount(This,pctinfo);
}
static FORCEINLINE HRESULT ISpeechObjectTokens_GetTypeInfo(ISpeechObjectTokens* This,UINT iTInfo,LCID lcid,ITypeInfo **ppTInfo) {
    return This->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo);
}
static FORCEINLINE HRESULT ISpeechObjectTokens_GetIDsOfNames(ISpeechObjectTokens* This,REFIID riid,LPOLESTR *rgszNames,UINT cNames,LCID lcid,DISPID *rgDispId) {
    return This->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId);
}
static FORCEINLINE HRESULT ISpeechObjectTokens_Invoke(ISpeechObjectTokens* This,DISPID dispIdMember,REFIID riid,LCID lcid,WORD wFlags,DISPPARAMS *pDispParams,VARIANT *pVarResult,EXCEPINFO *pExcepInfo,UINT *puArgErr) {
    return This->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr);
}
/*** ISpeechObjectTokens methods ***/
static FORCEINLINE HRESULT ISpeechObjectTokens_get_Count(ISpeechObjectTokens* This,LONG *Count) {
    return This->lpVtbl->get_Count(This,Count);
}
static FORCEINLINE HRESULT ISpeechObjectTokens_Item(ISpeechObjectTokens* This,LONG Index,ISpeechObjectToken **Token) {
    return This->lpVtbl->Item(This,Index,Token);
}
static FORCEINLINE HRESULT ISpeechObjectTokens_get__NewEnum(ISpeechObjectTokens* This,IUnknown **ppEnumVARIANT) {
    return This->lpVtbl->get__NewEnum(This,ppEnumVARIANT);
}
#endif
#endif

#endif


#endif  /* __ISpeechObjectTokens_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpeechObjectTokenCategory interface
 */
#ifndef __ISpeechObjectTokenCategory_INTERFACE_DEFINED__
#define __ISpeechObjectTokenCategory_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpeechObjectTokenCategory, 0xca7eac50, 0x2d01, 0x4145, 0x86,0xd4, 0x5a,0xe7,0xd7,0x0f,0x44,0x69);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("ca7eac50-2d01-4145-86d4-5ae7d70f4469")
ISpeechObjectTokenCategory : public IDispatch
{
    virtual HRESULT STDMETHODCALLTYPE get_Id(
        BSTR *Id) = 0;

    virtual HRESULT STDMETHODCALLTYPE put_Default(
        const BSTR TokenId) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_Default(
        BSTR *TokenId) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetId(
        const BSTR Id,
        VARIANT_BOOL CreateIfNotExist = 0) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetDataKey(
        SpeechDataKeyLocation Location,
        ISpeechDataKey **DataKey) = 0;

    virtual HRESULT STDMETHODCALLTYPE EnumerateTokens(
        BSTR RequiredAttributes,
        BSTR OptionalAttributes,
        ISpeechObjectTokens **Tokens) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpeechObjectTokenCategory, 0xca7eac50, 0x2d01, 0x4145, 0x86,0xd4, 0x5a,0xe7,0xd7,0x0f,0x44,0x69)
#endif
#else
typedef struct ISpeechObjectTokenCategoryVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpeechObjectTokenCategory *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpeechObjectTokenCategory *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpeechObjectTokenCategory *This);

    /*** IDispatch methods ***/
    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
        ISpeechObjectTokenCategory *This,
        UINT *pctinfo);

    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
        ISpeechObjectTokenCategory *This,
        UINT iTInfo,
        LCID lcid,
        ITypeInfo **ppTInfo);

    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
        ISpeechObjectTokenCategory *This,
        REFIID riid,
        LPOLESTR *rgszNames,
        UINT cNames,
        LCID lcid,
        DISPID *rgDispId);

    HRESULT (STDMETHODCALLTYPE *Invoke)(
        ISpeechObjectTokenCategory *This,
        DISPID dispIdMember,
        REFIID riid,
        LCID lcid,
        WORD wFlags,
        DISPPARAMS *pDispParams,
        VARIANT *pVarResult,
        EXCEPINFO *pExcepInfo,
        UINT *puArgErr);

    /*** ISpeechObjectTokenCategory methods ***/
    HRESULT (STDMETHODCALLTYPE *get_Id)(
        ISpeechObjectTokenCategory *This,
        BSTR *Id);

    HRESULT (STDMETHODCALLTYPE *put_Default)(
        ISpeechObjectTokenCategory *This,
        const BSTR TokenId);

    HRESULT (STDMETHODCALLTYPE *get_Default)(
        ISpeechObjectTokenCategory *This,
        BSTR *TokenId);

    HRESULT (STDMETHODCALLTYPE *SetId)(
        ISpeechObjectTokenCategory *This,
        const BSTR Id,
        VARIANT_BOOL CreateIfNotExist);

    HRESULT (STDMETHODCALLTYPE *GetDataKey)(
        ISpeechObjectTokenCategory *This,
        SpeechDataKeyLocation Location,
        ISpeechDataKey **DataKey);

    HRESULT (STDMETHODCALLTYPE *EnumerateTokens)(
        ISpeechObjectTokenCategory *This,
        BSTR RequiredAttributes,
        BSTR OptionalAttributes,
        ISpeechObjectTokens **Tokens);

    END_INTERFACE
} ISpeechObjectTokenCategoryVtbl;

interface ISpeechObjectTokenCategory {
    CONST_VTBL ISpeechObjectTokenCategoryVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpeechObjectTokenCategory_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpeechObjectTokenCategory_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpeechObjectTokenCategory_Release(This) (This)->lpVtbl->Release(This)
/*** IDispatch methods ***/
#define ISpeechObjectTokenCategory_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
#define ISpeechObjectTokenCategory_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
#define ISpeechObjectTokenCategory_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
#define ISpeechObjectTokenCategory_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
/*** ISpeechObjectTokenCategory methods ***/
#define ISpeechObjectTokenCategory_get_Id(This,Id) (This)->lpVtbl->get_Id(This,Id)
#define ISpeechObjectTokenCategory_put_Default(This,TokenId) (This)->lpVtbl->put_Default(This,TokenId)
#define ISpeechObjectTokenCategory_get_Default(This,TokenId) (This)->lpVtbl->get_Default(This,TokenId)
#define ISpeechObjectTokenCategory_SetId(This,Id,CreateIfNotExist) (This)->lpVtbl->SetId(This,Id,CreateIfNotExist)
#define ISpeechObjectTokenCategory_GetDataKey(This,Location,DataKey) (This)->lpVtbl->GetDataKey(This,Location,DataKey)
#define ISpeechObjectTokenCategory_EnumerateTokens(This,RequiredAttributes,OptionalAttributes,Tokens) (This)->lpVtbl->EnumerateTokens(This,RequiredAttributes,OptionalAttributes,Tokens)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpeechObjectTokenCategory_QueryInterface(ISpeechObjectTokenCategory* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpeechObjectTokenCategory_AddRef(ISpeechObjectTokenCategory* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpeechObjectTokenCategory_Release(ISpeechObjectTokenCategory* This) {
    return This->lpVtbl->Release(This);
}
/*** IDispatch methods ***/
static FORCEINLINE HRESULT ISpeechObjectTokenCategory_GetTypeInfoCount(ISpeechObjectTokenCategory* This,UINT *pctinfo) {
    return This->lpVtbl->GetTypeInfoCount(This,pctinfo);
}
static FORCEINLINE HRESULT ISpeechObjectTokenCategory_GetTypeInfo(ISpeechObjectTokenCategory* This,UINT iTInfo,LCID lcid,ITypeInfo **ppTInfo) {
    return This->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo);
}
static FORCEINLINE HRESULT ISpeechObjectTokenCategory_GetIDsOfNames(ISpeechObjectTokenCategory* This,REFIID riid,LPOLESTR *rgszNames,UINT cNames,LCID lcid,DISPID *rgDispId) {
    return This->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId);
}
static FORCEINLINE HRESULT ISpeechObjectTokenCategory_Invoke(ISpeechObjectTokenCategory* This,DISPID dispIdMember,REFIID riid,LCID lcid,WORD wFlags,DISPPARAMS *pDispParams,VARIANT *pVarResult,EXCEPINFO *pExcepInfo,UINT *puArgErr) {
    return This->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr);
}
/*** ISpeechObjectTokenCategory methods ***/
static FORCEINLINE HRESULT ISpeechObjectTokenCategory_get_Id(ISpeechObjectTokenCategory* This,BSTR *Id) {
    return This->lpVtbl->get_Id(This,Id);
}
static FORCEINLINE HRESULT ISpeechObjectTokenCategory_put_Default(ISpeechObjectTokenCategory* This,const BSTR TokenId) {
    return This->lpVtbl->put_Default(This,TokenId);
}
static FORCEINLINE HRESULT ISpeechObjectTokenCategory_get_Default(ISpeechObjectTokenCategory* This,BSTR *TokenId) {
    return This->lpVtbl->get_Default(This,TokenId);
}
static FORCEINLINE HRESULT ISpeechObjectTokenCategory_SetId(ISpeechObjectTokenCategory* This,const BSTR Id,VARIANT_BOOL CreateIfNotExist) {
    return This->lpVtbl->SetId(This,Id,CreateIfNotExist);
}
static FORCEINLINE HRESULT ISpeechObjectTokenCategory_GetDataKey(ISpeechObjectTokenCategory* This,SpeechDataKeyLocation Location,ISpeechDataKey **DataKey) {
    return This->lpVtbl->GetDataKey(This,Location,DataKey);
}
static FORCEINLINE HRESULT ISpeechObjectTokenCategory_EnumerateTokens(ISpeechObjectTokenCategory* This,BSTR RequiredAttributes,BSTR OptionalAttributes,ISpeechObjectTokens **Tokens) {
    return This->lpVtbl->EnumerateTokens(This,RequiredAttributes,OptionalAttributes,Tokens);
}
#endif
#endif

#endif


#endif  /* __ISpeechObjectTokenCategory_INTERFACE_DEFINED__ */

typedef enum SpeechAudioFormatType {
    SAFTDefault = -1,
    SAFTNoAssignedFormat = 0,
    SAFTText = 1,
    SAFTNonStandardFormat = 2,
    SAFTExtendedAudioFormat = 3,
    SAFT8kHz8BitMono = 4,
    SAFT8kHz8BitStereo = 5,
    SAFT8kHz16BitMono = 6,
    SAFT8kHz16BitStereo = 7,
    SAFT11kHz8BitMono = 8,
    SAFT11kHz8BitStereo = 9,
    SAFT11kHz16BitMono = 10,
    SAFT11kHz16BitStereo = 11,
    SAFT12kHz8BitMono = 12,
    SAFT12kHz8BitStereo = 13,
    SAFT12kHz16BitMono = 14,
    SAFT12kHz16BitStereo = 15,
    SAFT16kHz8BitMono = 16,
    SAFT16kHz8BitStereo = 17,
    SAFT16kHz16BitMono = 18,
    SAFT16kHz16BitStereo = 19,
    SAFT22kHz8BitMono = 20,
    SAFT22kHz8BitStereo = 21,
    SAFT22kHz16BitMono = 22,
    SAFT22kHz16BitStereo = 23,
    SAFT24kHz8BitMono = 24,
    SAFT24kHz8BitStereo = 25,
    SAFT24kHz16BitMono = 26,
    SAFT24kHz16BitStereo = 27,
    SAFT32kHz8BitMono = 28,
    SAFT32kHz8BitStereo = 29,
    SAFT32kHz16BitMono = 30,
    SAFT32kHz16BitStereo = 31,
    SAFT44kHz8BitMono = 32,
    SAFT44kHz8BitStereo = 33,
    SAFT44kHz16BitMono = 34,
    SAFT44kHz16BitStereo = 35,
    SAFT48kHz8BitMono = 36,
    SAFT48kHz8BitStereo = 37,
    SAFT48kHz16BitMono = 38,
    SAFT48kHz16BitStereo = 39,
    SAFTTrueSpeech_8kHz1BitMono = 40,
    SAFTCCITT_ALaw_8kHzMono = 41,
    SAFTCCITT_ALaw_8kHzStereo = 42,
    SAFTCCITT_ALaw_11kHzMono = 43,
    SAFTCCITT_ALaw_11kHzStereo = 44,
    SAFTCCITT_ALaw_22kHzMono = 45,
    SAFTCCITT_ALaw_22kHzStereo = 46,
    SAFTCCITT_ALaw_44kHzMono = 47,
    SAFTCCITT_ALaw_44kHzStereo = 48,
    SAFTCCITT_uLaw_8kHzMono = 49,
    SAFTCCITT_uLaw_8kHzStereo = 50,
    SAFTCCITT_uLaw_11kHzMono = 51,
    SAFTCCITT_uLaw_11kHzStereo = 52,
    SAFTCCITT_uLaw_22kHzMono = 53,
    SAFTCCITT_uLaw_22kHzStereo = 54,
    SAFTCCITT_uLaw_44kHzMono = 55,
    SAFTCCITT_uLaw_44kHzStereo = 56,
    SAFTADPCM_8kHzMono = 57,
    SAFTADPCM_8kHzStereo = 58,
    SAFTADPCM_11kHzMono = 59,
    SAFTADPCM_11kHzStereo = 60,
    SAFTADPCM_22kHzMono = 61,
    SAFTADPCM_22kHzStereo = 62,
    SAFTADPCM_44kHzMono = 63,
    SAFTADPCM_44kHzStereo = 64,
    SAFTGSM610_8kHzMono = 65,
    SAFTGSM610_11kHzMono = 66,
    SAFTGSM610_22kHzMono = 67,
    SAFTGSM610_44kHzMono = 68
} SpeechAudioFormatType;
typedef enum DISPID_SpeechAudioFormat {
    DISPID_SAFType = 1,
    DISPID_SAFGuid = 2,
    DISPID_SAFGetWaveFormatEx = 3,
    DISPID_SAFSetWaveFormatEx = 4
} DISPID_SpeechAudioFormat;
typedef enum DISPID_SpeechBaseStream {
    DISPID_SBSFormat = 1,
    DISPID_SBSRead = 2,
    DISPID_SBSWrite = 3,
    DISPID_SBSSeek = 4
} DISPID_SpeechBaseStream;
typedef enum SpeechStreamSeekPositionType {
    SSSPTRelativeToStart = STREAM_SEEK_SET,
    SSSPTRelativeToCurrentPosition = STREAM_SEEK_CUR,
    SSSPTRelativeToEnd = STREAM_SEEK_END
} SpeechStreamSeekPositionType;
typedef enum DISPID_SpeechAudio {
    DISPID_SAStatus = 200,
    DISPID_SABufferInfo = 201,
    DISPID_SADefaultFormat = 202,
    DISPID_SAVolume = 203,
    DISPID_SABufferNotifySize = 204,
    DISPID_SAEventHandle = 205,
    DISPID_SASetState = 206
} DISPID_SpeechAudio;
typedef enum SpeechAudioState {
    SASClosed = SPAS_CLOSED,
    SASStop = SPAS_STOP,
    SASPause = SPAS_PAUSE,
    SASRun = SPAS_RUN
} SpeechAudioState;
typedef enum DISPID_SpeechMMSysAudio {
    DISPID_SMSADeviceId = 300,
    DISPID_SMSALineId = 301,
    DISPID_SMSAMMHandle = 302
} DISPID_SpeechMMSysAudio;
typedef enum DISPID_SpeechFileStream {
    DISPID_SFSOpen = 100,
    DISPID_SFSClose = 101
} DISPID_SpeechFileStream;
typedef enum SpeechStreamFileMode {
    SSFMOpenForRead = SPFM_OPEN_READONLY,
    SSFMOpenReadWrite = SPFM_OPEN_READWRITE,
    SSFMCreate = SPFM_CREATE,
    SSFMCreateForWrite = SPFM_CREATE_ALWAYS
} SpeechStreamFileMode;
typedef enum DISPID_SpeechCustomStream {
    DISPID_SCSBaseStream = 100
} DISPID_SpeechCustomStream;
typedef enum DISPID_SpeechMemoryStream {
    DISPID_SMSSetData = 100,
    DISPID_SMSGetData = 101
} DISPID_SpeechMemoryStream;
typedef enum DISPID_SpeechAudioStatus {
    DISPID_SASFreeBufferSpace = 1,
    DISPID_SASNonBlockingIO = 2,
    DISPID_SASState = 3,
    DISPID_SASCurrentSeekPosition = 4,
    DISPID_SASCurrentDevicePosition = 5
} DISPID_SpeechAudioStatus;
typedef enum DISPID_SpeechAudioBufferInfo {
    DISPID_SABIMinNotification = 1,
    DISPID_SABIBufferSize = 2,
    DISPID_SABIEventBias = 3
} DISPID_SpeechAudioBufferInfo;
typedef enum DISPID_SpeechWaveFormatEx {
    DISPID_SWFEFormatTag = 1,
    DISPID_SWFEChannels = 2,
    DISPID_SWFESamplesPerSec = 3,
    DISPID_SWFEAvgBytesPerSec = 4,
    DISPID_SWFEBlockAlign = 5,
    DISPID_SWFEBitsPerSample = 6,
    DISPID_SWFEExtraData = 7
} DISPID_SpeechWaveFormatEx;
typedef enum DISPID_SpeechVoice {
    DISPID_SVStatus = 1,
    DISPID_SVVoice = 2,
    DISPID_SVAudioOutput = 3,
    DISPID_SVAudioOutputStream = 4,
    DISPID_SVRate = 5,
    DISPID_SVVolume = 6,
    DISPID_SVAllowAudioOuputFormatChangesOnNextSet = 7,
    DISPID_SVEventInterests = 8,
    DISPID_SVPriority = 9,
    DISPID_SVAlertBoundary = 10,
    DISPID_SVSyncronousSpeakTimeout = 11,
    DISPID_SVSpeak = 12,
    DISPID_SVSpeakStream = 13,
    DISPID_SVPause = 14,
    DISPID_SVResume = 15,
    DISPID_SVSkip = 16,
    DISPID_SVGetVoices = 17,
    DISPID_SVGetAudioOutputs = 18,
    DISPID_SVWaitUntilDone = 19,
    DISPID_SVSpeakCompleteEvent = 20,
    DISPID_SVIsUISupported = 21,
    DISPID_SVDisplayUI = 22
} DISPID_SpeechVoice;
typedef enum SpeechVoicePriority {
    SVPNormal = SPVPRI_NORMAL,
    SVPAlert = SPVPRI_ALERT,
    SVPOver = SPVPRI_OVER
} SpeechVoicePriority;
typedef enum SpeechVoiceSpeakFlags {
    SVSFDefault = SPF_DEFAULT,
    SVSFlagsAsync = SPF_ASYNC,
    SVSFPurgeBeforeSpeak = SPF_PURGEBEFORESPEAK,
    SVSFIsFilename = SPF_IS_FILENAME,
    SVSFIsXML = SPF_IS_XML,
    SVSFIsNotXML = SPF_IS_NOT_XML,
    SVSFPersistXML = SPF_PERSIST_XML,
    SVSFNLPSpeakPunc = SPF_NLP_SPEAK_PUNC,
    SVSFParseSapi = SPF_PARSE_SAPI,
    SVSFParseSsml = SPF_PARSE_SSML,
    SVSFParseAutodetect = SPF_PARSE_AUTODETECT,
    SVSFNLPMask = SPF_NLP_MASK,
    SVSFParseMask = SPF_PARSE_MASK,
    SVSFVoiceMask = SPF_VOICE_MASK,
    SVSFUnusedFlags = SPF_UNUSED_FLAGS
} SpeechVoiceSpeakFlags;
typedef enum SpeechVoiceEvents {
    SVEStartInputStream = 0x2,
    SVEEndInputStream = 0x4,
    SVEVoiceChange = 0x8,
    SVEBookmark = 0x10,
    SVEWordBoundary = 0x20,
    SVEPhoneme = 0x40,
    SVESentenceBoundary = 0x80,
    SVEViseme = 0x100,
    SVEAudioLevel = 0x200,
    SVEPrivate = 0x8000,
    SVEAllEvents = 0x83fe
} SpeechVoiceEvents;
typedef enum DISPID_SpeechVoiceStatus {
    DISPID_SVSCurrentStreamNumber = 1,
    DISPID_SVSLastStreamNumberQueued = 2,
    DISPID_SVSLastResult = 3,
    DISPID_SVSRunningState = 4,
    DISPID_SVSInputWordPosition = 5,
    DISPID_SVSInputWordLength = 6,
    DISPID_SVSInputSentencePosition = 7,
    DISPID_SVSInputSentenceLength = 8,
    DISPID_SVSLastBookmark = 9,
    DISPID_SVSLastBookmarkId = 10,
    DISPID_SVSPhonemeId = 11,
    DISPID_SVSVisemeId = 12
} DISPID_SpeechVoiceStatus;
typedef enum SpeechRunState {
    SRSEDone = SPRS_DONE,
    SRSEIsSpeaking = SPRS_IS_SPEAKING
} SpeechRunState;
/*****************************************************************************
 * ISpeechAudioFormat interface
 */
#ifndef __ISpeechAudioFormat_INTERFACE_DEFINED__
#define __ISpeechAudioFormat_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpeechAudioFormat, 0xe6e9c590, 0x3e18, 0x40e3, 0x82,0x99, 0x06,0x1f,0x98,0xbd,0xe7,0xc7);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("e6e9c590-3e18-40e3-8299-061f98bde7c7")
ISpeechAudioFormat : public IDispatch
{
    virtual HRESULT STDMETHODCALLTYPE get_Type(
        SpeechAudioFormatType *AudioFormat) = 0;

    virtual HRESULT STDMETHODCALLTYPE put_Type(
        SpeechAudioFormatType AudioFormat) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_Guid(
        BSTR *Guid) = 0;

    virtual HRESULT STDMETHODCALLTYPE put_Guid(
        BSTR Guid) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetWaveFormatEx(
        ISpeechWaveFormatEx **SpeechWaveFormatEx) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetWaveFormatEx(
        ISpeechWaveFormatEx *SpeechWaveFormatEx) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpeechAudioFormat, 0xe6e9c590, 0x3e18, 0x40e3, 0x82,0x99, 0x06,0x1f,0x98,0xbd,0xe7,0xc7)
#endif
#else
typedef struct ISpeechAudioFormatVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpeechAudioFormat *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpeechAudioFormat *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpeechAudioFormat *This);

    /*** IDispatch methods ***/
    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
        ISpeechAudioFormat *This,
        UINT *pctinfo);

    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
        ISpeechAudioFormat *This,
        UINT iTInfo,
        LCID lcid,
        ITypeInfo **ppTInfo);

    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
        ISpeechAudioFormat *This,
        REFIID riid,
        LPOLESTR *rgszNames,
        UINT cNames,
        LCID lcid,
        DISPID *rgDispId);

    HRESULT (STDMETHODCALLTYPE *Invoke)(
        ISpeechAudioFormat *This,
        DISPID dispIdMember,
        REFIID riid,
        LCID lcid,
        WORD wFlags,
        DISPPARAMS *pDispParams,
        VARIANT *pVarResult,
        EXCEPINFO *pExcepInfo,
        UINT *puArgErr);

    /*** ISpeechAudioFormat methods ***/
    HRESULT (STDMETHODCALLTYPE *get_Type)(
        ISpeechAudioFormat *This,
        SpeechAudioFormatType *AudioFormat);

    HRESULT (STDMETHODCALLTYPE *put_Type)(
        ISpeechAudioFormat *This,
        SpeechAudioFormatType AudioFormat);

    HRESULT (STDMETHODCALLTYPE *get_Guid)(
        ISpeechAudioFormat *This,
        BSTR *Guid);

    HRESULT (STDMETHODCALLTYPE *put_Guid)(
        ISpeechAudioFormat *This,
        BSTR Guid);

    HRESULT (STDMETHODCALLTYPE *GetWaveFormatEx)(
        ISpeechAudioFormat *This,
        ISpeechWaveFormatEx **SpeechWaveFormatEx);

    HRESULT (STDMETHODCALLTYPE *SetWaveFormatEx)(
        ISpeechAudioFormat *This,
        ISpeechWaveFormatEx *SpeechWaveFormatEx);

    END_INTERFACE
} ISpeechAudioFormatVtbl;

interface ISpeechAudioFormat {
    CONST_VTBL ISpeechAudioFormatVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpeechAudioFormat_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpeechAudioFormat_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpeechAudioFormat_Release(This) (This)->lpVtbl->Release(This)
/*** IDispatch methods ***/
#define ISpeechAudioFormat_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
#define ISpeechAudioFormat_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
#define ISpeechAudioFormat_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
#define ISpeechAudioFormat_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
/*** ISpeechAudioFormat methods ***/
#define ISpeechAudioFormat_get_Type(This,AudioFormat) (This)->lpVtbl->get_Type(This,AudioFormat)
#define ISpeechAudioFormat_put_Type(This,AudioFormat) (This)->lpVtbl->put_Type(This,AudioFormat)
#define ISpeechAudioFormat_get_Guid(This,Guid) (This)->lpVtbl->get_Guid(This,Guid)
#define ISpeechAudioFormat_put_Guid(This,Guid) (This)->lpVtbl->put_Guid(This,Guid)
#define ISpeechAudioFormat_GetWaveFormatEx(This,SpeechWaveFormatEx) (This)->lpVtbl->GetWaveFormatEx(This,SpeechWaveFormatEx)
#define ISpeechAudioFormat_SetWaveFormatEx(This,SpeechWaveFormatEx) (This)->lpVtbl->SetWaveFormatEx(This,SpeechWaveFormatEx)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpeechAudioFormat_QueryInterface(ISpeechAudioFormat* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpeechAudioFormat_AddRef(ISpeechAudioFormat* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpeechAudioFormat_Release(ISpeechAudioFormat* This) {
    return This->lpVtbl->Release(This);
}
/*** IDispatch methods ***/
static FORCEINLINE HRESULT ISpeechAudioFormat_GetTypeInfoCount(ISpeechAudioFormat* This,UINT *pctinfo) {
    return This->lpVtbl->GetTypeInfoCount(This,pctinfo);
}
static FORCEINLINE HRESULT ISpeechAudioFormat_GetTypeInfo(ISpeechAudioFormat* This,UINT iTInfo,LCID lcid,ITypeInfo **ppTInfo) {
    return This->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo);
}
static FORCEINLINE HRESULT ISpeechAudioFormat_GetIDsOfNames(ISpeechAudioFormat* This,REFIID riid,LPOLESTR *rgszNames,UINT cNames,LCID lcid,DISPID *rgDispId) {
    return This->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId);
}
static FORCEINLINE HRESULT ISpeechAudioFormat_Invoke(ISpeechAudioFormat* This,DISPID dispIdMember,REFIID riid,LCID lcid,WORD wFlags,DISPPARAMS *pDispParams,VARIANT *pVarResult,EXCEPINFO *pExcepInfo,UINT *puArgErr) {
    return This->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr);
}
/*** ISpeechAudioFormat methods ***/
static FORCEINLINE HRESULT ISpeechAudioFormat_get_Type(ISpeechAudioFormat* This,SpeechAudioFormatType *AudioFormat) {
    return This->lpVtbl->get_Type(This,AudioFormat);
}
static FORCEINLINE HRESULT ISpeechAudioFormat_put_Type(ISpeechAudioFormat* This,SpeechAudioFormatType AudioFormat) {
    return This->lpVtbl->put_Type(This,AudioFormat);
}
static FORCEINLINE HRESULT ISpeechAudioFormat_get_Guid(ISpeechAudioFormat* This,BSTR *Guid) {
    return This->lpVtbl->get_Guid(This,Guid);
}
static FORCEINLINE HRESULT ISpeechAudioFormat_put_Guid(ISpeechAudioFormat* This,BSTR Guid) {
    return This->lpVtbl->put_Guid(This,Guid);
}
static FORCEINLINE HRESULT ISpeechAudioFormat_GetWaveFormatEx(ISpeechAudioFormat* This,ISpeechWaveFormatEx **SpeechWaveFormatEx) {
    return This->lpVtbl->GetWaveFormatEx(This,SpeechWaveFormatEx);
}
static FORCEINLINE HRESULT ISpeechAudioFormat_SetWaveFormatEx(ISpeechAudioFormat* This,ISpeechWaveFormatEx *SpeechWaveFormatEx) {
    return This->lpVtbl->SetWaveFormatEx(This,SpeechWaveFormatEx);
}
#endif
#endif

#endif


#endif  /* __ISpeechAudioFormat_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpeechBaseStream interface
 */
#ifndef __ISpeechBaseStream_INTERFACE_DEFINED__
#define __ISpeechBaseStream_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpeechBaseStream, 0x6450336f, 0x7d49, 0x4ced, 0x80,0x97, 0x49,0xd6,0xde,0xe3,0x72,0x94);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("6450336f-7d49-4ced-8097-49d6dee37294")
ISpeechBaseStream : public IDispatch
{
    virtual HRESULT STDMETHODCALLTYPE get_Format(
        ISpeechAudioFormat **AudioFormat) = 0;

    virtual HRESULT STDMETHODCALLTYPE putref_Format(
        ISpeechAudioFormat *AudioFormat) = 0;

    virtual HRESULT STDMETHODCALLTYPE Read(
        VARIANT *Buffer,
        LONG NumberOfBytes,
        LONG *BytesRead) = 0;

    virtual HRESULT STDMETHODCALLTYPE Write(
        VARIANT Buffer,
        LONG *BytesWritten) = 0;

    virtual HRESULT STDMETHODCALLTYPE Seek(
        VARIANT Position,
        SpeechStreamSeekPositionType Origin,
        VARIANT *NewPosition) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpeechBaseStream, 0x6450336f, 0x7d49, 0x4ced, 0x80,0x97, 0x49,0xd6,0xde,0xe3,0x72,0x94)
#endif
#else
typedef struct ISpeechBaseStreamVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpeechBaseStream *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpeechBaseStream *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpeechBaseStream *This);

    /*** IDispatch methods ***/
    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
        ISpeechBaseStream *This,
        UINT *pctinfo);

    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
        ISpeechBaseStream *This,
        UINT iTInfo,
        LCID lcid,
        ITypeInfo **ppTInfo);

    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
        ISpeechBaseStream *This,
        REFIID riid,
        LPOLESTR *rgszNames,
        UINT cNames,
        LCID lcid,
        DISPID *rgDispId);

    HRESULT (STDMETHODCALLTYPE *Invoke)(
        ISpeechBaseStream *This,
        DISPID dispIdMember,
        REFIID riid,
        LCID lcid,
        WORD wFlags,
        DISPPARAMS *pDispParams,
        VARIANT *pVarResult,
        EXCEPINFO *pExcepInfo,
        UINT *puArgErr);

    /*** ISpeechBaseStream methods ***/
    HRESULT (STDMETHODCALLTYPE *get_Format)(
        ISpeechBaseStream *This,
        ISpeechAudioFormat **AudioFormat);

    HRESULT (STDMETHODCALLTYPE *putref_Format)(
        ISpeechBaseStream *This,
        ISpeechAudioFormat *AudioFormat);

    HRESULT (STDMETHODCALLTYPE *Read)(
        ISpeechBaseStream *This,
        VARIANT *Buffer,
        LONG NumberOfBytes,
        LONG *BytesRead);

    HRESULT (STDMETHODCALLTYPE *Write)(
        ISpeechBaseStream *This,
        VARIANT Buffer,
        LONG *BytesWritten);

    HRESULT (STDMETHODCALLTYPE *Seek)(
        ISpeechBaseStream *This,
        VARIANT Position,
        SpeechStreamSeekPositionType Origin,
        VARIANT *NewPosition);

    END_INTERFACE
} ISpeechBaseStreamVtbl;

interface ISpeechBaseStream {
    CONST_VTBL ISpeechBaseStreamVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpeechBaseStream_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpeechBaseStream_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpeechBaseStream_Release(This) (This)->lpVtbl->Release(This)
/*** IDispatch methods ***/
#define ISpeechBaseStream_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
#define ISpeechBaseStream_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
#define ISpeechBaseStream_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
#define ISpeechBaseStream_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
/*** ISpeechBaseStream methods ***/
#define ISpeechBaseStream_get_Format(This,AudioFormat) (This)->lpVtbl->get_Format(This,AudioFormat)
#define ISpeechBaseStream_putref_Format(This,AudioFormat) (This)->lpVtbl->putref_Format(This,AudioFormat)
#define ISpeechBaseStream_Read(This,Buffer,NumberOfBytes,BytesRead) (This)->lpVtbl->Read(This,Buffer,NumberOfBytes,BytesRead)
#define ISpeechBaseStream_Write(This,Buffer,BytesWritten) (This)->lpVtbl->Write(This,Buffer,BytesWritten)
#define ISpeechBaseStream_Seek(This,Position,Origin,NewPosition) (This)->lpVtbl->Seek(This,Position,Origin,NewPosition)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpeechBaseStream_QueryInterface(ISpeechBaseStream* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpeechBaseStream_AddRef(ISpeechBaseStream* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpeechBaseStream_Release(ISpeechBaseStream* This) {
    return This->lpVtbl->Release(This);
}
/*** IDispatch methods ***/
static FORCEINLINE HRESULT ISpeechBaseStream_GetTypeInfoCount(ISpeechBaseStream* This,UINT *pctinfo) {
    return This->lpVtbl->GetTypeInfoCount(This,pctinfo);
}
static FORCEINLINE HRESULT ISpeechBaseStream_GetTypeInfo(ISpeechBaseStream* This,UINT iTInfo,LCID lcid,ITypeInfo **ppTInfo) {
    return This->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo);
}
static FORCEINLINE HRESULT ISpeechBaseStream_GetIDsOfNames(ISpeechBaseStream* This,REFIID riid,LPOLESTR *rgszNames,UINT cNames,LCID lcid,DISPID *rgDispId) {
    return This->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId);
}
static FORCEINLINE HRESULT ISpeechBaseStream_Invoke(ISpeechBaseStream* This,DISPID dispIdMember,REFIID riid,LCID lcid,WORD wFlags,DISPPARAMS *pDispParams,VARIANT *pVarResult,EXCEPINFO *pExcepInfo,UINT *puArgErr) {
    return This->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr);
}
/*** ISpeechBaseStream methods ***/
static FORCEINLINE HRESULT ISpeechBaseStream_get_Format(ISpeechBaseStream* This,ISpeechAudioFormat **AudioFormat) {
    return This->lpVtbl->get_Format(This,AudioFormat);
}
static FORCEINLINE HRESULT ISpeechBaseStream_putref_Format(ISpeechBaseStream* This,ISpeechAudioFormat *AudioFormat) {
    return This->lpVtbl->putref_Format(This,AudioFormat);
}
static FORCEINLINE HRESULT ISpeechBaseStream_Read(ISpeechBaseStream* This,VARIANT *Buffer,LONG NumberOfBytes,LONG *BytesRead) {
    return This->lpVtbl->Read(This,Buffer,NumberOfBytes,BytesRead);
}
static FORCEINLINE HRESULT ISpeechBaseStream_Write(ISpeechBaseStream* This,VARIANT Buffer,LONG *BytesWritten) {
    return This->lpVtbl->Write(This,Buffer,BytesWritten);
}
static FORCEINLINE HRESULT ISpeechBaseStream_Seek(ISpeechBaseStream* This,VARIANT Position,SpeechStreamSeekPositionType Origin,VARIANT *NewPosition) {
    return This->lpVtbl->Seek(This,Position,Origin,NewPosition);
}
#endif
#endif

#endif


#endif  /* __ISpeechBaseStream_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpeechAudio interface
 */
#ifndef __ISpeechAudio_INTERFACE_DEFINED__
#define __ISpeechAudio_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpeechAudio, 0xcff8e175, 0x019e, 0x11d3, 0xa0,0x8e, 0x00,0xc0,0x4f,0x8e,0xf9,0xb5);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("cff8e175-019e-11d3-a08e-00c04f8ef9b5")
ISpeechAudio : public ISpeechBaseStream
{
    virtual HRESULT STDMETHODCALLTYPE get_Status(
        ISpeechAudioStatus **Status) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_BufferInfo(
        ISpeechAudioBufferInfo **BufferInfo) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_DefaultFormat(
        ISpeechAudioFormat **StreamFormat) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_Volume(
        LONG *Volume) = 0;

    virtual HRESULT STDMETHODCALLTYPE put_Volume(
        LONG Volume) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_BufferNotifySize(
        LONG *BufferNotifySize) = 0;

    virtual HRESULT STDMETHODCALLTYPE put_BufferNotifySize(
        LONG BufferNotifySize) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_EventHandle(
        LONG *EventHandle) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetState(
        SpeechAudioState State) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpeechAudio, 0xcff8e175, 0x019e, 0x11d3, 0xa0,0x8e, 0x00,0xc0,0x4f,0x8e,0xf9,0xb5)
#endif
#else
typedef struct ISpeechAudioVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpeechAudio *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpeechAudio *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpeechAudio *This);

    /*** IDispatch methods ***/
    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
        ISpeechAudio *This,
        UINT *pctinfo);

    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
        ISpeechAudio *This,
        UINT iTInfo,
        LCID lcid,
        ITypeInfo **ppTInfo);

    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
        ISpeechAudio *This,
        REFIID riid,
        LPOLESTR *rgszNames,
        UINT cNames,
        LCID lcid,
        DISPID *rgDispId);

    HRESULT (STDMETHODCALLTYPE *Invoke)(
        ISpeechAudio *This,
        DISPID dispIdMember,
        REFIID riid,
        LCID lcid,
        WORD wFlags,
        DISPPARAMS *pDispParams,
        VARIANT *pVarResult,
        EXCEPINFO *pExcepInfo,
        UINT *puArgErr);

    /*** ISpeechBaseStream methods ***/
    HRESULT (STDMETHODCALLTYPE *get_Format)(
        ISpeechAudio *This,
        ISpeechAudioFormat **AudioFormat);

    HRESULT (STDMETHODCALLTYPE *putref_Format)(
        ISpeechAudio *This,
        ISpeechAudioFormat *AudioFormat);

    HRESULT (STDMETHODCALLTYPE *Read)(
        ISpeechAudio *This,
        VARIANT *Buffer,
        LONG NumberOfBytes,
        LONG *BytesRead);

    HRESULT (STDMETHODCALLTYPE *Write)(
        ISpeechAudio *This,
        VARIANT Buffer,
        LONG *BytesWritten);

    HRESULT (STDMETHODCALLTYPE *Seek)(
        ISpeechAudio *This,
        VARIANT Position,
        SpeechStreamSeekPositionType Origin,
        VARIANT *NewPosition);

    /*** ISpeechAudio methods ***/
    HRESULT (STDMETHODCALLTYPE *get_Status)(
        ISpeechAudio *This,
        ISpeechAudioStatus **Status);

    HRESULT (STDMETHODCALLTYPE *get_BufferInfo)(
        ISpeechAudio *This,
        ISpeechAudioBufferInfo **BufferInfo);

    HRESULT (STDMETHODCALLTYPE *get_DefaultFormat)(
        ISpeechAudio *This,
        ISpeechAudioFormat **StreamFormat);

    HRESULT (STDMETHODCALLTYPE *get_Volume)(
        ISpeechAudio *This,
        LONG *Volume);

    HRESULT (STDMETHODCALLTYPE *put_Volume)(
        ISpeechAudio *This,
        LONG Volume);

    HRESULT (STDMETHODCALLTYPE *get_BufferNotifySize)(
        ISpeechAudio *This,
        LONG *BufferNotifySize);

    HRESULT (STDMETHODCALLTYPE *put_BufferNotifySize)(
        ISpeechAudio *This,
        LONG BufferNotifySize);

    HRESULT (STDMETHODCALLTYPE *get_EventHandle)(
        ISpeechAudio *This,
        LONG *EventHandle);

    HRESULT (STDMETHODCALLTYPE *SetState)(
        ISpeechAudio *This,
        SpeechAudioState State);

    END_INTERFACE
} ISpeechAudioVtbl;

interface ISpeechAudio {
    CONST_VTBL ISpeechAudioVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpeechAudio_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpeechAudio_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpeechAudio_Release(This) (This)->lpVtbl->Release(This)
/*** IDispatch methods ***/
#define ISpeechAudio_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
#define ISpeechAudio_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
#define ISpeechAudio_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
#define ISpeechAudio_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
/*** ISpeechBaseStream methods ***/
#define ISpeechAudio_get_Format(This,AudioFormat) (This)->lpVtbl->get_Format(This,AudioFormat)
#define ISpeechAudio_putref_Format(This,AudioFormat) (This)->lpVtbl->putref_Format(This,AudioFormat)
#define ISpeechAudio_Read(This,Buffer,NumberOfBytes,BytesRead) (This)->lpVtbl->Read(This,Buffer,NumberOfBytes,BytesRead)
#define ISpeechAudio_Write(This,Buffer,BytesWritten) (This)->lpVtbl->Write(This,Buffer,BytesWritten)
#define ISpeechAudio_Seek(This,Position,Origin,NewPosition) (This)->lpVtbl->Seek(This,Position,Origin,NewPosition)
/*** ISpeechAudio methods ***/
#define ISpeechAudio_get_Status(This,Status) (This)->lpVtbl->get_Status(This,Status)
#define ISpeechAudio_get_BufferInfo(This,BufferInfo) (This)->lpVtbl->get_BufferInfo(This,BufferInfo)
#define ISpeechAudio_get_DefaultFormat(This,StreamFormat) (This)->lpVtbl->get_DefaultFormat(This,StreamFormat)
#define ISpeechAudio_get_Volume(This,Volume) (This)->lpVtbl->get_Volume(This,Volume)
#define ISpeechAudio_put_Volume(This,Volume) (This)->lpVtbl->put_Volume(This,Volume)
#define ISpeechAudio_get_BufferNotifySize(This,BufferNotifySize) (This)->lpVtbl->get_BufferNotifySize(This,BufferNotifySize)
#define ISpeechAudio_put_BufferNotifySize(This,BufferNotifySize) (This)->lpVtbl->put_BufferNotifySize(This,BufferNotifySize)
#define ISpeechAudio_get_EventHandle(This,EventHandle) (This)->lpVtbl->get_EventHandle(This,EventHandle)
#define ISpeechAudio_SetState(This,State) (This)->lpVtbl->SetState(This,State)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpeechAudio_QueryInterface(ISpeechAudio* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpeechAudio_AddRef(ISpeechAudio* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpeechAudio_Release(ISpeechAudio* This) {
    return This->lpVtbl->Release(This);
}
/*** IDispatch methods ***/
static FORCEINLINE HRESULT ISpeechAudio_GetTypeInfoCount(ISpeechAudio* This,UINT *pctinfo) {
    return This->lpVtbl->GetTypeInfoCount(This,pctinfo);
}
static FORCEINLINE HRESULT ISpeechAudio_GetTypeInfo(ISpeechAudio* This,UINT iTInfo,LCID lcid,ITypeInfo **ppTInfo) {
    return This->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo);
}
static FORCEINLINE HRESULT ISpeechAudio_GetIDsOfNames(ISpeechAudio* This,REFIID riid,LPOLESTR *rgszNames,UINT cNames,LCID lcid,DISPID *rgDispId) {
    return This->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId);
}
static FORCEINLINE HRESULT ISpeechAudio_Invoke(ISpeechAudio* This,DISPID dispIdMember,REFIID riid,LCID lcid,WORD wFlags,DISPPARAMS *pDispParams,VARIANT *pVarResult,EXCEPINFO *pExcepInfo,UINT *puArgErr) {
    return This->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr);
}
/*** ISpeechBaseStream methods ***/
static FORCEINLINE HRESULT ISpeechAudio_get_Format(ISpeechAudio* This,ISpeechAudioFormat **AudioFormat) {
    return This->lpVtbl->get_Format(This,AudioFormat);
}
static FORCEINLINE HRESULT ISpeechAudio_putref_Format(ISpeechAudio* This,ISpeechAudioFormat *AudioFormat) {
    return This->lpVtbl->putref_Format(This,AudioFormat);
}
static FORCEINLINE HRESULT ISpeechAudio_Read(ISpeechAudio* This,VARIANT *Buffer,LONG NumberOfBytes,LONG *BytesRead) {
    return This->lpVtbl->Read(This,Buffer,NumberOfBytes,BytesRead);
}
static FORCEINLINE HRESULT ISpeechAudio_Write(ISpeechAudio* This,VARIANT Buffer,LONG *BytesWritten) {
    return This->lpVtbl->Write(This,Buffer,BytesWritten);
}
static FORCEINLINE HRESULT ISpeechAudio_Seek(ISpeechAudio* This,VARIANT Position,SpeechStreamSeekPositionType Origin,VARIANT *NewPosition) {
    return This->lpVtbl->Seek(This,Position,Origin,NewPosition);
}
/*** ISpeechAudio methods ***/
static FORCEINLINE HRESULT ISpeechAudio_get_Status(ISpeechAudio* This,ISpeechAudioStatus **Status) {
    return This->lpVtbl->get_Status(This,Status);
}
static FORCEINLINE HRESULT ISpeechAudio_get_BufferInfo(ISpeechAudio* This,ISpeechAudioBufferInfo **BufferInfo) {
    return This->lpVtbl->get_BufferInfo(This,BufferInfo);
}
static FORCEINLINE HRESULT ISpeechAudio_get_DefaultFormat(ISpeechAudio* This,ISpeechAudioFormat **StreamFormat) {
    return This->lpVtbl->get_DefaultFormat(This,StreamFormat);
}
static FORCEINLINE HRESULT ISpeechAudio_get_Volume(ISpeechAudio* This,LONG *Volume) {
    return This->lpVtbl->get_Volume(This,Volume);
}
static FORCEINLINE HRESULT ISpeechAudio_put_Volume(ISpeechAudio* This,LONG Volume) {
    return This->lpVtbl->put_Volume(This,Volume);
}
static FORCEINLINE HRESULT ISpeechAudio_get_BufferNotifySize(ISpeechAudio* This,LONG *BufferNotifySize) {
    return This->lpVtbl->get_BufferNotifySize(This,BufferNotifySize);
}
static FORCEINLINE HRESULT ISpeechAudio_put_BufferNotifySize(ISpeechAudio* This,LONG BufferNotifySize) {
    return This->lpVtbl->put_BufferNotifySize(This,BufferNotifySize);
}
static FORCEINLINE HRESULT ISpeechAudio_get_EventHandle(ISpeechAudio* This,LONG *EventHandle) {
    return This->lpVtbl->get_EventHandle(This,EventHandle);
}
static FORCEINLINE HRESULT ISpeechAudio_SetState(ISpeechAudio* This,SpeechAudioState State) {
    return This->lpVtbl->SetState(This,State);
}
#endif
#endif

#endif


#endif  /* __ISpeechAudio_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpeechMMSysAudio interface
 */
#ifndef __ISpeechMMSysAudio_INTERFACE_DEFINED__
#define __ISpeechMMSysAudio_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpeechMMSysAudio, 0x3c76af6d, 0x1fd7, 0x4831, 0x81,0xd1, 0x3b,0x71,0xd5,0xa1,0x3c,0x44);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("3c76af6d-1fd7-4831-81d1-3b71d5a13c44")
ISpeechMMSysAudio : public ISpeechAudio
{
    virtual HRESULT STDMETHODCALLTYPE get_DeviceId(
        LONG *DeviceId) = 0;

    virtual HRESULT STDMETHODCALLTYPE put_DeviceId(
        LONG DeviceId) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_LineId(
        LONG *LineId) = 0;

    virtual HRESULT STDMETHODCALLTYPE put_LineId(
        LONG LineId) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_MMHandle(
        LONG *Handle) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpeechMMSysAudio, 0x3c76af6d, 0x1fd7, 0x4831, 0x81,0xd1, 0x3b,0x71,0xd5,0xa1,0x3c,0x44)
#endif
#else
typedef struct ISpeechMMSysAudioVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpeechMMSysAudio *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpeechMMSysAudio *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpeechMMSysAudio *This);

    /*** IDispatch methods ***/
    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
        ISpeechMMSysAudio *This,
        UINT *pctinfo);

    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
        ISpeechMMSysAudio *This,
        UINT iTInfo,
        LCID lcid,
        ITypeInfo **ppTInfo);

    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
        ISpeechMMSysAudio *This,
        REFIID riid,
        LPOLESTR *rgszNames,
        UINT cNames,
        LCID lcid,
        DISPID *rgDispId);

    HRESULT (STDMETHODCALLTYPE *Invoke)(
        ISpeechMMSysAudio *This,
        DISPID dispIdMember,
        REFIID riid,
        LCID lcid,
        WORD wFlags,
        DISPPARAMS *pDispParams,
        VARIANT *pVarResult,
        EXCEPINFO *pExcepInfo,
        UINT *puArgErr);

    /*** ISpeechBaseStream methods ***/
    HRESULT (STDMETHODCALLTYPE *get_Format)(
        ISpeechMMSysAudio *This,
        ISpeechAudioFormat **AudioFormat);

    HRESULT (STDMETHODCALLTYPE *putref_Format)(
        ISpeechMMSysAudio *This,
        ISpeechAudioFormat *AudioFormat);

    HRESULT (STDMETHODCALLTYPE *Read)(
        ISpeechMMSysAudio *This,
        VARIANT *Buffer,
        LONG NumberOfBytes,
        LONG *BytesRead);

    HRESULT (STDMETHODCALLTYPE *Write)(
        ISpeechMMSysAudio *This,
        VARIANT Buffer,
        LONG *BytesWritten);

    HRESULT (STDMETHODCALLTYPE *Seek)(
        ISpeechMMSysAudio *This,
        VARIANT Position,
        SpeechStreamSeekPositionType Origin,
        VARIANT *NewPosition);

    /*** ISpeechAudio methods ***/
    HRESULT (STDMETHODCALLTYPE *get_Status)(
        ISpeechMMSysAudio *This,
        ISpeechAudioStatus **Status);

    HRESULT (STDMETHODCALLTYPE *get_BufferInfo)(
        ISpeechMMSysAudio *This,
        ISpeechAudioBufferInfo **BufferInfo);

    HRESULT (STDMETHODCALLTYPE *get_DefaultFormat)(
        ISpeechMMSysAudio *This,
        ISpeechAudioFormat **StreamFormat);

    HRESULT (STDMETHODCALLTYPE *get_Volume)(
        ISpeechMMSysAudio *This,
        LONG *Volume);

    HRESULT (STDMETHODCALLTYPE *put_Volume)(
        ISpeechMMSysAudio *This,
        LONG Volume);

    HRESULT (STDMETHODCALLTYPE *get_BufferNotifySize)(
        ISpeechMMSysAudio *This,
        LONG *BufferNotifySize);

    HRESULT (STDMETHODCALLTYPE *put_BufferNotifySize)(
        ISpeechMMSysAudio *This,
        LONG BufferNotifySize);

    HRESULT (STDMETHODCALLTYPE *get_EventHandle)(
        ISpeechMMSysAudio *This,
        LONG *EventHandle);

    HRESULT (STDMETHODCALLTYPE *SetState)(
        ISpeechMMSysAudio *This,
        SpeechAudioState State);

    /*** ISpeechMMSysAudio methods ***/
    HRESULT (STDMETHODCALLTYPE *get_DeviceId)(
        ISpeechMMSysAudio *This,
        LONG *DeviceId);

    HRESULT (STDMETHODCALLTYPE *put_DeviceId)(
        ISpeechMMSysAudio *This,
        LONG DeviceId);

    HRESULT (STDMETHODCALLTYPE *get_LineId)(
        ISpeechMMSysAudio *This,
        LONG *LineId);

    HRESULT (STDMETHODCALLTYPE *put_LineId)(
        ISpeechMMSysAudio *This,
        LONG LineId);

    HRESULT (STDMETHODCALLTYPE *get_MMHandle)(
        ISpeechMMSysAudio *This,
        LONG *Handle);

    END_INTERFACE
} ISpeechMMSysAudioVtbl;

interface ISpeechMMSysAudio {
    CONST_VTBL ISpeechMMSysAudioVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpeechMMSysAudio_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpeechMMSysAudio_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpeechMMSysAudio_Release(This) (This)->lpVtbl->Release(This)
/*** IDispatch methods ***/
#define ISpeechMMSysAudio_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
#define ISpeechMMSysAudio_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
#define ISpeechMMSysAudio_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
#define ISpeechMMSysAudio_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
/*** ISpeechBaseStream methods ***/
#define ISpeechMMSysAudio_get_Format(This,AudioFormat) (This)->lpVtbl->get_Format(This,AudioFormat)
#define ISpeechMMSysAudio_putref_Format(This,AudioFormat) (This)->lpVtbl->putref_Format(This,AudioFormat)
#define ISpeechMMSysAudio_Read(This,Buffer,NumberOfBytes,BytesRead) (This)->lpVtbl->Read(This,Buffer,NumberOfBytes,BytesRead)
#define ISpeechMMSysAudio_Write(This,Buffer,BytesWritten) (This)->lpVtbl->Write(This,Buffer,BytesWritten)
#define ISpeechMMSysAudio_Seek(This,Position,Origin,NewPosition) (This)->lpVtbl->Seek(This,Position,Origin,NewPosition)
/*** ISpeechAudio methods ***/
#define ISpeechMMSysAudio_get_Status(This,Status) (This)->lpVtbl->get_Status(This,Status)
#define ISpeechMMSysAudio_get_BufferInfo(This,BufferInfo) (This)->lpVtbl->get_BufferInfo(This,BufferInfo)
#define ISpeechMMSysAudio_get_DefaultFormat(This,StreamFormat) (This)->lpVtbl->get_DefaultFormat(This,StreamFormat)
#define ISpeechMMSysAudio_get_Volume(This,Volume) (This)->lpVtbl->get_Volume(This,Volume)
#define ISpeechMMSysAudio_put_Volume(This,Volume) (This)->lpVtbl->put_Volume(This,Volume)
#define ISpeechMMSysAudio_get_BufferNotifySize(This,BufferNotifySize) (This)->lpVtbl->get_BufferNotifySize(This,BufferNotifySize)
#define ISpeechMMSysAudio_put_BufferNotifySize(This,BufferNotifySize) (This)->lpVtbl->put_BufferNotifySize(This,BufferNotifySize)
#define ISpeechMMSysAudio_get_EventHandle(This,EventHandle) (This)->lpVtbl->get_EventHandle(This,EventHandle)
#define ISpeechMMSysAudio_SetState(This,State) (This)->lpVtbl->SetState(This,State)
/*** ISpeechMMSysAudio methods ***/
#define ISpeechMMSysAudio_get_DeviceId(This,DeviceId) (This)->lpVtbl->get_DeviceId(This,DeviceId)
#define ISpeechMMSysAudio_put_DeviceId(This,DeviceId) (This)->lpVtbl->put_DeviceId(This,DeviceId)
#define ISpeechMMSysAudio_get_LineId(This,LineId) (This)->lpVtbl->get_LineId(This,LineId)
#define ISpeechMMSysAudio_put_LineId(This,LineId) (This)->lpVtbl->put_LineId(This,LineId)
#define ISpeechMMSysAudio_get_MMHandle(This,Handle) (This)->lpVtbl->get_MMHandle(This,Handle)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpeechMMSysAudio_QueryInterface(ISpeechMMSysAudio* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpeechMMSysAudio_AddRef(ISpeechMMSysAudio* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpeechMMSysAudio_Release(ISpeechMMSysAudio* This) {
    return This->lpVtbl->Release(This);
}
/*** IDispatch methods ***/
static FORCEINLINE HRESULT ISpeechMMSysAudio_GetTypeInfoCount(ISpeechMMSysAudio* This,UINT *pctinfo) {
    return This->lpVtbl->GetTypeInfoCount(This,pctinfo);
}
static FORCEINLINE HRESULT ISpeechMMSysAudio_GetTypeInfo(ISpeechMMSysAudio* This,UINT iTInfo,LCID lcid,ITypeInfo **ppTInfo) {
    return This->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo);
}
static FORCEINLINE HRESULT ISpeechMMSysAudio_GetIDsOfNames(ISpeechMMSysAudio* This,REFIID riid,LPOLESTR *rgszNames,UINT cNames,LCID lcid,DISPID *rgDispId) {
    return This->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId);
}
static FORCEINLINE HRESULT ISpeechMMSysAudio_Invoke(ISpeechMMSysAudio* This,DISPID dispIdMember,REFIID riid,LCID lcid,WORD wFlags,DISPPARAMS *pDispParams,VARIANT *pVarResult,EXCEPINFO *pExcepInfo,UINT *puArgErr) {
    return This->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr);
}
/*** ISpeechBaseStream methods ***/
static FORCEINLINE HRESULT ISpeechMMSysAudio_get_Format(ISpeechMMSysAudio* This,ISpeechAudioFormat **AudioFormat) {
    return This->lpVtbl->get_Format(This,AudioFormat);
}
static FORCEINLINE HRESULT ISpeechMMSysAudio_putref_Format(ISpeechMMSysAudio* This,ISpeechAudioFormat *AudioFormat) {
    return This->lpVtbl->putref_Format(This,AudioFormat);
}
static FORCEINLINE HRESULT ISpeechMMSysAudio_Read(ISpeechMMSysAudio* This,VARIANT *Buffer,LONG NumberOfBytes,LONG *BytesRead) {
    return This->lpVtbl->Read(This,Buffer,NumberOfBytes,BytesRead);
}
static FORCEINLINE HRESULT ISpeechMMSysAudio_Write(ISpeechMMSysAudio* This,VARIANT Buffer,LONG *BytesWritten) {
    return This->lpVtbl->Write(This,Buffer,BytesWritten);
}
static FORCEINLINE HRESULT ISpeechMMSysAudio_Seek(ISpeechMMSysAudio* This,VARIANT Position,SpeechStreamSeekPositionType Origin,VARIANT *NewPosition) {
    return This->lpVtbl->Seek(This,Position,Origin,NewPosition);
}
/*** ISpeechAudio methods ***/
static FORCEINLINE HRESULT ISpeechMMSysAudio_get_Status(ISpeechMMSysAudio* This,ISpeechAudioStatus **Status) {
    return This->lpVtbl->get_Status(This,Status);
}
static FORCEINLINE HRESULT ISpeechMMSysAudio_get_BufferInfo(ISpeechMMSysAudio* This,ISpeechAudioBufferInfo **BufferInfo) {
    return This->lpVtbl->get_BufferInfo(This,BufferInfo);
}
static FORCEINLINE HRESULT ISpeechMMSysAudio_get_DefaultFormat(ISpeechMMSysAudio* This,ISpeechAudioFormat **StreamFormat) {
    return This->lpVtbl->get_DefaultFormat(This,StreamFormat);
}
static FORCEINLINE HRESULT ISpeechMMSysAudio_get_Volume(ISpeechMMSysAudio* This,LONG *Volume) {
    return This->lpVtbl->get_Volume(This,Volume);
}
static FORCEINLINE HRESULT ISpeechMMSysAudio_put_Volume(ISpeechMMSysAudio* This,LONG Volume) {
    return This->lpVtbl->put_Volume(This,Volume);
}
static FORCEINLINE HRESULT ISpeechMMSysAudio_get_BufferNotifySize(ISpeechMMSysAudio* This,LONG *BufferNotifySize) {
    return This->lpVtbl->get_BufferNotifySize(This,BufferNotifySize);
}
static FORCEINLINE HRESULT ISpeechMMSysAudio_put_BufferNotifySize(ISpeechMMSysAudio* This,LONG BufferNotifySize) {
    return This->lpVtbl->put_BufferNotifySize(This,BufferNotifySize);
}
static FORCEINLINE HRESULT ISpeechMMSysAudio_get_EventHandle(ISpeechMMSysAudio* This,LONG *EventHandle) {
    return This->lpVtbl->get_EventHandle(This,EventHandle);
}
static FORCEINLINE HRESULT ISpeechMMSysAudio_SetState(ISpeechMMSysAudio* This,SpeechAudioState State) {
    return This->lpVtbl->SetState(This,State);
}
/*** ISpeechMMSysAudio methods ***/
static FORCEINLINE HRESULT ISpeechMMSysAudio_get_DeviceId(ISpeechMMSysAudio* This,LONG *DeviceId) {
    return This->lpVtbl->get_DeviceId(This,DeviceId);
}
static FORCEINLINE HRESULT ISpeechMMSysAudio_put_DeviceId(ISpeechMMSysAudio* This,LONG DeviceId) {
    return This->lpVtbl->put_DeviceId(This,DeviceId);
}
static FORCEINLINE HRESULT ISpeechMMSysAudio_get_LineId(ISpeechMMSysAudio* This,LONG *LineId) {
    return This->lpVtbl->get_LineId(This,LineId);
}
static FORCEINLINE HRESULT ISpeechMMSysAudio_put_LineId(ISpeechMMSysAudio* This,LONG LineId) {
    return This->lpVtbl->put_LineId(This,LineId);
}
static FORCEINLINE HRESULT ISpeechMMSysAudio_get_MMHandle(ISpeechMMSysAudio* This,LONG *Handle) {
    return This->lpVtbl->get_MMHandle(This,Handle);
}
#endif
#endif

#endif


#endif  /* __ISpeechMMSysAudio_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpeechFileStream interface
 */
#ifndef __ISpeechFileStream_INTERFACE_DEFINED__
#define __ISpeechFileStream_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpeechFileStream, 0xaf67f125, 0xab39, 0x4e93, 0xb4,0xa2, 0xcc,0x2e,0x66,0xe1,0x82,0xa7);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("af67f125-ab39-4e93-b4a2-cc2e66e182a7")
ISpeechFileStream : public ISpeechBaseStream
{
    virtual HRESULT STDMETHODCALLTYPE Open(
        BSTR FileName,
        SpeechStreamFileMode FileMode = SSFMOpenForRead,
        VARIANT_BOOL DoEvents = 0) = 0;

    virtual HRESULT STDMETHODCALLTYPE Close(
        ) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpeechFileStream, 0xaf67f125, 0xab39, 0x4e93, 0xb4,0xa2, 0xcc,0x2e,0x66,0xe1,0x82,0xa7)
#endif
#else
typedef struct ISpeechFileStreamVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpeechFileStream *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpeechFileStream *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpeechFileStream *This);

    /*** IDispatch methods ***/
    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
        ISpeechFileStream *This,
        UINT *pctinfo);

    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
        ISpeechFileStream *This,
        UINT iTInfo,
        LCID lcid,
        ITypeInfo **ppTInfo);

    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
        ISpeechFileStream *This,
        REFIID riid,
        LPOLESTR *rgszNames,
        UINT cNames,
        LCID lcid,
        DISPID *rgDispId);

    HRESULT (STDMETHODCALLTYPE *Invoke)(
        ISpeechFileStream *This,
        DISPID dispIdMember,
        REFIID riid,
        LCID lcid,
        WORD wFlags,
        DISPPARAMS *pDispParams,
        VARIANT *pVarResult,
        EXCEPINFO *pExcepInfo,
        UINT *puArgErr);

    /*** ISpeechBaseStream methods ***/
    HRESULT (STDMETHODCALLTYPE *get_Format)(
        ISpeechFileStream *This,
        ISpeechAudioFormat **AudioFormat);

    HRESULT (STDMETHODCALLTYPE *putref_Format)(
        ISpeechFileStream *This,
        ISpeechAudioFormat *AudioFormat);

    HRESULT (STDMETHODCALLTYPE *Read)(
        ISpeechFileStream *This,
        VARIANT *Buffer,
        LONG NumberOfBytes,
        LONG *BytesRead);

    HRESULT (STDMETHODCALLTYPE *Write)(
        ISpeechFileStream *This,
        VARIANT Buffer,
        LONG *BytesWritten);

    HRESULT (STDMETHODCALLTYPE *Seek)(
        ISpeechFileStream *This,
        VARIANT Position,
        SpeechStreamSeekPositionType Origin,
        VARIANT *NewPosition);

    /*** ISpeechFileStream methods ***/
    HRESULT (STDMETHODCALLTYPE *Open)(
        ISpeechFileStream *This,
        BSTR FileName,
        SpeechStreamFileMode FileMode,
        VARIANT_BOOL DoEvents);

    HRESULT (STDMETHODCALLTYPE *Close)(
        ISpeechFileStream *This);

    END_INTERFACE
} ISpeechFileStreamVtbl;

interface ISpeechFileStream {
    CONST_VTBL ISpeechFileStreamVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpeechFileStream_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpeechFileStream_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpeechFileStream_Release(This) (This)->lpVtbl->Release(This)
/*** IDispatch methods ***/
#define ISpeechFileStream_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
#define ISpeechFileStream_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
#define ISpeechFileStream_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
#define ISpeechFileStream_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
/*** ISpeechBaseStream methods ***/
#define ISpeechFileStream_get_Format(This,AudioFormat) (This)->lpVtbl->get_Format(This,AudioFormat)
#define ISpeechFileStream_putref_Format(This,AudioFormat) (This)->lpVtbl->putref_Format(This,AudioFormat)
#define ISpeechFileStream_Read(This,Buffer,NumberOfBytes,BytesRead) (This)->lpVtbl->Read(This,Buffer,NumberOfBytes,BytesRead)
#define ISpeechFileStream_Write(This,Buffer,BytesWritten) (This)->lpVtbl->Write(This,Buffer,BytesWritten)
#define ISpeechFileStream_Seek(This,Position,Origin,NewPosition) (This)->lpVtbl->Seek(This,Position,Origin,NewPosition)
/*** ISpeechFileStream methods ***/
#define ISpeechFileStream_Open(This,FileName,FileMode,DoEvents) (This)->lpVtbl->Open(This,FileName,FileMode,DoEvents)
#define ISpeechFileStream_Close(This) (This)->lpVtbl->Close(This)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpeechFileStream_QueryInterface(ISpeechFileStream* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpeechFileStream_AddRef(ISpeechFileStream* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpeechFileStream_Release(ISpeechFileStream* This) {
    return This->lpVtbl->Release(This);
}
/*** IDispatch methods ***/
static FORCEINLINE HRESULT ISpeechFileStream_GetTypeInfoCount(ISpeechFileStream* This,UINT *pctinfo) {
    return This->lpVtbl->GetTypeInfoCount(This,pctinfo);
}
static FORCEINLINE HRESULT ISpeechFileStream_GetTypeInfo(ISpeechFileStream* This,UINT iTInfo,LCID lcid,ITypeInfo **ppTInfo) {
    return This->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo);
}
static FORCEINLINE HRESULT ISpeechFileStream_GetIDsOfNames(ISpeechFileStream* This,REFIID riid,LPOLESTR *rgszNames,UINT cNames,LCID lcid,DISPID *rgDispId) {
    return This->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId);
}
static FORCEINLINE HRESULT ISpeechFileStream_Invoke(ISpeechFileStream* This,DISPID dispIdMember,REFIID riid,LCID lcid,WORD wFlags,DISPPARAMS *pDispParams,VARIANT *pVarResult,EXCEPINFO *pExcepInfo,UINT *puArgErr) {
    return This->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr);
}
/*** ISpeechBaseStream methods ***/
static FORCEINLINE HRESULT ISpeechFileStream_get_Format(ISpeechFileStream* This,ISpeechAudioFormat **AudioFormat) {
    return This->lpVtbl->get_Format(This,AudioFormat);
}
static FORCEINLINE HRESULT ISpeechFileStream_putref_Format(ISpeechFileStream* This,ISpeechAudioFormat *AudioFormat) {
    return This->lpVtbl->putref_Format(This,AudioFormat);
}
static FORCEINLINE HRESULT ISpeechFileStream_Read(ISpeechFileStream* This,VARIANT *Buffer,LONG NumberOfBytes,LONG *BytesRead) {
    return This->lpVtbl->Read(This,Buffer,NumberOfBytes,BytesRead);
}
static FORCEINLINE HRESULT ISpeechFileStream_Write(ISpeechFileStream* This,VARIANT Buffer,LONG *BytesWritten) {
    return This->lpVtbl->Write(This,Buffer,BytesWritten);
}
static FORCEINLINE HRESULT ISpeechFileStream_Seek(ISpeechFileStream* This,VARIANT Position,SpeechStreamSeekPositionType Origin,VARIANT *NewPosition) {
    return This->lpVtbl->Seek(This,Position,Origin,NewPosition);
}
/*** ISpeechFileStream methods ***/
static FORCEINLINE HRESULT ISpeechFileStream_Open(ISpeechFileStream* This,BSTR FileName,SpeechStreamFileMode FileMode,VARIANT_BOOL DoEvents) {
    return This->lpVtbl->Open(This,FileName,FileMode,DoEvents);
}
static FORCEINLINE HRESULT ISpeechFileStream_Close(ISpeechFileStream* This) {
    return This->lpVtbl->Close(This);
}
#endif
#endif

#endif


#endif  /* __ISpeechFileStream_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpeechCustomStream interface
 */
#ifndef __ISpeechCustomStream_INTERFACE_DEFINED__
#define __ISpeechCustomStream_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpeechCustomStream, 0x1a9e9f4f, 0x104f, 0x4db8, 0xa1,0x15, 0xef,0xd7,0xfd,0x0c,0x97,0xae);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("1a9e9f4f-104f-4db8-a115-efd7fd0c97ae")
ISpeechCustomStream : public ISpeechBaseStream
{
    virtual HRESULT STDMETHODCALLTYPE get_BaseStream(
        IUnknown **ppUnkStream) = 0;

    virtual HRESULT STDMETHODCALLTYPE putref_BaseStream(
        IUnknown *pUnkStream) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpeechCustomStream, 0x1a9e9f4f, 0x104f, 0x4db8, 0xa1,0x15, 0xef,0xd7,0xfd,0x0c,0x97,0xae)
#endif
#else
typedef struct ISpeechCustomStreamVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpeechCustomStream *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpeechCustomStream *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpeechCustomStream *This);

    /*** IDispatch methods ***/
    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
        ISpeechCustomStream *This,
        UINT *pctinfo);

    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
        ISpeechCustomStream *This,
        UINT iTInfo,
        LCID lcid,
        ITypeInfo **ppTInfo);

    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
        ISpeechCustomStream *This,
        REFIID riid,
        LPOLESTR *rgszNames,
        UINT cNames,
        LCID lcid,
        DISPID *rgDispId);

    HRESULT (STDMETHODCALLTYPE *Invoke)(
        ISpeechCustomStream *This,
        DISPID dispIdMember,
        REFIID riid,
        LCID lcid,
        WORD wFlags,
        DISPPARAMS *pDispParams,
        VARIANT *pVarResult,
        EXCEPINFO *pExcepInfo,
        UINT *puArgErr);

    /*** ISpeechBaseStream methods ***/
    HRESULT (STDMETHODCALLTYPE *get_Format)(
        ISpeechCustomStream *This,
        ISpeechAudioFormat **AudioFormat);

    HRESULT (STDMETHODCALLTYPE *putref_Format)(
        ISpeechCustomStream *This,
        ISpeechAudioFormat *AudioFormat);

    HRESULT (STDMETHODCALLTYPE *Read)(
        ISpeechCustomStream *This,
        VARIANT *Buffer,
        LONG NumberOfBytes,
        LONG *BytesRead);

    HRESULT (STDMETHODCALLTYPE *Write)(
        ISpeechCustomStream *This,
        VARIANT Buffer,
        LONG *BytesWritten);

    HRESULT (STDMETHODCALLTYPE *Seek)(
        ISpeechCustomStream *This,
        VARIANT Position,
        SpeechStreamSeekPositionType Origin,
        VARIANT *NewPosition);

    /*** ISpeechCustomStream methods ***/
    HRESULT (STDMETHODCALLTYPE *get_BaseStream)(
        ISpeechCustomStream *This,
        IUnknown **ppUnkStream);

    HRESULT (STDMETHODCALLTYPE *putref_BaseStream)(
        ISpeechCustomStream *This,
        IUnknown *pUnkStream);

    END_INTERFACE
} ISpeechCustomStreamVtbl;

interface ISpeechCustomStream {
    CONST_VTBL ISpeechCustomStreamVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpeechCustomStream_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpeechCustomStream_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpeechCustomStream_Release(This) (This)->lpVtbl->Release(This)
/*** IDispatch methods ***/
#define ISpeechCustomStream_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
#define ISpeechCustomStream_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
#define ISpeechCustomStream_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
#define ISpeechCustomStream_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
/*** ISpeechBaseStream methods ***/
#define ISpeechCustomStream_get_Format(This,AudioFormat) (This)->lpVtbl->get_Format(This,AudioFormat)
#define ISpeechCustomStream_putref_Format(This,AudioFormat) (This)->lpVtbl->putref_Format(This,AudioFormat)
#define ISpeechCustomStream_Read(This,Buffer,NumberOfBytes,BytesRead) (This)->lpVtbl->Read(This,Buffer,NumberOfBytes,BytesRead)
#define ISpeechCustomStream_Write(This,Buffer,BytesWritten) (This)->lpVtbl->Write(This,Buffer,BytesWritten)
#define ISpeechCustomStream_Seek(This,Position,Origin,NewPosition) (This)->lpVtbl->Seek(This,Position,Origin,NewPosition)
/*** ISpeechCustomStream methods ***/
#define ISpeechCustomStream_get_BaseStream(This,ppUnkStream) (This)->lpVtbl->get_BaseStream(This,ppUnkStream)
#define ISpeechCustomStream_putref_BaseStream(This,pUnkStream) (This)->lpVtbl->putref_BaseStream(This,pUnkStream)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpeechCustomStream_QueryInterface(ISpeechCustomStream* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpeechCustomStream_AddRef(ISpeechCustomStream* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpeechCustomStream_Release(ISpeechCustomStream* This) {
    return This->lpVtbl->Release(This);
}
/*** IDispatch methods ***/
static FORCEINLINE HRESULT ISpeechCustomStream_GetTypeInfoCount(ISpeechCustomStream* This,UINT *pctinfo) {
    return This->lpVtbl->GetTypeInfoCount(This,pctinfo);
}
static FORCEINLINE HRESULT ISpeechCustomStream_GetTypeInfo(ISpeechCustomStream* This,UINT iTInfo,LCID lcid,ITypeInfo **ppTInfo) {
    return This->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo);
}
static FORCEINLINE HRESULT ISpeechCustomStream_GetIDsOfNames(ISpeechCustomStream* This,REFIID riid,LPOLESTR *rgszNames,UINT cNames,LCID lcid,DISPID *rgDispId) {
    return This->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId);
}
static FORCEINLINE HRESULT ISpeechCustomStream_Invoke(ISpeechCustomStream* This,DISPID dispIdMember,REFIID riid,LCID lcid,WORD wFlags,DISPPARAMS *pDispParams,VARIANT *pVarResult,EXCEPINFO *pExcepInfo,UINT *puArgErr) {
    return This->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr);
}
/*** ISpeechBaseStream methods ***/
static FORCEINLINE HRESULT ISpeechCustomStream_get_Format(ISpeechCustomStream* This,ISpeechAudioFormat **AudioFormat) {
    return This->lpVtbl->get_Format(This,AudioFormat);
}
static FORCEINLINE HRESULT ISpeechCustomStream_putref_Format(ISpeechCustomStream* This,ISpeechAudioFormat *AudioFormat) {
    return This->lpVtbl->putref_Format(This,AudioFormat);
}
static FORCEINLINE HRESULT ISpeechCustomStream_Read(ISpeechCustomStream* This,VARIANT *Buffer,LONG NumberOfBytes,LONG *BytesRead) {
    return This->lpVtbl->Read(This,Buffer,NumberOfBytes,BytesRead);
}
static FORCEINLINE HRESULT ISpeechCustomStream_Write(ISpeechCustomStream* This,VARIANT Buffer,LONG *BytesWritten) {
    return This->lpVtbl->Write(This,Buffer,BytesWritten);
}
static FORCEINLINE HRESULT ISpeechCustomStream_Seek(ISpeechCustomStream* This,VARIANT Position,SpeechStreamSeekPositionType Origin,VARIANT *NewPosition) {
    return This->lpVtbl->Seek(This,Position,Origin,NewPosition);
}
/*** ISpeechCustomStream methods ***/
static FORCEINLINE HRESULT ISpeechCustomStream_get_BaseStream(ISpeechCustomStream* This,IUnknown **ppUnkStream) {
    return This->lpVtbl->get_BaseStream(This,ppUnkStream);
}
static FORCEINLINE HRESULT ISpeechCustomStream_putref_BaseStream(ISpeechCustomStream* This,IUnknown *pUnkStream) {
    return This->lpVtbl->putref_BaseStream(This,pUnkStream);
}
#endif
#endif

#endif


#endif  /* __ISpeechCustomStream_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpeechMemoryStream interface
 */
#ifndef __ISpeechMemoryStream_INTERFACE_DEFINED__
#define __ISpeechMemoryStream_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpeechMemoryStream, 0xeeb14b68, 0x808b, 0x4abe, 0xa5,0xea, 0xb5,0x1d,0xa7,0x58,0x80,0x08);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("eeb14b68-808b-4abe-a5ea-b51da7588008")
ISpeechMemoryStream : public ISpeechBaseStream
{
    virtual HRESULT STDMETHODCALLTYPE SetData(
        VARIANT Data) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetData(
        VARIANT *pData) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpeechMemoryStream, 0xeeb14b68, 0x808b, 0x4abe, 0xa5,0xea, 0xb5,0x1d,0xa7,0x58,0x80,0x08)
#endif
#else
typedef struct ISpeechMemoryStreamVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpeechMemoryStream *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpeechMemoryStream *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpeechMemoryStream *This);

    /*** IDispatch methods ***/
    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
        ISpeechMemoryStream *This,
        UINT *pctinfo);

    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
        ISpeechMemoryStream *This,
        UINT iTInfo,
        LCID lcid,
        ITypeInfo **ppTInfo);

    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
        ISpeechMemoryStream *This,
        REFIID riid,
        LPOLESTR *rgszNames,
        UINT cNames,
        LCID lcid,
        DISPID *rgDispId);

    HRESULT (STDMETHODCALLTYPE *Invoke)(
        ISpeechMemoryStream *This,
        DISPID dispIdMember,
        REFIID riid,
        LCID lcid,
        WORD wFlags,
        DISPPARAMS *pDispParams,
        VARIANT *pVarResult,
        EXCEPINFO *pExcepInfo,
        UINT *puArgErr);

    /*** ISpeechBaseStream methods ***/
    HRESULT (STDMETHODCALLTYPE *get_Format)(
        ISpeechMemoryStream *This,
        ISpeechAudioFormat **AudioFormat);

    HRESULT (STDMETHODCALLTYPE *putref_Format)(
        ISpeechMemoryStream *This,
        ISpeechAudioFormat *AudioFormat);

    HRESULT (STDMETHODCALLTYPE *Read)(
        ISpeechMemoryStream *This,
        VARIANT *Buffer,
        LONG NumberOfBytes,
        LONG *BytesRead);

    HRESULT (STDMETHODCALLTYPE *Write)(
        ISpeechMemoryStream *This,
        VARIANT Buffer,
        LONG *BytesWritten);

    HRESULT (STDMETHODCALLTYPE *Seek)(
        ISpeechMemoryStream *This,
        VARIANT Position,
        SpeechStreamSeekPositionType Origin,
        VARIANT *NewPosition);

    /*** ISpeechMemoryStream methods ***/
    HRESULT (STDMETHODCALLTYPE *SetData)(
        ISpeechMemoryStream *This,
        VARIANT Data);

    HRESULT (STDMETHODCALLTYPE *GetData)(
        ISpeechMemoryStream *This,
        VARIANT *pData);

    END_INTERFACE
} ISpeechMemoryStreamVtbl;

interface ISpeechMemoryStream {
    CONST_VTBL ISpeechMemoryStreamVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpeechMemoryStream_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpeechMemoryStream_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpeechMemoryStream_Release(This) (This)->lpVtbl->Release(This)
/*** IDispatch methods ***/
#define ISpeechMemoryStream_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
#define ISpeechMemoryStream_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
#define ISpeechMemoryStream_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
#define ISpeechMemoryStream_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
/*** ISpeechBaseStream methods ***/
#define ISpeechMemoryStream_get_Format(This,AudioFormat) (This)->lpVtbl->get_Format(This,AudioFormat)
#define ISpeechMemoryStream_putref_Format(This,AudioFormat) (This)->lpVtbl->putref_Format(This,AudioFormat)
#define ISpeechMemoryStream_Read(This,Buffer,NumberOfBytes,BytesRead) (This)->lpVtbl->Read(This,Buffer,NumberOfBytes,BytesRead)
#define ISpeechMemoryStream_Write(This,Buffer,BytesWritten) (This)->lpVtbl->Write(This,Buffer,BytesWritten)
#define ISpeechMemoryStream_Seek(This,Position,Origin,NewPosition) (This)->lpVtbl->Seek(This,Position,Origin,NewPosition)
/*** ISpeechMemoryStream methods ***/
#define ISpeechMemoryStream_SetData(This,Data) (This)->lpVtbl->SetData(This,Data)
#define ISpeechMemoryStream_GetData(This,pData) (This)->lpVtbl->GetData(This,pData)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpeechMemoryStream_QueryInterface(ISpeechMemoryStream* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpeechMemoryStream_AddRef(ISpeechMemoryStream* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpeechMemoryStream_Release(ISpeechMemoryStream* This) {
    return This->lpVtbl->Release(This);
}
/*** IDispatch methods ***/
static FORCEINLINE HRESULT ISpeechMemoryStream_GetTypeInfoCount(ISpeechMemoryStream* This,UINT *pctinfo) {
    return This->lpVtbl->GetTypeInfoCount(This,pctinfo);
}
static FORCEINLINE HRESULT ISpeechMemoryStream_GetTypeInfo(ISpeechMemoryStream* This,UINT iTInfo,LCID lcid,ITypeInfo **ppTInfo) {
    return This->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo);
}
static FORCEINLINE HRESULT ISpeechMemoryStream_GetIDsOfNames(ISpeechMemoryStream* This,REFIID riid,LPOLESTR *rgszNames,UINT cNames,LCID lcid,DISPID *rgDispId) {
    return This->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId);
}
static FORCEINLINE HRESULT ISpeechMemoryStream_Invoke(ISpeechMemoryStream* This,DISPID dispIdMember,REFIID riid,LCID lcid,WORD wFlags,DISPPARAMS *pDispParams,VARIANT *pVarResult,EXCEPINFO *pExcepInfo,UINT *puArgErr) {
    return This->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr);
}
/*** ISpeechBaseStream methods ***/
static FORCEINLINE HRESULT ISpeechMemoryStream_get_Format(ISpeechMemoryStream* This,ISpeechAudioFormat **AudioFormat) {
    return This->lpVtbl->get_Format(This,AudioFormat);
}
static FORCEINLINE HRESULT ISpeechMemoryStream_putref_Format(ISpeechMemoryStream* This,ISpeechAudioFormat *AudioFormat) {
    return This->lpVtbl->putref_Format(This,AudioFormat);
}
static FORCEINLINE HRESULT ISpeechMemoryStream_Read(ISpeechMemoryStream* This,VARIANT *Buffer,LONG NumberOfBytes,LONG *BytesRead) {
    return This->lpVtbl->Read(This,Buffer,NumberOfBytes,BytesRead);
}
static FORCEINLINE HRESULT ISpeechMemoryStream_Write(ISpeechMemoryStream* This,VARIANT Buffer,LONG *BytesWritten) {
    return This->lpVtbl->Write(This,Buffer,BytesWritten);
}
static FORCEINLINE HRESULT ISpeechMemoryStream_Seek(ISpeechMemoryStream* This,VARIANT Position,SpeechStreamSeekPositionType Origin,VARIANT *NewPosition) {
    return This->lpVtbl->Seek(This,Position,Origin,NewPosition);
}
/*** ISpeechMemoryStream methods ***/
static FORCEINLINE HRESULT ISpeechMemoryStream_SetData(ISpeechMemoryStream* This,VARIANT Data) {
    return This->lpVtbl->SetData(This,Data);
}
static FORCEINLINE HRESULT ISpeechMemoryStream_GetData(ISpeechMemoryStream* This,VARIANT *pData) {
    return This->lpVtbl->GetData(This,pData);
}
#endif
#endif

#endif


#endif  /* __ISpeechMemoryStream_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpeechAudioStatus interface
 */
#ifndef __ISpeechAudioStatus_INTERFACE_DEFINED__
#define __ISpeechAudioStatus_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpeechAudioStatus, 0xc62d9c91, 0x7458, 0x47f6, 0x86,0x2d, 0x1e,0xf8,0x6f,0xb0,0xb2,0x78);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("c62d9c91-7458-47f6-862d-1ef86fb0b278")
ISpeechAudioStatus : public IDispatch
{
    virtual HRESULT STDMETHODCALLTYPE get_FreeBufferSpace(
        LONG *FreeBufferSpace) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_NonBlockingIO(
        LONG *NonBlockingIO) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_State(
        SpeechAudioState *State) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_CurrentSeekPosition(
        VARIANT *CurrentSeekPosition) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_CurrentDevicePosition(
        VARIANT *CurrentDevicePosition) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpeechAudioStatus, 0xc62d9c91, 0x7458, 0x47f6, 0x86,0x2d, 0x1e,0xf8,0x6f,0xb0,0xb2,0x78)
#endif
#else
typedef struct ISpeechAudioStatusVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpeechAudioStatus *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpeechAudioStatus *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpeechAudioStatus *This);

    /*** IDispatch methods ***/
    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
        ISpeechAudioStatus *This,
        UINT *pctinfo);

    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
        ISpeechAudioStatus *This,
        UINT iTInfo,
        LCID lcid,
        ITypeInfo **ppTInfo);

    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
        ISpeechAudioStatus *This,
        REFIID riid,
        LPOLESTR *rgszNames,
        UINT cNames,
        LCID lcid,
        DISPID *rgDispId);

    HRESULT (STDMETHODCALLTYPE *Invoke)(
        ISpeechAudioStatus *This,
        DISPID dispIdMember,
        REFIID riid,
        LCID lcid,
        WORD wFlags,
        DISPPARAMS *pDispParams,
        VARIANT *pVarResult,
        EXCEPINFO *pExcepInfo,
        UINT *puArgErr);

    /*** ISpeechAudioStatus methods ***/
    HRESULT (STDMETHODCALLTYPE *get_FreeBufferSpace)(
        ISpeechAudioStatus *This,
        LONG *FreeBufferSpace);

    HRESULT (STDMETHODCALLTYPE *get_NonBlockingIO)(
        ISpeechAudioStatus *This,
        LONG *NonBlockingIO);

    HRESULT (STDMETHODCALLTYPE *get_State)(
        ISpeechAudioStatus *This,
        SpeechAudioState *State);

    HRESULT (STDMETHODCALLTYPE *get_CurrentSeekPosition)(
        ISpeechAudioStatus *This,
        VARIANT *CurrentSeekPosition);

    HRESULT (STDMETHODCALLTYPE *get_CurrentDevicePosition)(
        ISpeechAudioStatus *This,
        VARIANT *CurrentDevicePosition);

    END_INTERFACE
} ISpeechAudioStatusVtbl;

interface ISpeechAudioStatus {
    CONST_VTBL ISpeechAudioStatusVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpeechAudioStatus_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpeechAudioStatus_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpeechAudioStatus_Release(This) (This)->lpVtbl->Release(This)
/*** IDispatch methods ***/
#define ISpeechAudioStatus_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
#define ISpeechAudioStatus_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
#define ISpeechAudioStatus_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
#define ISpeechAudioStatus_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
/*** ISpeechAudioStatus methods ***/
#define ISpeechAudioStatus_get_FreeBufferSpace(This,FreeBufferSpace) (This)->lpVtbl->get_FreeBufferSpace(This,FreeBufferSpace)
#define ISpeechAudioStatus_get_NonBlockingIO(This,NonBlockingIO) (This)->lpVtbl->get_NonBlockingIO(This,NonBlockingIO)
#define ISpeechAudioStatus_get_State(This,State) (This)->lpVtbl->get_State(This,State)
#define ISpeechAudioStatus_get_CurrentSeekPosition(This,CurrentSeekPosition) (This)->lpVtbl->get_CurrentSeekPosition(This,CurrentSeekPosition)
#define ISpeechAudioStatus_get_CurrentDevicePosition(This,CurrentDevicePosition) (This)->lpVtbl->get_CurrentDevicePosition(This,CurrentDevicePosition)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpeechAudioStatus_QueryInterface(ISpeechAudioStatus* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpeechAudioStatus_AddRef(ISpeechAudioStatus* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpeechAudioStatus_Release(ISpeechAudioStatus* This) {
    return This->lpVtbl->Release(This);
}
/*** IDispatch methods ***/
static FORCEINLINE HRESULT ISpeechAudioStatus_GetTypeInfoCount(ISpeechAudioStatus* This,UINT *pctinfo) {
    return This->lpVtbl->GetTypeInfoCount(This,pctinfo);
}
static FORCEINLINE HRESULT ISpeechAudioStatus_GetTypeInfo(ISpeechAudioStatus* This,UINT iTInfo,LCID lcid,ITypeInfo **ppTInfo) {
    return This->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo);
}
static FORCEINLINE HRESULT ISpeechAudioStatus_GetIDsOfNames(ISpeechAudioStatus* This,REFIID riid,LPOLESTR *rgszNames,UINT cNames,LCID lcid,DISPID *rgDispId) {
    return This->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId);
}
static FORCEINLINE HRESULT ISpeechAudioStatus_Invoke(ISpeechAudioStatus* This,DISPID dispIdMember,REFIID riid,LCID lcid,WORD wFlags,DISPPARAMS *pDispParams,VARIANT *pVarResult,EXCEPINFO *pExcepInfo,UINT *puArgErr) {
    return This->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr);
}
/*** ISpeechAudioStatus methods ***/
static FORCEINLINE HRESULT ISpeechAudioStatus_get_FreeBufferSpace(ISpeechAudioStatus* This,LONG *FreeBufferSpace) {
    return This->lpVtbl->get_FreeBufferSpace(This,FreeBufferSpace);
}
static FORCEINLINE HRESULT ISpeechAudioStatus_get_NonBlockingIO(ISpeechAudioStatus* This,LONG *NonBlockingIO) {
    return This->lpVtbl->get_NonBlockingIO(This,NonBlockingIO);
}
static FORCEINLINE HRESULT ISpeechAudioStatus_get_State(ISpeechAudioStatus* This,SpeechAudioState *State) {
    return This->lpVtbl->get_State(This,State);
}
static FORCEINLINE HRESULT ISpeechAudioStatus_get_CurrentSeekPosition(ISpeechAudioStatus* This,VARIANT *CurrentSeekPosition) {
    return This->lpVtbl->get_CurrentSeekPosition(This,CurrentSeekPosition);
}
static FORCEINLINE HRESULT ISpeechAudioStatus_get_CurrentDevicePosition(ISpeechAudioStatus* This,VARIANT *CurrentDevicePosition) {
    return This->lpVtbl->get_CurrentDevicePosition(This,CurrentDevicePosition);
}
#endif
#endif

#endif


#endif  /* __ISpeechAudioStatus_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpeechAudioBufferInfo interface
 */
#ifndef __ISpeechAudioBufferInfo_INTERFACE_DEFINED__
#define __ISpeechAudioBufferInfo_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpeechAudioBufferInfo, 0x11b103d8, 0x1142, 0x4edf, 0xa0,0x93, 0x82,0xfb,0x39,0x15,0xf8,0xcc);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("11b103d8-1142-4edf-a093-82fb3915f8cc")
ISpeechAudioBufferInfo : public IDispatch
{
    virtual HRESULT STDMETHODCALLTYPE get_MinNotification(
        LONG *MinNotification) = 0;

    virtual HRESULT STDMETHODCALLTYPE put_MinNotification(
        LONG MinNotification) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_BufferSize(
        LONG *BufferSize) = 0;

    virtual HRESULT STDMETHODCALLTYPE put_BufferSize(
        LONG BufferSize) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_EventBias(
        LONG *EventBias) = 0;

    virtual HRESULT STDMETHODCALLTYPE put_EventBias(
        LONG EventBias) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpeechAudioBufferInfo, 0x11b103d8, 0x1142, 0x4edf, 0xa0,0x93, 0x82,0xfb,0x39,0x15,0xf8,0xcc)
#endif
#else
typedef struct ISpeechAudioBufferInfoVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpeechAudioBufferInfo *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpeechAudioBufferInfo *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpeechAudioBufferInfo *This);

    /*** IDispatch methods ***/
    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
        ISpeechAudioBufferInfo *This,
        UINT *pctinfo);

    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
        ISpeechAudioBufferInfo *This,
        UINT iTInfo,
        LCID lcid,
        ITypeInfo **ppTInfo);

    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
        ISpeechAudioBufferInfo *This,
        REFIID riid,
        LPOLESTR *rgszNames,
        UINT cNames,
        LCID lcid,
        DISPID *rgDispId);

    HRESULT (STDMETHODCALLTYPE *Invoke)(
        ISpeechAudioBufferInfo *This,
        DISPID dispIdMember,
        REFIID riid,
        LCID lcid,
        WORD wFlags,
        DISPPARAMS *pDispParams,
        VARIANT *pVarResult,
        EXCEPINFO *pExcepInfo,
        UINT *puArgErr);

    /*** ISpeechAudioBufferInfo methods ***/
    HRESULT (STDMETHODCALLTYPE *get_MinNotification)(
        ISpeechAudioBufferInfo *This,
        LONG *MinNotification);

    HRESULT (STDMETHODCALLTYPE *put_MinNotification)(
        ISpeechAudioBufferInfo *This,
        LONG MinNotification);

    HRESULT (STDMETHODCALLTYPE *get_BufferSize)(
        ISpeechAudioBufferInfo *This,
        LONG *BufferSize);

    HRESULT (STDMETHODCALLTYPE *put_BufferSize)(
        ISpeechAudioBufferInfo *This,
        LONG BufferSize);

    HRESULT (STDMETHODCALLTYPE *get_EventBias)(
        ISpeechAudioBufferInfo *This,
        LONG *EventBias);

    HRESULT (STDMETHODCALLTYPE *put_EventBias)(
        ISpeechAudioBufferInfo *This,
        LONG EventBias);

    END_INTERFACE
} ISpeechAudioBufferInfoVtbl;

interface ISpeechAudioBufferInfo {
    CONST_VTBL ISpeechAudioBufferInfoVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpeechAudioBufferInfo_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpeechAudioBufferInfo_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpeechAudioBufferInfo_Release(This) (This)->lpVtbl->Release(This)
/*** IDispatch methods ***/
#define ISpeechAudioBufferInfo_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
#define ISpeechAudioBufferInfo_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
#define ISpeechAudioBufferInfo_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
#define ISpeechAudioBufferInfo_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
/*** ISpeechAudioBufferInfo methods ***/
#define ISpeechAudioBufferInfo_get_MinNotification(This,MinNotification) (This)->lpVtbl->get_MinNotification(This,MinNotification)
#define ISpeechAudioBufferInfo_put_MinNotification(This,MinNotification) (This)->lpVtbl->put_MinNotification(This,MinNotification)
#define ISpeechAudioBufferInfo_get_BufferSize(This,BufferSize) (This)->lpVtbl->get_BufferSize(This,BufferSize)
#define ISpeechAudioBufferInfo_put_BufferSize(This,BufferSize) (This)->lpVtbl->put_BufferSize(This,BufferSize)
#define ISpeechAudioBufferInfo_get_EventBias(This,EventBias) (This)->lpVtbl->get_EventBias(This,EventBias)
#define ISpeechAudioBufferInfo_put_EventBias(This,EventBias) (This)->lpVtbl->put_EventBias(This,EventBias)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpeechAudioBufferInfo_QueryInterface(ISpeechAudioBufferInfo* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpeechAudioBufferInfo_AddRef(ISpeechAudioBufferInfo* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpeechAudioBufferInfo_Release(ISpeechAudioBufferInfo* This) {
    return This->lpVtbl->Release(This);
}
/*** IDispatch methods ***/
static FORCEINLINE HRESULT ISpeechAudioBufferInfo_GetTypeInfoCount(ISpeechAudioBufferInfo* This,UINT *pctinfo) {
    return This->lpVtbl->GetTypeInfoCount(This,pctinfo);
}
static FORCEINLINE HRESULT ISpeechAudioBufferInfo_GetTypeInfo(ISpeechAudioBufferInfo* This,UINT iTInfo,LCID lcid,ITypeInfo **ppTInfo) {
    return This->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo);
}
static FORCEINLINE HRESULT ISpeechAudioBufferInfo_GetIDsOfNames(ISpeechAudioBufferInfo* This,REFIID riid,LPOLESTR *rgszNames,UINT cNames,LCID lcid,DISPID *rgDispId) {
    return This->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId);
}
static FORCEINLINE HRESULT ISpeechAudioBufferInfo_Invoke(ISpeechAudioBufferInfo* This,DISPID dispIdMember,REFIID riid,LCID lcid,WORD wFlags,DISPPARAMS *pDispParams,VARIANT *pVarResult,EXCEPINFO *pExcepInfo,UINT *puArgErr) {
    return This->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr);
}
/*** ISpeechAudioBufferInfo methods ***/
static FORCEINLINE HRESULT ISpeechAudioBufferInfo_get_MinNotification(ISpeechAudioBufferInfo* This,LONG *MinNotification) {
    return This->lpVtbl->get_MinNotification(This,MinNotification);
}
static FORCEINLINE HRESULT ISpeechAudioBufferInfo_put_MinNotification(ISpeechAudioBufferInfo* This,LONG MinNotification) {
    return This->lpVtbl->put_MinNotification(This,MinNotification);
}
static FORCEINLINE HRESULT ISpeechAudioBufferInfo_get_BufferSize(ISpeechAudioBufferInfo* This,LONG *BufferSize) {
    return This->lpVtbl->get_BufferSize(This,BufferSize);
}
static FORCEINLINE HRESULT ISpeechAudioBufferInfo_put_BufferSize(ISpeechAudioBufferInfo* This,LONG BufferSize) {
    return This->lpVtbl->put_BufferSize(This,BufferSize);
}
static FORCEINLINE HRESULT ISpeechAudioBufferInfo_get_EventBias(ISpeechAudioBufferInfo* This,LONG *EventBias) {
    return This->lpVtbl->get_EventBias(This,EventBias);
}
static FORCEINLINE HRESULT ISpeechAudioBufferInfo_put_EventBias(ISpeechAudioBufferInfo* This,LONG EventBias) {
    return This->lpVtbl->put_EventBias(This,EventBias);
}
#endif
#endif

#endif


#endif  /* __ISpeechAudioBufferInfo_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpeechWaveFormatEx interface
 */
#ifndef __ISpeechWaveFormatEx_INTERFACE_DEFINED__
#define __ISpeechWaveFormatEx_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpeechWaveFormatEx, 0x7a1ef0d5, 0x1581, 0x4741, 0x88,0xe4, 0x20,0x9a,0x49,0xf1,0x1a,0x10);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("7a1ef0d5-1581-4741-88e4-209a49f11a10")
ISpeechWaveFormatEx : public IDispatch
{
    virtual HRESULT STDMETHODCALLTYPE get_FormatTag(
        short *FormatTag) = 0;

    virtual HRESULT STDMETHODCALLTYPE put_FormatTag(
        short FormatTag) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_Channels(
        short *Channels) = 0;

    virtual HRESULT STDMETHODCALLTYPE put_Channels(
        short Channels) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_SamplesPerSec(
        LONG *SamplesPerSec) = 0;

    virtual HRESULT STDMETHODCALLTYPE put_SamplesPerSec(
        LONG SamplesPerSec) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_AvgBytesPerSec(
        LONG *AvgBytesPerSec) = 0;

    virtual HRESULT STDMETHODCALLTYPE put_AvgBytesPerSec(
        LONG AvgBytesPerSec) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_BlockAlign(
        short *BlockAlign) = 0;

    virtual HRESULT STDMETHODCALLTYPE put_BlockAlign(
        short BlockAlign) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_BitsPerSample(
        short *BitsPerSample) = 0;

    virtual HRESULT STDMETHODCALLTYPE put_BitsPerSample(
        short BitsPerSample) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_ExtraData(
        VARIANT *ExtraData) = 0;

    virtual HRESULT STDMETHODCALLTYPE put_ExtraData(
        VARIANT ExtraData) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpeechWaveFormatEx, 0x7a1ef0d5, 0x1581, 0x4741, 0x88,0xe4, 0x20,0x9a,0x49,0xf1,0x1a,0x10)
#endif
#else
typedef struct ISpeechWaveFormatExVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpeechWaveFormatEx *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpeechWaveFormatEx *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpeechWaveFormatEx *This);

    /*** IDispatch methods ***/
    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
        ISpeechWaveFormatEx *This,
        UINT *pctinfo);

    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
        ISpeechWaveFormatEx *This,
        UINT iTInfo,
        LCID lcid,
        ITypeInfo **ppTInfo);

    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
        ISpeechWaveFormatEx *This,
        REFIID riid,
        LPOLESTR *rgszNames,
        UINT cNames,
        LCID lcid,
        DISPID *rgDispId);

    HRESULT (STDMETHODCALLTYPE *Invoke)(
        ISpeechWaveFormatEx *This,
        DISPID dispIdMember,
        REFIID riid,
        LCID lcid,
        WORD wFlags,
        DISPPARAMS *pDispParams,
        VARIANT *pVarResult,
        EXCEPINFO *pExcepInfo,
        UINT *puArgErr);

    /*** ISpeechWaveFormatEx methods ***/
    HRESULT (STDMETHODCALLTYPE *get_FormatTag)(
        ISpeechWaveFormatEx *This,
        short *FormatTag);

    HRESULT (STDMETHODCALLTYPE *put_FormatTag)(
        ISpeechWaveFormatEx *This,
        short FormatTag);

    HRESULT (STDMETHODCALLTYPE *get_Channels)(
        ISpeechWaveFormatEx *This,
        short *Channels);

    HRESULT (STDMETHODCALLTYPE *put_Channels)(
        ISpeechWaveFormatEx *This,
        short Channels);

    HRESULT (STDMETHODCALLTYPE *get_SamplesPerSec)(
        ISpeechWaveFormatEx *This,
        LONG *SamplesPerSec);

    HRESULT (STDMETHODCALLTYPE *put_SamplesPerSec)(
        ISpeechWaveFormatEx *This,
        LONG SamplesPerSec);

    HRESULT (STDMETHODCALLTYPE *get_AvgBytesPerSec)(
        ISpeechWaveFormatEx *This,
        LONG *AvgBytesPerSec);

    HRESULT (STDMETHODCALLTYPE *put_AvgBytesPerSec)(
        ISpeechWaveFormatEx *This,
        LONG AvgBytesPerSec);

    HRESULT (STDMETHODCALLTYPE *get_BlockAlign)(
        ISpeechWaveFormatEx *This,
        short *BlockAlign);

    HRESULT (STDMETHODCALLTYPE *put_BlockAlign)(
        ISpeechWaveFormatEx *This,
        short BlockAlign);

    HRESULT (STDMETHODCALLTYPE *get_BitsPerSample)(
        ISpeechWaveFormatEx *This,
        short *BitsPerSample);

    HRESULT (STDMETHODCALLTYPE *put_BitsPerSample)(
        ISpeechWaveFormatEx *This,
        short BitsPerSample);

    HRESULT (STDMETHODCALLTYPE *get_ExtraData)(
        ISpeechWaveFormatEx *This,
        VARIANT *ExtraData);

    HRESULT (STDMETHODCALLTYPE *put_ExtraData)(
        ISpeechWaveFormatEx *This,
        VARIANT ExtraData);

    END_INTERFACE
} ISpeechWaveFormatExVtbl;

interface ISpeechWaveFormatEx {
    CONST_VTBL ISpeechWaveFormatExVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpeechWaveFormatEx_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpeechWaveFormatEx_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpeechWaveFormatEx_Release(This) (This)->lpVtbl->Release(This)
/*** IDispatch methods ***/
#define ISpeechWaveFormatEx_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
#define ISpeechWaveFormatEx_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
#define ISpeechWaveFormatEx_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
#define ISpeechWaveFormatEx_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
/*** ISpeechWaveFormatEx methods ***/
#define ISpeechWaveFormatEx_get_FormatTag(This,FormatTag) (This)->lpVtbl->get_FormatTag(This,FormatTag)
#define ISpeechWaveFormatEx_put_FormatTag(This,FormatTag) (This)->lpVtbl->put_FormatTag(This,FormatTag)
#define ISpeechWaveFormatEx_get_Channels(This,Channels) (This)->lpVtbl->get_Channels(This,Channels)
#define ISpeechWaveFormatEx_put_Channels(This,Channels) (This)->lpVtbl->put_Channels(This,Channels)
#define ISpeechWaveFormatEx_get_SamplesPerSec(This,SamplesPerSec) (This)->lpVtbl->get_SamplesPerSec(This,SamplesPerSec)
#define ISpeechWaveFormatEx_put_SamplesPerSec(This,SamplesPerSec) (This)->lpVtbl->put_SamplesPerSec(This,SamplesPerSec)
#define ISpeechWaveFormatEx_get_AvgBytesPerSec(This,AvgBytesPerSec) (This)->lpVtbl->get_AvgBytesPerSec(This,AvgBytesPerSec)
#define ISpeechWaveFormatEx_put_AvgBytesPerSec(This,AvgBytesPerSec) (This)->lpVtbl->put_AvgBytesPerSec(This,AvgBytesPerSec)
#define ISpeechWaveFormatEx_get_BlockAlign(This,BlockAlign) (This)->lpVtbl->get_BlockAlign(This,BlockAlign)
#define ISpeechWaveFormatEx_put_BlockAlign(This,BlockAlign) (This)->lpVtbl->put_BlockAlign(This,BlockAlign)
#define ISpeechWaveFormatEx_get_BitsPerSample(This,BitsPerSample) (This)->lpVtbl->get_BitsPerSample(This,BitsPerSample)
#define ISpeechWaveFormatEx_put_BitsPerSample(This,BitsPerSample) (This)->lpVtbl->put_BitsPerSample(This,BitsPerSample)
#define ISpeechWaveFormatEx_get_ExtraData(This,ExtraData) (This)->lpVtbl->get_ExtraData(This,ExtraData)
#define ISpeechWaveFormatEx_put_ExtraData(This,ExtraData) (This)->lpVtbl->put_ExtraData(This,ExtraData)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpeechWaveFormatEx_QueryInterface(ISpeechWaveFormatEx* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpeechWaveFormatEx_AddRef(ISpeechWaveFormatEx* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpeechWaveFormatEx_Release(ISpeechWaveFormatEx* This) {
    return This->lpVtbl->Release(This);
}
/*** IDispatch methods ***/
static FORCEINLINE HRESULT ISpeechWaveFormatEx_GetTypeInfoCount(ISpeechWaveFormatEx* This,UINT *pctinfo) {
    return This->lpVtbl->GetTypeInfoCount(This,pctinfo);
}
static FORCEINLINE HRESULT ISpeechWaveFormatEx_GetTypeInfo(ISpeechWaveFormatEx* This,UINT iTInfo,LCID lcid,ITypeInfo **ppTInfo) {
    return This->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo);
}
static FORCEINLINE HRESULT ISpeechWaveFormatEx_GetIDsOfNames(ISpeechWaveFormatEx* This,REFIID riid,LPOLESTR *rgszNames,UINT cNames,LCID lcid,DISPID *rgDispId) {
    return This->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId);
}
static FORCEINLINE HRESULT ISpeechWaveFormatEx_Invoke(ISpeechWaveFormatEx* This,DISPID dispIdMember,REFIID riid,LCID lcid,WORD wFlags,DISPPARAMS *pDispParams,VARIANT *pVarResult,EXCEPINFO *pExcepInfo,UINT *puArgErr) {
    return This->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr);
}
/*** ISpeechWaveFormatEx methods ***/
static FORCEINLINE HRESULT ISpeechWaveFormatEx_get_FormatTag(ISpeechWaveFormatEx* This,short *FormatTag) {
    return This->lpVtbl->get_FormatTag(This,FormatTag);
}
static FORCEINLINE HRESULT ISpeechWaveFormatEx_put_FormatTag(ISpeechWaveFormatEx* This,short FormatTag) {
    return This->lpVtbl->put_FormatTag(This,FormatTag);
}
static FORCEINLINE HRESULT ISpeechWaveFormatEx_get_Channels(ISpeechWaveFormatEx* This,short *Channels) {
    return This->lpVtbl->get_Channels(This,Channels);
}
static FORCEINLINE HRESULT ISpeechWaveFormatEx_put_Channels(ISpeechWaveFormatEx* This,short Channels) {
    return This->lpVtbl->put_Channels(This,Channels);
}
static FORCEINLINE HRESULT ISpeechWaveFormatEx_get_SamplesPerSec(ISpeechWaveFormatEx* This,LONG *SamplesPerSec) {
    return This->lpVtbl->get_SamplesPerSec(This,SamplesPerSec);
}
static FORCEINLINE HRESULT ISpeechWaveFormatEx_put_SamplesPerSec(ISpeechWaveFormatEx* This,LONG SamplesPerSec) {
    return This->lpVtbl->put_SamplesPerSec(This,SamplesPerSec);
}
static FORCEINLINE HRESULT ISpeechWaveFormatEx_get_AvgBytesPerSec(ISpeechWaveFormatEx* This,LONG *AvgBytesPerSec) {
    return This->lpVtbl->get_AvgBytesPerSec(This,AvgBytesPerSec);
}
static FORCEINLINE HRESULT ISpeechWaveFormatEx_put_AvgBytesPerSec(ISpeechWaveFormatEx* This,LONG AvgBytesPerSec) {
    return This->lpVtbl->put_AvgBytesPerSec(This,AvgBytesPerSec);
}
static FORCEINLINE HRESULT ISpeechWaveFormatEx_get_BlockAlign(ISpeechWaveFormatEx* This,short *BlockAlign) {
    return This->lpVtbl->get_BlockAlign(This,BlockAlign);
}
static FORCEINLINE HRESULT ISpeechWaveFormatEx_put_BlockAlign(ISpeechWaveFormatEx* This,short BlockAlign) {
    return This->lpVtbl->put_BlockAlign(This,BlockAlign);
}
static FORCEINLINE HRESULT ISpeechWaveFormatEx_get_BitsPerSample(ISpeechWaveFormatEx* This,short *BitsPerSample) {
    return This->lpVtbl->get_BitsPerSample(This,BitsPerSample);
}
static FORCEINLINE HRESULT ISpeechWaveFormatEx_put_BitsPerSample(ISpeechWaveFormatEx* This,short BitsPerSample) {
    return This->lpVtbl->put_BitsPerSample(This,BitsPerSample);
}
static FORCEINLINE HRESULT ISpeechWaveFormatEx_get_ExtraData(ISpeechWaveFormatEx* This,VARIANT *ExtraData) {
    return This->lpVtbl->get_ExtraData(This,ExtraData);
}
static FORCEINLINE HRESULT ISpeechWaveFormatEx_put_ExtraData(ISpeechWaveFormatEx* This,VARIANT ExtraData) {
    return This->lpVtbl->put_ExtraData(This,ExtraData);
}
#endif
#endif

#endif


#endif  /* __ISpeechWaveFormatEx_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpeechVoice interface
 */
#ifndef __ISpeechVoice_INTERFACE_DEFINED__
#define __ISpeechVoice_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpeechVoice, 0x269316d8, 0x57bd, 0x11d2, 0x9e,0xee, 0x00,0xc0,0x4f,0x79,0x73,0x96);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("269316d8-57bd-11d2-9eee-00c04f797396")
ISpeechVoice : public IDispatch
{
    virtual HRESULT STDMETHODCALLTYPE get_Status(
        ISpeechVoiceStatus **Status) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_Voice(
        ISpeechObjectToken **Voice) = 0;

    virtual HRESULT STDMETHODCALLTYPE putref_Voice(
        ISpeechObjectToken *Voice) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_AudioOutput(
        ISpeechObjectToken **AudioOutput) = 0;

    virtual HRESULT STDMETHODCALLTYPE putref_AudioOutput(
        ISpeechObjectToken *AudioOutput) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_AudioOutputStream(
        ISpeechBaseStream **AudioOutputStream) = 0;

    virtual HRESULT STDMETHODCALLTYPE putref_AudioOutputStream(
        ISpeechBaseStream *AudioOutputStream) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_Rate(
        LONG *Rate) = 0;

    virtual HRESULT STDMETHODCALLTYPE put_Rate(
        LONG Rate) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_Volume(
        LONG *Volume) = 0;

    virtual HRESULT STDMETHODCALLTYPE put_Volume(
        LONG Volume) = 0;

    virtual HRESULT STDMETHODCALLTYPE put_AllowAudioOutputFormatChangesOnNextSet(
        VARIANT_BOOL Allow) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_AllowAudioOutputFormatChangesOnNextSet(
        VARIANT_BOOL *Allow) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_EventInterests(
        SpeechVoiceEvents *EventInterestFlags) = 0;

    virtual HRESULT STDMETHODCALLTYPE put_EventInterests(
        SpeechVoiceEvents EventInterestFlags) = 0;

    virtual HRESULT STDMETHODCALLTYPE put_Priority(
        SpeechVoicePriority Priority) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_Priority(
        SpeechVoicePriority *Priority) = 0;

    virtual HRESULT STDMETHODCALLTYPE put_AlertBoundary(
        SpeechVoiceEvents Boundary) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_AlertBoundary(
        SpeechVoiceEvents *Boundary) = 0;

    virtual HRESULT STDMETHODCALLTYPE put_SynchronousSpeakTimeout(
        LONG msTimeout) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_SynchronousSpeakTimeout(
        LONG *msTimeout) = 0;

    virtual HRESULT STDMETHODCALLTYPE Speak(
        BSTR Text,
        SpeechVoiceSpeakFlags Flags,
        LONG *StreamNumber) = 0;

    virtual HRESULT STDMETHODCALLTYPE SpeakStream(
        ISpeechBaseStream *Stream,
        SpeechVoiceSpeakFlags Flags,
        LONG *StreamNumber) = 0;

    virtual HRESULT STDMETHODCALLTYPE Pause(
        ) = 0;

    virtual HRESULT STDMETHODCALLTYPE Resume(
        ) = 0;

    virtual HRESULT STDMETHODCALLTYPE Skip(
        const BSTR Type,
        LONG NumItems,
        LONG *NumSkipped) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetVoices(
        BSTR RequiredAttributes,
        BSTR OptionalAttributes,
        ISpeechObjectTokens **ObjectTokens) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetAudioOutputs(
        BSTR RequiredAttributes,
        BSTR OptionalAttributes,
        ISpeechObjectTokens **ObjectTokens) = 0;

    virtual HRESULT STDMETHODCALLTYPE WaitUntilDone(
        LONG msTimeout,
        VARIANT_BOOL *Done) = 0;

    virtual HRESULT STDMETHODCALLTYPE SpeakCompleteEvent(
        LONG *Handle) = 0;

    virtual HRESULT STDMETHODCALLTYPE IsUISupported(
        const BSTR TypeOfUI,
        const VARIANT *ExtraData,
        VARIANT_BOOL *Supported) = 0;

    virtual HRESULT STDMETHODCALLTYPE DisplayUI(
        LONG hWndParent,
        BSTR Title,
        const BSTR TypeOfUI,
        const VARIANT *ExtraData = 0) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpeechVoice, 0x269316d8, 0x57bd, 0x11d2, 0x9e,0xee, 0x00,0xc0,0x4f,0x79,0x73,0x96)
#endif
#else
typedef struct ISpeechVoiceVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpeechVoice *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpeechVoice *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpeechVoice *This);

    /*** IDispatch methods ***/
    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
        ISpeechVoice *This,
        UINT *pctinfo);

    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
        ISpeechVoice *This,
        UINT iTInfo,
        LCID lcid,
        ITypeInfo **ppTInfo);

    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
        ISpeechVoice *This,
        REFIID riid,
        LPOLESTR *rgszNames,
        UINT cNames,
        LCID lcid,
        DISPID *rgDispId);

    HRESULT (STDMETHODCALLTYPE *Invoke)(
        ISpeechVoice *This,
        DISPID dispIdMember,
        REFIID riid,
        LCID lcid,
        WORD wFlags,
        DISPPARAMS *pDispParams,
        VARIANT *pVarResult,
        EXCEPINFO *pExcepInfo,
        UINT *puArgErr);

    /*** ISpeechVoice methods ***/
    HRESULT (STDMETHODCALLTYPE *get_Status)(
        ISpeechVoice *This,
        ISpeechVoiceStatus **Status);

    HRESULT (STDMETHODCALLTYPE *get_Voice)(
        ISpeechVoice *This,
        ISpeechObjectToken **Voice);

    HRESULT (STDMETHODCALLTYPE *putref_Voice)(
        ISpeechVoice *This,
        ISpeechObjectToken *Voice);

    HRESULT (STDMETHODCALLTYPE *get_AudioOutput)(
        ISpeechVoice *This,
        ISpeechObjectToken **AudioOutput);

    HRESULT (STDMETHODCALLTYPE *putref_AudioOutput)(
        ISpeechVoice *This,
        ISpeechObjectToken *AudioOutput);

    HRESULT (STDMETHODCALLTYPE *get_AudioOutputStream)(
        ISpeechVoice *This,
        ISpeechBaseStream **AudioOutputStream);

    HRESULT (STDMETHODCALLTYPE *putref_AudioOutputStream)(
        ISpeechVoice *This,
        ISpeechBaseStream *AudioOutputStream);

    HRESULT (STDMETHODCALLTYPE *get_Rate)(
        ISpeechVoice *This,
        LONG *Rate);

    HRESULT (STDMETHODCALLTYPE *put_Rate)(
        ISpeechVoice *This,
        LONG Rate);

    HRESULT (STDMETHODCALLTYPE *get_Volume)(
        ISpeechVoice *This,
        LONG *Volume);

    HRESULT (STDMETHODCALLTYPE *put_Volume)(
        ISpeechVoice *This,
        LONG Volume);

    HRESULT (STDMETHODCALLTYPE *put_AllowAudioOutputFormatChangesOnNextSet)(
        ISpeechVoice *This,
        VARIANT_BOOL Allow);

    HRESULT (STDMETHODCALLTYPE *get_AllowAudioOutputFormatChangesOnNextSet)(
        ISpeechVoice *This,
        VARIANT_BOOL *Allow);

    HRESULT (STDMETHODCALLTYPE *get_EventInterests)(
        ISpeechVoice *This,
        SpeechVoiceEvents *EventInterestFlags);

    HRESULT (STDMETHODCALLTYPE *put_EventInterests)(
        ISpeechVoice *This,
        SpeechVoiceEvents EventInterestFlags);

    HRESULT (STDMETHODCALLTYPE *put_Priority)(
        ISpeechVoice *This,
        SpeechVoicePriority Priority);

    HRESULT (STDMETHODCALLTYPE *get_Priority)(
        ISpeechVoice *This,
        SpeechVoicePriority *Priority);

    HRESULT (STDMETHODCALLTYPE *put_AlertBoundary)(
        ISpeechVoice *This,
        SpeechVoiceEvents Boundary);

    HRESULT (STDMETHODCALLTYPE *get_AlertBoundary)(
        ISpeechVoice *This,
        SpeechVoiceEvents *Boundary);

    HRESULT (STDMETHODCALLTYPE *put_SynchronousSpeakTimeout)(
        ISpeechVoice *This,
        LONG msTimeout);

    HRESULT (STDMETHODCALLTYPE *get_SynchronousSpeakTimeout)(
        ISpeechVoice *This,
        LONG *msTimeout);

    HRESULT (STDMETHODCALLTYPE *Speak)(
        ISpeechVoice *This,
        BSTR Text,
        SpeechVoiceSpeakFlags Flags,
        LONG *StreamNumber);

    HRESULT (STDMETHODCALLTYPE *SpeakStream)(
        ISpeechVoice *This,
        ISpeechBaseStream *Stream,
        SpeechVoiceSpeakFlags Flags,
        LONG *StreamNumber);

    HRESULT (STDMETHODCALLTYPE *Pause)(
        ISpeechVoice *This);

    HRESULT (STDMETHODCALLTYPE *Resume)(
        ISpeechVoice *This);

    HRESULT (STDMETHODCALLTYPE *Skip)(
        ISpeechVoice *This,
        const BSTR Type,
        LONG NumItems,
        LONG *NumSkipped);

    HRESULT (STDMETHODCALLTYPE *GetVoices)(
        ISpeechVoice *This,
        BSTR RequiredAttributes,
        BSTR OptionalAttributes,
        ISpeechObjectTokens **ObjectTokens);

    HRESULT (STDMETHODCALLTYPE *GetAudioOutputs)(
        ISpeechVoice *This,
        BSTR RequiredAttributes,
        BSTR OptionalAttributes,
        ISpeechObjectTokens **ObjectTokens);

    HRESULT (STDMETHODCALLTYPE *WaitUntilDone)(
        ISpeechVoice *This,
        LONG msTimeout,
        VARIANT_BOOL *Done);

    HRESULT (STDMETHODCALLTYPE *SpeakCompleteEvent)(
        ISpeechVoice *This,
        LONG *Handle);

    HRESULT (STDMETHODCALLTYPE *IsUISupported)(
        ISpeechVoice *This,
        const BSTR TypeOfUI,
        const VARIANT *ExtraData,
        VARIANT_BOOL *Supported);

    HRESULT (STDMETHODCALLTYPE *DisplayUI)(
        ISpeechVoice *This,
        LONG hWndParent,
        BSTR Title,
        const BSTR TypeOfUI,
        const VARIANT *ExtraData);

    END_INTERFACE
} ISpeechVoiceVtbl;

interface ISpeechVoice {
    CONST_VTBL ISpeechVoiceVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpeechVoice_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpeechVoice_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpeechVoice_Release(This) (This)->lpVtbl->Release(This)
/*** IDispatch methods ***/
#define ISpeechVoice_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
#define ISpeechVoice_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
#define ISpeechVoice_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
#define ISpeechVoice_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
/*** ISpeechVoice methods ***/
#define ISpeechVoice_get_Status(This,Status) (This)->lpVtbl->get_Status(This,Status)
#define ISpeechVoice_get_Voice(This,Voice) (This)->lpVtbl->get_Voice(This,Voice)
#define ISpeechVoice_putref_Voice(This,Voice) (This)->lpVtbl->putref_Voice(This,Voice)
#define ISpeechVoice_get_AudioOutput(This,AudioOutput) (This)->lpVtbl->get_AudioOutput(This,AudioOutput)
#define ISpeechVoice_putref_AudioOutput(This,AudioOutput) (This)->lpVtbl->putref_AudioOutput(This,AudioOutput)
#define ISpeechVoice_get_AudioOutputStream(This,AudioOutputStream) (This)->lpVtbl->get_AudioOutputStream(This,AudioOutputStream)
#define ISpeechVoice_putref_AudioOutputStream(This,AudioOutputStream) (This)->lpVtbl->putref_AudioOutputStream(This,AudioOutputStream)
#define ISpeechVoice_get_Rate(This,Rate) (This)->lpVtbl->get_Rate(This,Rate)
#define ISpeechVoice_put_Rate(This,Rate) (This)->lpVtbl->put_Rate(This,Rate)
#define ISpeechVoice_get_Volume(This,Volume) (This)->lpVtbl->get_Volume(This,Volume)
#define ISpeechVoice_put_Volume(This,Volume) (This)->lpVtbl->put_Volume(This,Volume)
#define ISpeechVoice_put_AllowAudioOutputFormatChangesOnNextSet(This,Allow) (This)->lpVtbl->put_AllowAudioOutputFormatChangesOnNextSet(This,Allow)
#define ISpeechVoice_get_AllowAudioOutputFormatChangesOnNextSet(This,Allow) (This)->lpVtbl->get_AllowAudioOutputFormatChangesOnNextSet(This,Allow)
#define ISpeechVoice_get_EventInterests(This,EventInterestFlags) (This)->lpVtbl->get_EventInterests(This,EventInterestFlags)
#define ISpeechVoice_put_EventInterests(This,EventInterestFlags) (This)->lpVtbl->put_EventInterests(This,EventInterestFlags)
#define ISpeechVoice_put_Priority(This,Priority) (This)->lpVtbl->put_Priority(This,Priority)
#define ISpeechVoice_get_Priority(This,Priority) (This)->lpVtbl->get_Priority(This,Priority)
#define ISpeechVoice_put_AlertBoundary(This,Boundary) (This)->lpVtbl->put_AlertBoundary(This,Boundary)
#define ISpeechVoice_get_AlertBoundary(This,Boundary) (This)->lpVtbl->get_AlertBoundary(This,Boundary)
#define ISpeechVoice_put_SynchronousSpeakTimeout(This,msTimeout) (This)->lpVtbl->put_SynchronousSpeakTimeout(This,msTimeout)
#define ISpeechVoice_get_SynchronousSpeakTimeout(This,msTimeout) (This)->lpVtbl->get_SynchronousSpeakTimeout(This,msTimeout)
#define ISpeechVoice_Speak(This,Text,Flags,StreamNumber) (This)->lpVtbl->Speak(This,Text,Flags,StreamNumber)
#define ISpeechVoice_SpeakStream(This,Stream,Flags,StreamNumber) (This)->lpVtbl->SpeakStream(This,Stream,Flags,StreamNumber)
#define ISpeechVoice_Pause(This) (This)->lpVtbl->Pause(This)
#define ISpeechVoice_Resume(This) (This)->lpVtbl->Resume(This)
#define ISpeechVoice_Skip(This,Type,NumItems,NumSkipped) (This)->lpVtbl->Skip(This,Type,NumItems,NumSkipped)
#define ISpeechVoice_GetVoices(This,RequiredAttributes,OptionalAttributes,ObjectTokens) (This)->lpVtbl->GetVoices(This,RequiredAttributes,OptionalAttributes,ObjectTokens)
#define ISpeechVoice_GetAudioOutputs(This,RequiredAttributes,OptionalAttributes,ObjectTokens) (This)->lpVtbl->GetAudioOutputs(This,RequiredAttributes,OptionalAttributes,ObjectTokens)
#define ISpeechVoice_WaitUntilDone(This,msTimeout,Done) (This)->lpVtbl->WaitUntilDone(This,msTimeout,Done)
#define ISpeechVoice_SpeakCompleteEvent(This,Handle) (This)->lpVtbl->SpeakCompleteEvent(This,Handle)
#define ISpeechVoice_IsUISupported(This,TypeOfUI,ExtraData,Supported) (This)->lpVtbl->IsUISupported(This,TypeOfUI,ExtraData,Supported)
#define ISpeechVoice_DisplayUI(This,hWndParent,Title,TypeOfUI,ExtraData) (This)->lpVtbl->DisplayUI(This,hWndParent,Title,TypeOfUI,ExtraData)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpeechVoice_QueryInterface(ISpeechVoice* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpeechVoice_AddRef(ISpeechVoice* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpeechVoice_Release(ISpeechVoice* This) {
    return This->lpVtbl->Release(This);
}
/*** IDispatch methods ***/
static FORCEINLINE HRESULT ISpeechVoice_GetTypeInfoCount(ISpeechVoice* This,UINT *pctinfo) {
    return This->lpVtbl->GetTypeInfoCount(This,pctinfo);
}
static FORCEINLINE HRESULT ISpeechVoice_GetTypeInfo(ISpeechVoice* This,UINT iTInfo,LCID lcid,ITypeInfo **ppTInfo) {
    return This->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo);
}
static FORCEINLINE HRESULT ISpeechVoice_GetIDsOfNames(ISpeechVoice* This,REFIID riid,LPOLESTR *rgszNames,UINT cNames,LCID lcid,DISPID *rgDispId) {
    return This->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId);
}
static FORCEINLINE HRESULT ISpeechVoice_Invoke(ISpeechVoice* This,DISPID dispIdMember,REFIID riid,LCID lcid,WORD wFlags,DISPPARAMS *pDispParams,VARIANT *pVarResult,EXCEPINFO *pExcepInfo,UINT *puArgErr) {
    return This->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr);
}
/*** ISpeechVoice methods ***/
static FORCEINLINE HRESULT ISpeechVoice_get_Status(ISpeechVoice* This,ISpeechVoiceStatus **Status) {
    return This->lpVtbl->get_Status(This,Status);
}
static FORCEINLINE HRESULT ISpeechVoice_get_Voice(ISpeechVoice* This,ISpeechObjectToken **Voice) {
    return This->lpVtbl->get_Voice(This,Voice);
}
static FORCEINLINE HRESULT ISpeechVoice_putref_Voice(ISpeechVoice* This,ISpeechObjectToken *Voice) {
    return This->lpVtbl->putref_Voice(This,Voice);
}
static FORCEINLINE HRESULT ISpeechVoice_get_AudioOutput(ISpeechVoice* This,ISpeechObjectToken **AudioOutput) {
    return This->lpVtbl->get_AudioOutput(This,AudioOutput);
}
static FORCEINLINE HRESULT ISpeechVoice_putref_AudioOutput(ISpeechVoice* This,ISpeechObjectToken *AudioOutput) {
    return This->lpVtbl->putref_AudioOutput(This,AudioOutput);
}
static FORCEINLINE HRESULT ISpeechVoice_get_AudioOutputStream(ISpeechVoice* This,ISpeechBaseStream **AudioOutputStream) {
    return This->lpVtbl->get_AudioOutputStream(This,AudioOutputStream);
}
static FORCEINLINE HRESULT ISpeechVoice_putref_AudioOutputStream(ISpeechVoice* This,ISpeechBaseStream *AudioOutputStream) {
    return This->lpVtbl->putref_AudioOutputStream(This,AudioOutputStream);
}
static FORCEINLINE HRESULT ISpeechVoice_get_Rate(ISpeechVoice* This,LONG *Rate) {
    return This->lpVtbl->get_Rate(This,Rate);
}
static FORCEINLINE HRESULT ISpeechVoice_put_Rate(ISpeechVoice* This,LONG Rate) {
    return This->lpVtbl->put_Rate(This,Rate);
}
static FORCEINLINE HRESULT ISpeechVoice_get_Volume(ISpeechVoice* This,LONG *Volume) {
    return This->lpVtbl->get_Volume(This,Volume);
}
static FORCEINLINE HRESULT ISpeechVoice_put_Volume(ISpeechVoice* This,LONG Volume) {
    return This->lpVtbl->put_Volume(This,Volume);
}
static FORCEINLINE HRESULT ISpeechVoice_put_AllowAudioOutputFormatChangesOnNextSet(ISpeechVoice* This,VARIANT_BOOL Allow) {
    return This->lpVtbl->put_AllowAudioOutputFormatChangesOnNextSet(This,Allow);
}
static FORCEINLINE HRESULT ISpeechVoice_get_AllowAudioOutputFormatChangesOnNextSet(ISpeechVoice* This,VARIANT_BOOL *Allow) {
    return This->lpVtbl->get_AllowAudioOutputFormatChangesOnNextSet(This,Allow);
}
static FORCEINLINE HRESULT ISpeechVoice_get_EventInterests(ISpeechVoice* This,SpeechVoiceEvents *EventInterestFlags) {
    return This->lpVtbl->get_EventInterests(This,EventInterestFlags);
}
static FORCEINLINE HRESULT ISpeechVoice_put_EventInterests(ISpeechVoice* This,SpeechVoiceEvents EventInterestFlags) {
    return This->lpVtbl->put_EventInterests(This,EventInterestFlags);
}
static FORCEINLINE HRESULT ISpeechVoice_put_Priority(ISpeechVoice* This,SpeechVoicePriority Priority) {
    return This->lpVtbl->put_Priority(This,Priority);
}
static FORCEINLINE HRESULT ISpeechVoice_get_Priority(ISpeechVoice* This,SpeechVoicePriority *Priority) {
    return This->lpVtbl->get_Priority(This,Priority);
}
static FORCEINLINE HRESULT ISpeechVoice_put_AlertBoundary(ISpeechVoice* This,SpeechVoiceEvents Boundary) {
    return This->lpVtbl->put_AlertBoundary(This,Boundary);
}
static FORCEINLINE HRESULT ISpeechVoice_get_AlertBoundary(ISpeechVoice* This,SpeechVoiceEvents *Boundary) {
    return This->lpVtbl->get_AlertBoundary(This,Boundary);
}
static FORCEINLINE HRESULT ISpeechVoice_put_SynchronousSpeakTimeout(ISpeechVoice* This,LONG msTimeout) {
    return This->lpVtbl->put_SynchronousSpeakTimeout(This,msTimeout);
}
static FORCEINLINE HRESULT ISpeechVoice_get_SynchronousSpeakTimeout(ISpeechVoice* This,LONG *msTimeout) {
    return This->lpVtbl->get_SynchronousSpeakTimeout(This,msTimeout);
}
static FORCEINLINE HRESULT ISpeechVoice_Speak(ISpeechVoice* This,BSTR Text,SpeechVoiceSpeakFlags Flags,LONG *StreamNumber) {
    return This->lpVtbl->Speak(This,Text,Flags,StreamNumber);
}
static FORCEINLINE HRESULT ISpeechVoice_SpeakStream(ISpeechVoice* This,ISpeechBaseStream *Stream,SpeechVoiceSpeakFlags Flags,LONG *StreamNumber) {
    return This->lpVtbl->SpeakStream(This,Stream,Flags,StreamNumber);
}
static FORCEINLINE HRESULT ISpeechVoice_Pause(ISpeechVoice* This) {
    return This->lpVtbl->Pause(This);
}
static FORCEINLINE HRESULT ISpeechVoice_Resume(ISpeechVoice* This) {
    return This->lpVtbl->Resume(This);
}
static FORCEINLINE HRESULT ISpeechVoice_Skip(ISpeechVoice* This,const BSTR Type,LONG NumItems,LONG *NumSkipped) {
    return This->lpVtbl->Skip(This,Type,NumItems,NumSkipped);
}
static FORCEINLINE HRESULT ISpeechVoice_GetVoices(ISpeechVoice* This,BSTR RequiredAttributes,BSTR OptionalAttributes,ISpeechObjectTokens **ObjectTokens) {
    return This->lpVtbl->GetVoices(This,RequiredAttributes,OptionalAttributes,ObjectTokens);
}
static FORCEINLINE HRESULT ISpeechVoice_GetAudioOutputs(ISpeechVoice* This,BSTR RequiredAttributes,BSTR OptionalAttributes,ISpeechObjectTokens **ObjectTokens) {
    return This->lpVtbl->GetAudioOutputs(This,RequiredAttributes,OptionalAttributes,ObjectTokens);
}
static FORCEINLINE HRESULT ISpeechVoice_WaitUntilDone(ISpeechVoice* This,LONG msTimeout,VARIANT_BOOL *Done) {
    return This->lpVtbl->WaitUntilDone(This,msTimeout,Done);
}
static FORCEINLINE HRESULT ISpeechVoice_SpeakCompleteEvent(ISpeechVoice* This,LONG *Handle) {
    return This->lpVtbl->SpeakCompleteEvent(This,Handle);
}
static FORCEINLINE HRESULT ISpeechVoice_IsUISupported(ISpeechVoice* This,const BSTR TypeOfUI,const VARIANT *ExtraData,VARIANT_BOOL *Supported) {
    return This->lpVtbl->IsUISupported(This,TypeOfUI,ExtraData,Supported);
}
static FORCEINLINE HRESULT ISpeechVoice_DisplayUI(ISpeechVoice* This,LONG hWndParent,BSTR Title,const BSTR TypeOfUI,const VARIANT *ExtraData) {
    return This->lpVtbl->DisplayUI(This,hWndParent,Title,TypeOfUI,ExtraData);
}
#endif
#endif

#endif


#endif  /* __ISpeechVoice_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpeechVoiceStatus interface
 */
#ifndef __ISpeechVoiceStatus_INTERFACE_DEFINED__
#define __ISpeechVoiceStatus_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpeechVoiceStatus, 0x8be47b07, 0x57f6, 0x11d2, 0x9e,0xee, 0x00,0xc0,0x4f,0x79,0x73,0x96);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("8be47b07-57f6-11d2-9eee-00c04f797396")
ISpeechVoiceStatus : public IDispatch
{
    virtual HRESULT STDMETHODCALLTYPE get_CurrentStreamNumber(
        LONG *StreamNumber) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_LastStreamNumberQueued(
        LONG *StreamNumber) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_LastHResult(
        LONG *HResult) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_RunningState(
        SpeechRunState *State) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_InputWordPosition(
        LONG *Position) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_InputWordLength(
        LONG *Length) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_InputSentencePosition(
        LONG *Position) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_InputSentenceLength(
        LONG *Length) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_LastBookmark(
        BSTR *Bookmark) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_LastBookmarkId(
        LONG *BookmarkId) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_PhonemeId(
        short *PhoneId) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_VisemeId(
        short *VisemeId) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpeechVoiceStatus, 0x8be47b07, 0x57f6, 0x11d2, 0x9e,0xee, 0x00,0xc0,0x4f,0x79,0x73,0x96)
#endif
#else
typedef struct ISpeechVoiceStatusVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpeechVoiceStatus *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpeechVoiceStatus *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpeechVoiceStatus *This);

    /*** IDispatch methods ***/
    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
        ISpeechVoiceStatus *This,
        UINT *pctinfo);

    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
        ISpeechVoiceStatus *This,
        UINT iTInfo,
        LCID lcid,
        ITypeInfo **ppTInfo);

    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
        ISpeechVoiceStatus *This,
        REFIID riid,
        LPOLESTR *rgszNames,
        UINT cNames,
        LCID lcid,
        DISPID *rgDispId);

    HRESULT (STDMETHODCALLTYPE *Invoke)(
        ISpeechVoiceStatus *This,
        DISPID dispIdMember,
        REFIID riid,
        LCID lcid,
        WORD wFlags,
        DISPPARAMS *pDispParams,
        VARIANT *pVarResult,
        EXCEPINFO *pExcepInfo,
        UINT *puArgErr);

    /*** ISpeechVoiceStatus methods ***/
    HRESULT (STDMETHODCALLTYPE *get_CurrentStreamNumber)(
        ISpeechVoiceStatus *This,
        LONG *StreamNumber);

    HRESULT (STDMETHODCALLTYPE *get_LastStreamNumberQueued)(
        ISpeechVoiceStatus *This,
        LONG *StreamNumber);

    HRESULT (STDMETHODCALLTYPE *get_LastHResult)(
        ISpeechVoiceStatus *This,
        LONG *HResult);

    HRESULT (STDMETHODCALLTYPE *get_RunningState)(
        ISpeechVoiceStatus *This,
        SpeechRunState *State);

    HRESULT (STDMETHODCALLTYPE *get_InputWordPosition)(
        ISpeechVoiceStatus *This,
        LONG *Position);

    HRESULT (STDMETHODCALLTYPE *get_InputWordLength)(
        ISpeechVoiceStatus *This,
        LONG *Length);

    HRESULT (STDMETHODCALLTYPE *get_InputSentencePosition)(
        ISpeechVoiceStatus *This,
        LONG *Position);

    HRESULT (STDMETHODCALLTYPE *get_InputSentenceLength)(
        ISpeechVoiceStatus *This,
        LONG *Length);

    HRESULT (STDMETHODCALLTYPE *get_LastBookmark)(
        ISpeechVoiceStatus *This,
        BSTR *Bookmark);

    HRESULT (STDMETHODCALLTYPE *get_LastBookmarkId)(
        ISpeechVoiceStatus *This,
        LONG *BookmarkId);

    HRESULT (STDMETHODCALLTYPE *get_PhonemeId)(
        ISpeechVoiceStatus *This,
        short *PhoneId);

    HRESULT (STDMETHODCALLTYPE *get_VisemeId)(
        ISpeechVoiceStatus *This,
        short *VisemeId);

    END_INTERFACE
} ISpeechVoiceStatusVtbl;

interface ISpeechVoiceStatus {
    CONST_VTBL ISpeechVoiceStatusVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpeechVoiceStatus_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpeechVoiceStatus_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpeechVoiceStatus_Release(This) (This)->lpVtbl->Release(This)
/*** IDispatch methods ***/
#define ISpeechVoiceStatus_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
#define ISpeechVoiceStatus_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
#define ISpeechVoiceStatus_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
#define ISpeechVoiceStatus_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
/*** ISpeechVoiceStatus methods ***/
#define ISpeechVoiceStatus_get_CurrentStreamNumber(This,StreamNumber) (This)->lpVtbl->get_CurrentStreamNumber(This,StreamNumber)
#define ISpeechVoiceStatus_get_LastStreamNumberQueued(This,StreamNumber) (This)->lpVtbl->get_LastStreamNumberQueued(This,StreamNumber)
#define ISpeechVoiceStatus_get_LastHResult(This,HResult) (This)->lpVtbl->get_LastHResult(This,HResult)
#define ISpeechVoiceStatus_get_RunningState(This,State) (This)->lpVtbl->get_RunningState(This,State)
#define ISpeechVoiceStatus_get_InputWordPosition(This,Position) (This)->lpVtbl->get_InputWordPosition(This,Position)
#define ISpeechVoiceStatus_get_InputWordLength(This,Length) (This)->lpVtbl->get_InputWordLength(This,Length)
#define ISpeechVoiceStatus_get_InputSentencePosition(This,Position) (This)->lpVtbl->get_InputSentencePosition(This,Position)
#define ISpeechVoiceStatus_get_InputSentenceLength(This,Length) (This)->lpVtbl->get_InputSentenceLength(This,Length)
#define ISpeechVoiceStatus_get_LastBookmark(This,Bookmark) (This)->lpVtbl->get_LastBookmark(This,Bookmark)
#define ISpeechVoiceStatus_get_LastBookmarkId(This,BookmarkId) (This)->lpVtbl->get_LastBookmarkId(This,BookmarkId)
#define ISpeechVoiceStatus_get_PhonemeId(This,PhoneId) (This)->lpVtbl->get_PhonemeId(This,PhoneId)
#define ISpeechVoiceStatus_get_VisemeId(This,VisemeId) (This)->lpVtbl->get_VisemeId(This,VisemeId)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpeechVoiceStatus_QueryInterface(ISpeechVoiceStatus* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpeechVoiceStatus_AddRef(ISpeechVoiceStatus* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpeechVoiceStatus_Release(ISpeechVoiceStatus* This) {
    return This->lpVtbl->Release(This);
}
/*** IDispatch methods ***/
static FORCEINLINE HRESULT ISpeechVoiceStatus_GetTypeInfoCount(ISpeechVoiceStatus* This,UINT *pctinfo) {
    return This->lpVtbl->GetTypeInfoCount(This,pctinfo);
}
static FORCEINLINE HRESULT ISpeechVoiceStatus_GetTypeInfo(ISpeechVoiceStatus* This,UINT iTInfo,LCID lcid,ITypeInfo **ppTInfo) {
    return This->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo);
}
static FORCEINLINE HRESULT ISpeechVoiceStatus_GetIDsOfNames(ISpeechVoiceStatus* This,REFIID riid,LPOLESTR *rgszNames,UINT cNames,LCID lcid,DISPID *rgDispId) {
    return This->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId);
}
static FORCEINLINE HRESULT ISpeechVoiceStatus_Invoke(ISpeechVoiceStatus* This,DISPID dispIdMember,REFIID riid,LCID lcid,WORD wFlags,DISPPARAMS *pDispParams,VARIANT *pVarResult,EXCEPINFO *pExcepInfo,UINT *puArgErr) {
    return This->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr);
}
/*** ISpeechVoiceStatus methods ***/
static FORCEINLINE HRESULT ISpeechVoiceStatus_get_CurrentStreamNumber(ISpeechVoiceStatus* This,LONG *StreamNumber) {
    return This->lpVtbl->get_CurrentStreamNumber(This,StreamNumber);
}
static FORCEINLINE HRESULT ISpeechVoiceStatus_get_LastStreamNumberQueued(ISpeechVoiceStatus* This,LONG *StreamNumber) {
    return This->lpVtbl->get_LastStreamNumberQueued(This,StreamNumber);
}
static FORCEINLINE HRESULT ISpeechVoiceStatus_get_LastHResult(ISpeechVoiceStatus* This,LONG *HResult) {
    return This->lpVtbl->get_LastHResult(This,HResult);
}
static FORCEINLINE HRESULT ISpeechVoiceStatus_get_RunningState(ISpeechVoiceStatus* This,SpeechRunState *State) {
    return This->lpVtbl->get_RunningState(This,State);
}
static FORCEINLINE HRESULT ISpeechVoiceStatus_get_InputWordPosition(ISpeechVoiceStatus* This,LONG *Position) {
    return This->lpVtbl->get_InputWordPosition(This,Position);
}
static FORCEINLINE HRESULT ISpeechVoiceStatus_get_InputWordLength(ISpeechVoiceStatus* This,LONG *Length) {
    return This->lpVtbl->get_InputWordLength(This,Length);
}
static FORCEINLINE HRESULT ISpeechVoiceStatus_get_InputSentencePosition(ISpeechVoiceStatus* This,LONG *Position) {
    return This->lpVtbl->get_InputSentencePosition(This,Position);
}
static FORCEINLINE HRESULT ISpeechVoiceStatus_get_InputSentenceLength(ISpeechVoiceStatus* This,LONG *Length) {
    return This->lpVtbl->get_InputSentenceLength(This,Length);
}
static FORCEINLINE HRESULT ISpeechVoiceStatus_get_LastBookmark(ISpeechVoiceStatus* This,BSTR *Bookmark) {
    return This->lpVtbl->get_LastBookmark(This,Bookmark);
}
static FORCEINLINE HRESULT ISpeechVoiceStatus_get_LastBookmarkId(ISpeechVoiceStatus* This,LONG *BookmarkId) {
    return This->lpVtbl->get_LastBookmarkId(This,BookmarkId);
}
static FORCEINLINE HRESULT ISpeechVoiceStatus_get_PhonemeId(ISpeechVoiceStatus* This,short *PhoneId) {
    return This->lpVtbl->get_PhonemeId(This,PhoneId);
}
static FORCEINLINE HRESULT ISpeechVoiceStatus_get_VisemeId(ISpeechVoiceStatus* This,short *VisemeId) {
    return This->lpVtbl->get_VisemeId(This,VisemeId);
}
#endif
#endif

#endif


#endif  /* __ISpeechVoiceStatus_INTERFACE_DEFINED__ */

typedef enum SpeechVisemeType {
    SVP_0 = 0,
    SVP_1 = 1,
    SVP_2 = 2,
    SVP_3 = 3,
    SVP_4 = 4,
    SVP_5 = 5,
    SVP_6 = 6,
    SVP_7 = 7,
    SVP_8 = 8,
    SVP_9 = 9,
    SVP_10 = 10,
    SVP_11 = 11,
    SVP_12 = 12,
    SVP_13 = 13,
    SVP_14 = 14,
    SVP_15 = 15,
    SVP_16 = 16,
    SVP_17 = 17,
    SVP_18 = 18,
    SVP_19 = 19,
    SVP_20 = 20,
    SVP_21 = 21
} SpeechVisemeType;
typedef enum SpeechVisemeFeature {
    SVF_None = 0,
    SVF_Stressed = SPVFEATURE_STRESSED,
    SVF_Emphasis = SPVFEATURE_EMPHASIS
} SpeechVisemeFeature;
typedef enum DISPID_SpeechVoiceEvent {
    DISPID_SVEStreamStart = 1,
    DISPID_SVEStreamEnd = 2,
    DISPID_SVEVoiceChange = 3,
    DISPID_SVEBookmark = 4,
    DISPID_SVEWord = 5,
    DISPID_SVEPhoneme = 6,
    DISPID_SVESentenceBoundary = 7,
    DISPID_SVEViseme = 8,
    DISPID_SVEAudioLevel = 9,
    DISPID_SVEEnginePrivate = 10
} DISPID_SpeechVoiceEvent;
typedef enum DISPID_SpeechRecognizer {
    DISPID_SRRecognizer = 1,
    DISPID_SRAllowAudioInputFormatChangesOnNextSet = 2,
    DISPID_SRAudioInput = 3,
    DISPID_SRAudioInputStream = 4,
    DISPID_SRIsShared = 5,
    DISPID_SRState = 6,
    DISPID_SRStatus = 7,
    DISPID_SRProfile = 8,
    DISPID_SREmulateRecognition = 9,
    DISPID_SRCreateRecoContext = 10,
    DISPID_SRGetFormat = 11,
    DISPID_SRSetPropertyNumber = 12,
    DISPID_SRGetPropertyNumber = 13,
    DISPID_SRSetPropertyString = 14,
    DISPID_SRGetPropertyString = 15,
    DISPID_SRIsUISupported = 16,
    DISPID_SRDisplayUI = 17,
    DISPID_SRGetRecognizers = 18,
    DISPID_SVGetAudioInputs = 19,
    DISPID_SVGetProfiles = 20
} DISPID_SpeechRecognizer;
typedef enum SpeechRecognizerState {
    SRSInactive = SPRST_INACTIVE,
    SRSActive = SPRST_ACTIVE,
    SRSActiveAlways = SPRST_ACTIVE_ALWAYS,
    SRSInactiveWithPurge = SPRST_INACTIVE_WITH_PURGE
} SpeechRecognizerState;
typedef enum SpeechDisplayAttributes {
    SDA_No_Trailing_Space = 0,
    SDA_One_Trailing_Space = SPAF_ONE_TRAILING_SPACE,
    SDA_Two_Trailing_Spaces = SPAF_TWO_TRAILING_SPACES,
    SDA_Consume_Leading_Spaces = SPAF_CONSUME_LEADING_SPACES
} SpeechDisplayAttributes;
typedef enum SpeechFormatType {
    SFTInput = SPWF_INPUT,
    SFTSREngine = SPWF_SRENGINE
} SpeechFormatType;
typedef enum DISPID_SpeechRecognizerStatus {
    DISPID_SRSAudioStatus = 1,
    DISPID_SRSCurrentStreamPosition = 2,
    DISPID_SRSCurrentStreamNumber = 3,
    DISPID_SRSNumberOfActiveRules = 4,
    DISPID_SRSClsidEngine = 5,
    DISPID_SRSSupportedLanguages = 6
} DISPID_SpeechRecognizerStatus;
typedef enum DISPID_SpeechRecoContext {
    DISPID_SRCRecognizer = 1,
    DISPID_SRCAudioInInterferenceStatus = 2,
    DISPID_SRCRequestedUIType = 3,
    DISPID_SRCVoice = 4,
    DISPID_SRAllowVoiceFormatMatchingOnNextSet = 5,
    DISPID_SRCVoicePurgeEvent = 6,
    DISPID_SRCEventInterests = 7,
    DISPID_SRCCmdMaxAlternates = 8,
    DISPID_SRCState = 9,
    DISPID_SRCRetainedAudio = 10,
    DISPID_SRCRetainedAudioFormat = 11,
    DISPID_SRCPause = 12,
    DISPID_SRCResume = 13,
    DISPID_SRCCreateGrammar = 14,
    DISPID_SRCCreateResultFromMemory = 15,
    DISPID_SRCBookmark = 16,
    DISPID_SRCSetAdaptationData = 17
} DISPID_SpeechRecoContext;
typedef enum SpeechRetainedAudioOptions {
    SRAONone = SPAO_NONE,
    SRAORetainAudio = SPAO_RETAIN_AUDIO
} SpeechRetainedAudioOptions;
typedef enum SpeechBookmarkOptions {
    SBONone = SPBO_NONE,
    SBOPause = SPBO_PAUSE
} SpeechBookmarkOptions;
typedef enum SpeechInterference {
    SINone = SPINTERFERENCE_NONE,
    SINoise = SPINTERFERENCE_NOISE,
    SINoSignal = SPINTERFERENCE_NOSIGNAL,
    SITooLoud = SPINTERFERENCE_TOOLOUD,
    SITooQuiet = SPINTERFERENCE_TOOQUIET,
    SITooFast = SPINTERFERENCE_TOOFAST,
    SITooSlow = SPINTERFERENCE_TOOSLOW
} SpeechInterference;
typedef enum SpeechRecoEvents {
    SREStreamEnd = 0x1,
    SRESoundStart = 0x2,
    SRESoundEnd = 0x4,
    SREPhraseStart = 0x8,
    SRERecognition = 0x10,
    SREHypothesis = 0x20,
    SREBookmark = 0x40,
    SREPropertyNumChange = 0x80,
    SREPropertyStringChange = 0x100,
    SREFalseRecognition = 0x200,
    SREInterference = 0x400,
    SRERequestUI = 0x800,
    SREStateChange = 0x1000,
    SREAdaptation = 0x2000,
    SREStreamStart = 0x4000,
    SRERecoOtherContext = 0x8000,
    SREAudioLevel = 0x10000,
    SREPrivate = 0x40000,
    SREAllEvents = 0x5ffff
} SpeechRecoEvents;
typedef enum SpeechRecoContextState {
    SRCS_Disabled = SPCS_DISABLED,
    SRCS_Enabled = SPCS_ENABLED
} SpeechRecoContextState;
typedef enum DISPIDSPRG {
    DISPID_SRGId = 1,
    DISPID_SRGRecoContext = 2,
    DISPID_SRGState = 3,
    DISPID_SRGRules = 4,
    DISPID_SRGReset = 5,
    DISPID_SRGCommit = 6,
    DISPID_SRGCmdLoadFromFile = 7,
    DISPID_SRGCmdLoadFromObject = 8,
    DISPID_SRGCmdLoadFromResource = 9,
    DISPID_SRGCmdLoadFromMemory = 10,
    DISPID_SRGCmdLoadFromProprietaryGrammar = 11,
    DISPID_SRGCmdSetRuleState = 12,
    DISPID_SRGCmdSetRuleIdState = 13,
    DISPID_SRGDictationLoad = 14,
    DISPID_SRGDictationUnload = 15,
    DISPID_SRGDictationSetState = 16,
    DISPID_SRGSetWordSequenceData = 17,
    DISPID_SRGSetTextSelection = 18,
    DISPID_SRGIsPronounceable = 19
} DISPIDSPRG;
typedef enum SpeechLoadOption {
    SLOStatic = SPLO_STATIC,
    SLODynamic = SPLO_DYNAMIC
} SpeechLoadOption;
typedef enum SpeechWordPronounceable {
    SWPUnknownWordUnpronounceable = SPWP_UNKNOWN_WORD_UNPRONOUNCEABLE,
    SWPUnknownWordPronounceable = SPWP_UNKNOWN_WORD_PRONOUNCEABLE,
    SWPKnownWordPronounceable = SPWP_KNOWN_WORD_PRONOUNCEABLE
} SpeechWordPronounceable;
typedef enum SpeechGrammarState {
    SGSEnabled = SPGS_ENABLED,
    SGSDisabled = SPGS_DISABLED,
    SGSExclusive = SPGS_EXCLUSIVE
} SpeechGrammarState;
typedef enum SpeechRuleState {
    SGDSInactive = SPRS_INACTIVE,
    SGDSActive = SPRS_ACTIVE,
    SGDSActiveWithAutoPause = SPRS_ACTIVE_WITH_AUTO_PAUSE,
    SGDSActiveUserDelimited = SPRS_ACTIVE_USER_DELIMITED
} SpeechRuleState;
typedef enum SpeechRuleAttributes {
    SRATopLevel = SPRAF_TopLevel,
    SRADefaultToActive = SPRAF_Active,
    SRAExport = SPRAF_Export,
    SRAImport = SPRAF_Import,
    SRAInterpreter = SPRAF_Interpreter,
    SRADynamic = SPRAF_Dynamic,
    SRARoot = SPRAF_Root
} SpeechRuleAttributes;
typedef enum SpeechGrammarWordType {
    SGDisplay = SPWT_DISPLAY,
    SGLexical = SPWT_LEXICAL,
    SGPronounciation = SPWT_PRONUNCIATION,
    SGLexicalNoSpecialChars = SPWT_LEXICAL_NO_SPECIAL_CHARS
} SpeechGrammarWordType;
typedef enum DISPID_SpeechRecoContextEvents {
    DISPID_SRCEStartStream = 1,
    DISPID_SRCEEndStream = 2,
    DISPID_SRCEBookmark = 3,
    DISPID_SRCESoundStart = 4,
    DISPID_SRCESoundEnd = 5,
    DISPID_SRCEPhraseStart = 6,
    DISPID_SRCERecognition = 7,
    DISPID_SRCEHypothesis = 8,
    DISPID_SRCEPropertyNumberChange = 9,
    DISPID_SRCEPropertyStringChange = 10,
    DISPID_SRCEFalseRecognition = 11,
    DISPID_SRCEInterference = 12,
    DISPID_SRCERequestUI = 13,
    DISPID_SRCERecognizerStateChange = 14,
    DISPID_SRCEAdaptation = 15,
    DISPID_SRCERecognitionForOtherContext = 16,
    DISPID_SRCEAudioLevel = 17,
    DISPID_SRCEEnginePrivate = 18
} DISPID_SpeechRecoContextEvents;
typedef enum SpeechRecognitionType {
    SRTStandard = 0,
    SRTAutopause = SPREF_AutoPause,
    SRTEmulated = SPREF_Emulated,
    SRTSMLTimeout = SPREF_SMLTimeout,
    SRTExtendableParse = SPREF_ExtendableParse,
    SRTReSent = SPREF_ReSent
} SpeechRecognitionType;
typedef enum DISPID_SpeechGrammarRule {
    DISPID_SGRAttributes = 1,
    DISPID_SGRInitialState = 2,
    DISPID_SGRName = 3,
    DISPID_SGRId = 4,
    DISPID_SGRClear = 5,
    DISPID_SGRAddResource = 6,
    DISPID_SGRAddState = 7
} DISPID_SpeechGrammarRule;
typedef enum DISPID_SpeechGrammarRules {
    DISPID_SGRsCount = 1,
    DISPID_SGRsDynamic = 2,
    DISPID_SGRsAdd = 3,
    DISPID_SGRsCommit = 4,
    DISPID_SGRsCommitAndSave = 5,
    DISPID_SGRsFindRule = 6,
    DISPID_SGRsItem = DISPID_VALUE,
    DISPID_SGRs_NewEnum = DISPID_NEWENUM
} DISPID_SpeechGrammarRules;
typedef enum DISPID_SpeechGrammarRuleState {
    DISPID_SGRSRule = 1,
    DISPID_SGRSTransitions = 2,
    DISPID_SGRSAddWordTransition = 3,
    DISPID_SGRSAddRuleTransition = 4,
    DISPID_SGRSAddSpecialTransition = 5
} DISPID_SpeechGrammarRuleState;
typedef enum SpeechSpecialTransitionType {
    SSTTWildcard = 1,
    SSTTDictation = 2,
    SSTTTextBuffer = 3
} SpeechSpecialTransitionType;
typedef enum DISPID_SpeechGrammarRuleStateTransitions {
    DISPID_SGRSTsCount = 1,
    DISPID_SGRSTsItem = DISPID_VALUE,
    DISPID_SGRSTs_NewEnum = DISPID_NEWENUM
} DISPID_SpeechGrammarRuleStateTransitions;
typedef enum DISPID_SpeechGrammarRuleStateTransition {
    DISPID_SGRSTType = 1,
    DISPID_SGRSTText = 2,
    DISPID_SGRSTRule = 3,
    DISPID_SGRSTWeight = 4,
    DISPID_SGRSTPropertyName = 5,
    DISPID_SGRSTPropertyId = 6,
    DISPID_SGRSTPropertyValue = 7,
    DISPID_SGRSTNextState = 8
} DISPID_SpeechGrammarRuleStateTransition;
typedef enum SpeechGrammarRuleStateTransitionType {
    SGRSTTEpsilon = 0,
    SGRSTTWord = 1,
    SGRSTTRule = 2,
    SGRSTTDictation = 3,
    SGRSTTWildcard = 4,
    SGRSTTTextBuffer = 5
} SpeechGrammarRuleStateTransitionType;
typedef enum DISPIDSPTSI {
    DISPIDSPTSI_ActiveOffset = 1,
    DISPIDSPTSI_ActiveLength = 2,
    DISPIDSPTSI_SelectionOffset = 3,
    DISPIDSPTSI_SelectionLength = 4
} DISPIDSPTSI;
typedef enum DISPID_SpeechRecoResult {
    DISPID_SRRRecoContext = 1,
    DISPID_SRRTimes = 2,
    DISPID_SRRAudioFormat = 3,
    DISPID_SRRPhraseInfo = 4,
    DISPID_SRRAlternates = 5,
    DISPID_SRRAudio = 6,
    DISPID_SRRSpeakAudio = 7,
    DISPID_SRRSaveToMemory = 8,
    DISPID_SRRDiscardResultInfo = 9
} DISPID_SpeechRecoResult;
typedef enum SpeechDiscardType {
    SDTProperty = SPDF_PROPERTY,
    SDTReplacement = SPDF_REPLACEMENT,
    SDTRule = SPDF_RULE,
    SDTDisplayText = SPDF_DISPLAYTEXT,
    SDTLexicalForm = SPDF_LEXICALFORM,
    SDTPronunciation = SPDF_PRONUNCIATION,
    SDTAudio = SPDF_AUDIO,
    SDTAlternates = SPDF_ALTERNATES,
    SDTAll = SPDF_ALL
} SpeechDiscardType;
typedef enum SpeechEmulationCompareFlags {
    SECFIgnoreCase = 0x1,
    SECFIgnoreKanaType = 0x10000,
    SECFIgnoreWidth = 0x20000,
    SECFNoSpecialChars = 0x20000000,
    SECFEmulateResult = 0x40000000,
    SECFDefault = (SECFIgnoreCase | SECFIgnoreKanaType) | SECFIgnoreWidth
} SpeechEmulationCompareFlags;
typedef enum DISPID_SpeechXMLRecoResult {
    DISPID_SRRGetXMLResult = DISPID_SRRDiscardResultInfo + 1,
    DISPID_SRRGetXMLErrorInfo = DISPID_SRRGetXMLResult + 1
} DISPID_SpeechXMLRecoResult;
typedef enum DISPID_SpeechRecoResult2 {
    DISPID_SRRSetTextFeedback = DISPID_SRRGetXMLErrorInfo + 1
} DISPID_SpeechRecoResult2;
typedef enum DISPID_SpeechPhraseBuilder {
    DISPID_SPPBRestorePhraseFromMemory = 1
} DISPID_SpeechPhraseBuilder;
typedef enum DISPID_SpeechRecoResultTimes {
    DISPID_SRRTStreamTime = 1,
    DISPID_SRRTLength = 2,
    DISPID_SRRTTickCount = 3,
    DISPID_SRRTOffsetFromStart = 4
} DISPID_SpeechRecoResultTimes;
typedef enum DISPID_SpeechPhraseAlternate {
    DISPID_SPARecoResult = 1,
    DISPID_SPAStartElementInResult = 2,
    DISPID_SPANumberOfElementsInResult = 3,
    DISPID_SPAPhraseInfo = 4,
    DISPID_SPACommit = 5
} DISPID_SpeechPhraseAlternate;
typedef enum DISPID_SpeechPhraseAlternates {
    DISPID_SPAsCount = 1,
    DISPID_SPAsItem = DISPID_VALUE,
    DISPID_SPAs_NewEnum = DISPID_NEWENUM
} DISPID_SpeechPhraseAlternates;
typedef enum DISPID_SpeechPhraseInfo {
    DISPID_SPILanguageId = 1,
    DISPID_SPIGrammarId = 2,
    DISPID_SPIStartTime = 3,
    DISPID_SPIAudioStreamPosition = 4,
    DISPID_SPIAudioSizeBytes = 5,
    DISPID_SPIRetainedSizeBytes = 6,
    DISPID_SPIAudioSizeTime = 7,
    DISPID_SPIRule = 8,
    DISPID_SPIProperties = 9,
    DISPID_SPIElements = 10,
    DISPID_SPIReplacements = 11,
    DISPID_SPIEngineId = 12,
    DISPID_SPIEnginePrivateData = 13,
    DISPID_SPISaveToMemory = 14,
    DISPID_SPIGetText = 15,
    DISPID_SPIGetDisplayAttributes = 16
} DISPID_SpeechPhraseInfo;
typedef enum DISPID_SpeechPhraseElement {
    DISPID_SPEAudioTimeOffset = 1,
    DISPID_SPEAudioSizeTime = 2,
    DISPID_SPEAudioStreamOffset = 3,
    DISPID_SPEAudioSizeBytes = 4,
    DISPID_SPERetainedStreamOffset = 5,
    DISPID_SPERetainedSizeBytes = 6,
    DISPID_SPEDisplayText = 7,
    DISPID_SPELexicalForm = 8,
    DISPID_SPEPronunciation = 9,
    DISPID_SPEDisplayAttributes = 10,
    DISPID_SPERequiredConfidence = 11,
    DISPID_SPEActualConfidence = 12,
    DISPID_SPEEngineConfidence = 13
} DISPID_SpeechPhraseElement;
typedef enum SpeechEngineConfidence {
    SECLowConfidence = -1,
    SECNormalConfidence = 0,
    SECHighConfidence = 1
} SpeechEngineConfidence;
typedef enum DISPID_SpeechPhraseElements {
    DISPID_SPEsCount = 1,
    DISPID_SPEsItem = DISPID_VALUE,
    DISPID_SPEs_NewEnum = DISPID_NEWENUM
} DISPID_SpeechPhraseElements;
typedef enum DISPID_SpeechPhraseReplacement {
    DISPID_SPRDisplayAttributes = 1,
    DISPID_SPRText = 2,
    DISPID_SPRFirstElement = 3,
    DISPID_SPRNumberOfElements = 4
} DISPID_SpeechPhraseReplacement;
typedef enum DISPID_SpeechPhraseReplacements {
    DISPID_SPRsCount = 1,
    DISPID_SPRsItem = DISPID_VALUE,
    DISPID_SPRs_NewEnum = DISPID_NEWENUM
} DISPID_SpeechPhraseReplacements;
typedef enum DISPID_SpeechPhraseProperty {
    DISPID_SPPName = 1,
    DISPID_SPPId = 2,
    DISPID_SPPValue = 3,
    DISPID_SPPFirstElement = 4,
    DISPID_SPPNumberOfElements = 5,
    DISPID_SPPEngineConfidence = 6,
    DISPID_SPPConfidence = 7,
    DISPID_SPPParent = 8,
    DISPID_SPPChildren = 9
} DISPID_SpeechPhraseProperty;
typedef enum DISPID_SpeechPhraseProperties {
    DISPID_SPPsCount = 1,
    DISPID_SPPsItem = DISPID_VALUE,
    DISPID_SPPs_NewEnum = DISPID_NEWENUM
} DISPID_SpeechPhraseProperties;
typedef enum DISPID_SpeechPhraseRule {
    DISPID_SPRuleName = 1,
    DISPID_SPRuleId = 2,
    DISPID_SPRuleFirstElement = 3,
    DISPID_SPRuleNumberOfElements = 4,
    DISPID_SPRuleParent = 5,
    DISPID_SPRuleChildren = 6,
    DISPID_SPRuleConfidence = 7,
    DISPID_SPRuleEngineConfidence = 8
} DISPID_SpeechPhraseRule;
typedef enum DISPID_SpeechPhraseRules {
    DISPID_SPRulesCount = 1,
    DISPID_SPRulesItem = DISPID_VALUE,
    DISPID_SPRules_NewEnum = DISPID_NEWENUM
} DISPID_SpeechPhraseRules;
typedef enum DISPID_SpeechLexicon {
    DISPID_SLGenerationId = 1,
    DISPID_SLGetWords = 2,
    DISPID_SLAddPronunciation = 3,
    DISPID_SLAddPronunciationByPhoneIds = 4,
    DISPID_SLRemovePronunciation = 5,
    DISPID_SLRemovePronunciationByPhoneIds = 6,
    DISPID_SLGetPronunciations = 7,
    DISPID_SLGetGenerationChange = 8
} DISPID_SpeechLexicon;
typedef enum SpeechLexiconType {
    SLTUser = eLEXTYPE_USER,
    SLTApp = eLEXTYPE_APP
} SpeechLexiconType;
typedef enum SpeechPartOfSpeech {
    SPSNotOverriden = SPPS_NotOverriden,
    SPSUnknown = SPPS_Unknown,
    SPSNoun = SPPS_Noun,
    SPSVerb = SPPS_Verb,
    SPSModifier = SPPS_Modifier,
    SPSFunction = SPPS_Function,
    SPSInterjection = SPPS_Interjection,
    SPSLMA = SPPS_LMA,
    SPSSuppressWord = SPPS_SuppressWord
} SpeechPartOfSpeech;
typedef enum DISPID_SpeechLexiconWords {
    DISPID_SLWsCount = 1,
    DISPID_SLWsItem = DISPID_VALUE,
    DISPID_SLWs_NewEnum = DISPID_NEWENUM
} DISPID_SpeechLexiconWords;
typedef enum SpeechWordType {
    SWTAdded = eWORDTYPE_ADDED,
    SWTDeleted = eWORDTYPE_DELETED
} SpeechWordType;
typedef enum DISPID_SpeechLexiconWord {
    DISPID_SLWLangId = 1,
    DISPID_SLWType = 2,
    DISPID_SLWWord = 3,
    DISPID_SLWPronunciations = 4
} DISPID_SpeechLexiconWord;
typedef enum DISPID_SpeechLexiconProns {
    DISPID_SLPsCount = 1,
    DISPID_SLPsItem = DISPID_VALUE,
    DISPID_SLPs_NewEnum = DISPID_NEWENUM
} DISPID_SpeechLexiconProns;
typedef enum DISPID_SpeechLexiconPronunciation {
    DISPID_SLPType = 1,
    DISPID_SLPLangId = 2,
    DISPID_SLPPartOfSpeech = 3,
    DISPID_SLPPhoneIds = 4,
    DISPID_SLPSymbolic = 5
} DISPID_SpeechLexiconPronunciation;
typedef enum DISPID_SpeechPhoneConverter {
    DISPID_SPCLangId = 1,
    DISPID_SPCPhoneToId = 2,
    DISPID_SPCIdToPhone = 3
} DISPID_SpeechPhoneConverter;
/*****************************************************************************
 * _ISpeechVoiceEvents dispinterface
 */
#ifndef ___ISpeechVoiceEvents_DISPINTERFACE_DEFINED__
#define ___ISpeechVoiceEvents_DISPINTERFACE_DEFINED__

DEFINE_GUID(DIID__ISpeechVoiceEvents, 0xa372acd1, 0x3bef, 0x4bbd, 0x8f,0xfb, 0xcb,0x3e,0x2b,0x41,0x6a,0xf8);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("a372acd1-3bef-4bbd-8ffb-cb3e2b416af8")
_ISpeechVoiceEvents : public IDispatch
{
};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(_ISpeechVoiceEvents, 0xa372acd1, 0x3bef, 0x4bbd, 0x8f,0xfb, 0xcb,0x3e,0x2b,0x41,0x6a,0xf8)
#endif
#else
typedef struct _ISpeechVoiceEventsVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        _ISpeechVoiceEvents *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        _ISpeechVoiceEvents *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        _ISpeechVoiceEvents *This);

    /*** IDispatch methods ***/
    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
        _ISpeechVoiceEvents *This,
        UINT *pctinfo);

    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
        _ISpeechVoiceEvents *This,
        UINT iTInfo,
        LCID lcid,
        ITypeInfo **ppTInfo);

    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
        _ISpeechVoiceEvents *This,
        REFIID riid,
        LPOLESTR *rgszNames,
        UINT cNames,
        LCID lcid,
        DISPID *rgDispId);

    HRESULT (STDMETHODCALLTYPE *Invoke)(
        _ISpeechVoiceEvents *This,
        DISPID dispIdMember,
        REFIID riid,
        LCID lcid,
        WORD wFlags,
        DISPPARAMS *pDispParams,
        VARIANT *pVarResult,
        EXCEPINFO *pExcepInfo,
        UINT *puArgErr);

    END_INTERFACE
} _ISpeechVoiceEventsVtbl;

interface _ISpeechVoiceEvents {
    CONST_VTBL _ISpeechVoiceEventsVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define _ISpeechVoiceEvents_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define _ISpeechVoiceEvents_AddRef(This) (This)->lpVtbl->AddRef(This)
#define _ISpeechVoiceEvents_Release(This) (This)->lpVtbl->Release(This)
/*** IDispatch methods ***/
#define _ISpeechVoiceEvents_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
#define _ISpeechVoiceEvents_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
#define _ISpeechVoiceEvents_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
#define _ISpeechVoiceEvents_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT _ISpeechVoiceEvents_QueryInterface(_ISpeechVoiceEvents* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG _ISpeechVoiceEvents_AddRef(_ISpeechVoiceEvents* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG _ISpeechVoiceEvents_Release(_ISpeechVoiceEvents* This) {
    return This->lpVtbl->Release(This);
}
/*** IDispatch methods ***/
static FORCEINLINE HRESULT _ISpeechVoiceEvents_GetTypeInfoCount(_ISpeechVoiceEvents* This,UINT *pctinfo) {
    return This->lpVtbl->GetTypeInfoCount(This,pctinfo);
}
static FORCEINLINE HRESULT _ISpeechVoiceEvents_GetTypeInfo(_ISpeechVoiceEvents* This,UINT iTInfo,LCID lcid,ITypeInfo **ppTInfo) {
    return This->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo);
}
static FORCEINLINE HRESULT _ISpeechVoiceEvents_GetIDsOfNames(_ISpeechVoiceEvents* This,REFIID riid,LPOLESTR *rgszNames,UINT cNames,LCID lcid,DISPID *rgDispId) {
    return This->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId);
}
static FORCEINLINE HRESULT _ISpeechVoiceEvents_Invoke(_ISpeechVoiceEvents* This,DISPID dispIdMember,REFIID riid,LCID lcid,WORD wFlags,DISPPARAMS *pDispParams,VARIANT *pVarResult,EXCEPINFO *pExcepInfo,UINT *puArgErr) {
    return This->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr);
}
#endif
#endif

#endif

#endif  /* ___ISpeechVoiceEvents_DISPINTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpeechRecognizer interface
 */
#ifndef __ISpeechRecognizer_INTERFACE_DEFINED__
#define __ISpeechRecognizer_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpeechRecognizer, 0x2d5f1c0c, 0xbd75, 0x4b08, 0x94,0x78, 0x3b,0x11,0xfe,0xa2,0x58,0x6c);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("2d5f1c0c-bd75-4b08-9478-3b11fea2586c")
ISpeechRecognizer : public IDispatch
{
    virtual HRESULT STDMETHODCALLTYPE putref_Recognizer(
        ISpeechObjectToken *Recognizer) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_Recognizer(
        ISpeechObjectToken **Recognizer) = 0;

    virtual HRESULT STDMETHODCALLTYPE put_AllowAudioInputFormatChangesOnNextSet(
        VARIANT_BOOL Allow) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_AllowAudioInputFormatChangesOnNextSet(
        VARIANT_BOOL *Allow) = 0;

    virtual HRESULT STDMETHODCALLTYPE putref_AudioInput(
        ISpeechObjectToken *AudioInput = 0) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_AudioInput(
        ISpeechObjectToken **AudioInput) = 0;

    virtual HRESULT STDMETHODCALLTYPE putref_AudioInputStream(
        ISpeechBaseStream *AudioInputStream = 0) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_AudioInputStream(
        ISpeechBaseStream **AudioInputStream) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_IsShared(
        VARIANT_BOOL *Shared) = 0;

    virtual HRESULT STDMETHODCALLTYPE put_State(
        SpeechRecognizerState State) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_State(
        SpeechRecognizerState *State) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_Status(
        ISpeechRecognizerStatus **Status) = 0;

    virtual HRESULT STDMETHODCALLTYPE putref_Profile(
        ISpeechObjectToken *Profile = 0) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_Profile(
        ISpeechObjectToken **Profile) = 0;

    virtual HRESULT STDMETHODCALLTYPE EmulateRecognition(
        VARIANT TextElements,
        VARIANT *ElementDisplayAttributes = 0,
        LONG LanguageId = 0) = 0;

    virtual HRESULT STDMETHODCALLTYPE CreateRecoContext(
        ISpeechRecoContext **NewContext) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetFormat(
        SpeechFormatType Type,
        ISpeechAudioFormat **Format) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetPropertyNumber(
        const BSTR Name,
        LONG Value,
        VARIANT_BOOL *Supported) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetPropertyNumber(
        const BSTR Name,
        LONG *Value,
        VARIANT_BOOL *Supported) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetPropertyString(
        const BSTR Name,
        const BSTR Value,
        VARIANT_BOOL *Supported) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetPropertyString(
        const BSTR Name,
        BSTR *Value,
        VARIANT_BOOL *Supported) = 0;

    virtual HRESULT STDMETHODCALLTYPE IsUISupported(
        const BSTR TypeOfUI,
        const VARIANT *ExtraData,
        VARIANT_BOOL *Supported) = 0;

    virtual HRESULT STDMETHODCALLTYPE DisplayUI(
        LONG hWndParent,
        BSTR Title,
        const BSTR TypeOfUI,
        const VARIANT *ExtraData = 0) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetRecognizers(
        BSTR RequiredAttributes,
        BSTR OptionalAttributes,
        ISpeechObjectTokens **ObjectTokens) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetAudioInputs(
        BSTR RequiredAttributes,
        BSTR OptionalAttributes,
        ISpeechObjectTokens **ObjectTokens) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetProfiles(
        BSTR RequiredAttributes,
        BSTR OptionalAttributes,
        ISpeechObjectTokens **ObjectTokens) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpeechRecognizer, 0x2d5f1c0c, 0xbd75, 0x4b08, 0x94,0x78, 0x3b,0x11,0xfe,0xa2,0x58,0x6c)
#endif
#else
typedef struct ISpeechRecognizerVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpeechRecognizer *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpeechRecognizer *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpeechRecognizer *This);

    /*** IDispatch methods ***/
    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
        ISpeechRecognizer *This,
        UINT *pctinfo);

    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
        ISpeechRecognizer *This,
        UINT iTInfo,
        LCID lcid,
        ITypeInfo **ppTInfo);

    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
        ISpeechRecognizer *This,
        REFIID riid,
        LPOLESTR *rgszNames,
        UINT cNames,
        LCID lcid,
        DISPID *rgDispId);

    HRESULT (STDMETHODCALLTYPE *Invoke)(
        ISpeechRecognizer *This,
        DISPID dispIdMember,
        REFIID riid,
        LCID lcid,
        WORD wFlags,
        DISPPARAMS *pDispParams,
        VARIANT *pVarResult,
        EXCEPINFO *pExcepInfo,
        UINT *puArgErr);

    /*** ISpeechRecognizer methods ***/
    HRESULT (STDMETHODCALLTYPE *putref_Recognizer)(
        ISpeechRecognizer *This,
        ISpeechObjectToken *Recognizer);

    HRESULT (STDMETHODCALLTYPE *get_Recognizer)(
        ISpeechRecognizer *This,
        ISpeechObjectToken **Recognizer);

    HRESULT (STDMETHODCALLTYPE *put_AllowAudioInputFormatChangesOnNextSet)(
        ISpeechRecognizer *This,
        VARIANT_BOOL Allow);

    HRESULT (STDMETHODCALLTYPE *get_AllowAudioInputFormatChangesOnNextSet)(
        ISpeechRecognizer *This,
        VARIANT_BOOL *Allow);

    HRESULT (STDMETHODCALLTYPE *putref_AudioInput)(
        ISpeechRecognizer *This,
        ISpeechObjectToken *AudioInput);

    HRESULT (STDMETHODCALLTYPE *get_AudioInput)(
        ISpeechRecognizer *This,
        ISpeechObjectToken **AudioInput);

    HRESULT (STDMETHODCALLTYPE *putref_AudioInputStream)(
        ISpeechRecognizer *This,
        ISpeechBaseStream *AudioInputStream);

    HRESULT (STDMETHODCALLTYPE *get_AudioInputStream)(
        ISpeechRecognizer *This,
        ISpeechBaseStream **AudioInputStream);

    HRESULT (STDMETHODCALLTYPE *get_IsShared)(
        ISpeechRecognizer *This,
        VARIANT_BOOL *Shared);

    HRESULT (STDMETHODCALLTYPE *put_State)(
        ISpeechRecognizer *This,
        SpeechRecognizerState State);

    HRESULT (STDMETHODCALLTYPE *get_State)(
        ISpeechRecognizer *This,
        SpeechRecognizerState *State);

    HRESULT (STDMETHODCALLTYPE *get_Status)(
        ISpeechRecognizer *This,
        ISpeechRecognizerStatus **Status);

    HRESULT (STDMETHODCALLTYPE *putref_Profile)(
        ISpeechRecognizer *This,
        ISpeechObjectToken *Profile);

    HRESULT (STDMETHODCALLTYPE *get_Profile)(
        ISpeechRecognizer *This,
        ISpeechObjectToken **Profile);

    HRESULT (STDMETHODCALLTYPE *EmulateRecognition)(
        ISpeechRecognizer *This,
        VARIANT TextElements,
        VARIANT *ElementDisplayAttributes,
        LONG LanguageId);

    HRESULT (STDMETHODCALLTYPE *CreateRecoContext)(
        ISpeechRecognizer *This,
        ISpeechRecoContext **NewContext);

    HRESULT (STDMETHODCALLTYPE *GetFormat)(
        ISpeechRecognizer *This,
        SpeechFormatType Type,
        ISpeechAudioFormat **Format);

    HRESULT (STDMETHODCALLTYPE *SetPropertyNumber)(
        ISpeechRecognizer *This,
        const BSTR Name,
        LONG Value,
        VARIANT_BOOL *Supported);

    HRESULT (STDMETHODCALLTYPE *GetPropertyNumber)(
        ISpeechRecognizer *This,
        const BSTR Name,
        LONG *Value,
        VARIANT_BOOL *Supported);

    HRESULT (STDMETHODCALLTYPE *SetPropertyString)(
        ISpeechRecognizer *This,
        const BSTR Name,
        const BSTR Value,
        VARIANT_BOOL *Supported);

    HRESULT (STDMETHODCALLTYPE *GetPropertyString)(
        ISpeechRecognizer *This,
        const BSTR Name,
        BSTR *Value,
        VARIANT_BOOL *Supported);

    HRESULT (STDMETHODCALLTYPE *IsUISupported)(
        ISpeechRecognizer *This,
        const BSTR TypeOfUI,
        const VARIANT *ExtraData,
        VARIANT_BOOL *Supported);

    HRESULT (STDMETHODCALLTYPE *DisplayUI)(
        ISpeechRecognizer *This,
        LONG hWndParent,
        BSTR Title,
        const BSTR TypeOfUI,
        const VARIANT *ExtraData);

    HRESULT (STDMETHODCALLTYPE *GetRecognizers)(
        ISpeechRecognizer *This,
        BSTR RequiredAttributes,
        BSTR OptionalAttributes,
        ISpeechObjectTokens **ObjectTokens);

    HRESULT (STDMETHODCALLTYPE *GetAudioInputs)(
        ISpeechRecognizer *This,
        BSTR RequiredAttributes,
        BSTR OptionalAttributes,
        ISpeechObjectTokens **ObjectTokens);

    HRESULT (STDMETHODCALLTYPE *GetProfiles)(
        ISpeechRecognizer *This,
        BSTR RequiredAttributes,
        BSTR OptionalAttributes,
        ISpeechObjectTokens **ObjectTokens);

    END_INTERFACE
} ISpeechRecognizerVtbl;

interface ISpeechRecognizer {
    CONST_VTBL ISpeechRecognizerVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpeechRecognizer_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpeechRecognizer_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpeechRecognizer_Release(This) (This)->lpVtbl->Release(This)
/*** IDispatch methods ***/
#define ISpeechRecognizer_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
#define ISpeechRecognizer_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
#define ISpeechRecognizer_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
#define ISpeechRecognizer_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
/*** ISpeechRecognizer methods ***/
#define ISpeechRecognizer_putref_Recognizer(This,Recognizer) (This)->lpVtbl->putref_Recognizer(This,Recognizer)
#define ISpeechRecognizer_get_Recognizer(This,Recognizer) (This)->lpVtbl->get_Recognizer(This,Recognizer)
#define ISpeechRecognizer_put_AllowAudioInputFormatChangesOnNextSet(This,Allow) (This)->lpVtbl->put_AllowAudioInputFormatChangesOnNextSet(This,Allow)
#define ISpeechRecognizer_get_AllowAudioInputFormatChangesOnNextSet(This,Allow) (This)->lpVtbl->get_AllowAudioInputFormatChangesOnNextSet(This,Allow)
#define ISpeechRecognizer_putref_AudioInput(This,AudioInput) (This)->lpVtbl->putref_AudioInput(This,AudioInput)
#define ISpeechRecognizer_get_AudioInput(This,AudioInput) (This)->lpVtbl->get_AudioInput(This,AudioInput)
#define ISpeechRecognizer_putref_AudioInputStream(This,AudioInputStream) (This)->lpVtbl->putref_AudioInputStream(This,AudioInputStream)
#define ISpeechRecognizer_get_AudioInputStream(This,AudioInputStream) (This)->lpVtbl->get_AudioInputStream(This,AudioInputStream)
#define ISpeechRecognizer_get_IsShared(This,Shared) (This)->lpVtbl->get_IsShared(This,Shared)
#define ISpeechRecognizer_put_State(This,State) (This)->lpVtbl->put_State(This,State)
#define ISpeechRecognizer_get_State(This,State) (This)->lpVtbl->get_State(This,State)
#define ISpeechRecognizer_get_Status(This,Status) (This)->lpVtbl->get_Status(This,Status)
#define ISpeechRecognizer_putref_Profile(This,Profile) (This)->lpVtbl->putref_Profile(This,Profile)
#define ISpeechRecognizer_get_Profile(This,Profile) (This)->lpVtbl->get_Profile(This,Profile)
#define ISpeechRecognizer_EmulateRecognition(This,TextElements,ElementDisplayAttributes,LanguageId) (This)->lpVtbl->EmulateRecognition(This,TextElements,ElementDisplayAttributes,LanguageId)
#define ISpeechRecognizer_CreateRecoContext(This,NewContext) (This)->lpVtbl->CreateRecoContext(This,NewContext)
#define ISpeechRecognizer_GetFormat(This,Type,Format) (This)->lpVtbl->GetFormat(This,Type,Format)
#define ISpeechRecognizer_SetPropertyNumber(This,Name,Value,Supported) (This)->lpVtbl->SetPropertyNumber(This,Name,Value,Supported)
#define ISpeechRecognizer_GetPropertyNumber(This,Name,Value,Supported) (This)->lpVtbl->GetPropertyNumber(This,Name,Value,Supported)
#define ISpeechRecognizer_SetPropertyString(This,Name,Value,Supported) (This)->lpVtbl->SetPropertyString(This,Name,Value,Supported)
#define ISpeechRecognizer_GetPropertyString(This,Name,Value,Supported) (This)->lpVtbl->GetPropertyString(This,Name,Value,Supported)
#define ISpeechRecognizer_IsUISupported(This,TypeOfUI,ExtraData,Supported) (This)->lpVtbl->IsUISupported(This,TypeOfUI,ExtraData,Supported)
#define ISpeechRecognizer_DisplayUI(This,hWndParent,Title,TypeOfUI,ExtraData) (This)->lpVtbl->DisplayUI(This,hWndParent,Title,TypeOfUI,ExtraData)
#define ISpeechRecognizer_GetRecognizers(This,RequiredAttributes,OptionalAttributes,ObjectTokens) (This)->lpVtbl->GetRecognizers(This,RequiredAttributes,OptionalAttributes,ObjectTokens)
#define ISpeechRecognizer_GetAudioInputs(This,RequiredAttributes,OptionalAttributes,ObjectTokens) (This)->lpVtbl->GetAudioInputs(This,RequiredAttributes,OptionalAttributes,ObjectTokens)
#define ISpeechRecognizer_GetProfiles(This,RequiredAttributes,OptionalAttributes,ObjectTokens) (This)->lpVtbl->GetProfiles(This,RequiredAttributes,OptionalAttributes,ObjectTokens)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpeechRecognizer_QueryInterface(ISpeechRecognizer* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpeechRecognizer_AddRef(ISpeechRecognizer* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpeechRecognizer_Release(ISpeechRecognizer* This) {
    return This->lpVtbl->Release(This);
}
/*** IDispatch methods ***/
static FORCEINLINE HRESULT ISpeechRecognizer_GetTypeInfoCount(ISpeechRecognizer* This,UINT *pctinfo) {
    return This->lpVtbl->GetTypeInfoCount(This,pctinfo);
}
static FORCEINLINE HRESULT ISpeechRecognizer_GetTypeInfo(ISpeechRecognizer* This,UINT iTInfo,LCID lcid,ITypeInfo **ppTInfo) {
    return This->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo);
}
static FORCEINLINE HRESULT ISpeechRecognizer_GetIDsOfNames(ISpeechRecognizer* This,REFIID riid,LPOLESTR *rgszNames,UINT cNames,LCID lcid,DISPID *rgDispId) {
    return This->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId);
}
static FORCEINLINE HRESULT ISpeechRecognizer_Invoke(ISpeechRecognizer* This,DISPID dispIdMember,REFIID riid,LCID lcid,WORD wFlags,DISPPARAMS *pDispParams,VARIANT *pVarResult,EXCEPINFO *pExcepInfo,UINT *puArgErr) {
    return This->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr);
}
/*** ISpeechRecognizer methods ***/
static FORCEINLINE HRESULT ISpeechRecognizer_putref_Recognizer(ISpeechRecognizer* This,ISpeechObjectToken *Recognizer) {
    return This->lpVtbl->putref_Recognizer(This,Recognizer);
}
static FORCEINLINE HRESULT ISpeechRecognizer_get_Recognizer(ISpeechRecognizer* This,ISpeechObjectToken **Recognizer) {
    return This->lpVtbl->get_Recognizer(This,Recognizer);
}
static FORCEINLINE HRESULT ISpeechRecognizer_put_AllowAudioInputFormatChangesOnNextSet(ISpeechRecognizer* This,VARIANT_BOOL Allow) {
    return This->lpVtbl->put_AllowAudioInputFormatChangesOnNextSet(This,Allow);
}
static FORCEINLINE HRESULT ISpeechRecognizer_get_AllowAudioInputFormatChangesOnNextSet(ISpeechRecognizer* This,VARIANT_BOOL *Allow) {
    return This->lpVtbl->get_AllowAudioInputFormatChangesOnNextSet(This,Allow);
}
static FORCEINLINE HRESULT ISpeechRecognizer_putref_AudioInput(ISpeechRecognizer* This,ISpeechObjectToken *AudioInput) {
    return This->lpVtbl->putref_AudioInput(This,AudioInput);
}
static FORCEINLINE HRESULT ISpeechRecognizer_get_AudioInput(ISpeechRecognizer* This,ISpeechObjectToken **AudioInput) {
    return This->lpVtbl->get_AudioInput(This,AudioInput);
}
static FORCEINLINE HRESULT ISpeechRecognizer_putref_AudioInputStream(ISpeechRecognizer* This,ISpeechBaseStream *AudioInputStream) {
    return This->lpVtbl->putref_AudioInputStream(This,AudioInputStream);
}
static FORCEINLINE HRESULT ISpeechRecognizer_get_AudioInputStream(ISpeechRecognizer* This,ISpeechBaseStream **AudioInputStream) {
    return This->lpVtbl->get_AudioInputStream(This,AudioInputStream);
}
static FORCEINLINE HRESULT ISpeechRecognizer_get_IsShared(ISpeechRecognizer* This,VARIANT_BOOL *Shared) {
    return This->lpVtbl->get_IsShared(This,Shared);
}
static FORCEINLINE HRESULT ISpeechRecognizer_put_State(ISpeechRecognizer* This,SpeechRecognizerState State) {
    return This->lpVtbl->put_State(This,State);
}
static FORCEINLINE HRESULT ISpeechRecognizer_get_State(ISpeechRecognizer* This,SpeechRecognizerState *State) {
    return This->lpVtbl->get_State(This,State);
}
static FORCEINLINE HRESULT ISpeechRecognizer_get_Status(ISpeechRecognizer* This,ISpeechRecognizerStatus **Status) {
    return This->lpVtbl->get_Status(This,Status);
}
static FORCEINLINE HRESULT ISpeechRecognizer_putref_Profile(ISpeechRecognizer* This,ISpeechObjectToken *Profile) {
    return This->lpVtbl->putref_Profile(This,Profile);
}
static FORCEINLINE HRESULT ISpeechRecognizer_get_Profile(ISpeechRecognizer* This,ISpeechObjectToken **Profile) {
    return This->lpVtbl->get_Profile(This,Profile);
}
static FORCEINLINE HRESULT ISpeechRecognizer_EmulateRecognition(ISpeechRecognizer* This,VARIANT TextElements,VARIANT *ElementDisplayAttributes,LONG LanguageId) {
    return This->lpVtbl->EmulateRecognition(This,TextElements,ElementDisplayAttributes,LanguageId);
}
static FORCEINLINE HRESULT ISpeechRecognizer_CreateRecoContext(ISpeechRecognizer* This,ISpeechRecoContext **NewContext) {
    return This->lpVtbl->CreateRecoContext(This,NewContext);
}
static FORCEINLINE HRESULT ISpeechRecognizer_GetFormat(ISpeechRecognizer* This,SpeechFormatType Type,ISpeechAudioFormat **Format) {
    return This->lpVtbl->GetFormat(This,Type,Format);
}
static FORCEINLINE HRESULT ISpeechRecognizer_SetPropertyNumber(ISpeechRecognizer* This,const BSTR Name,LONG Value,VARIANT_BOOL *Supported) {
    return This->lpVtbl->SetPropertyNumber(This,Name,Value,Supported);
}
static FORCEINLINE HRESULT ISpeechRecognizer_GetPropertyNumber(ISpeechRecognizer* This,const BSTR Name,LONG *Value,VARIANT_BOOL *Supported) {
    return This->lpVtbl->GetPropertyNumber(This,Name,Value,Supported);
}
static FORCEINLINE HRESULT ISpeechRecognizer_SetPropertyString(ISpeechRecognizer* This,const BSTR Name,const BSTR Value,VARIANT_BOOL *Supported) {
    return This->lpVtbl->SetPropertyString(This,Name,Value,Supported);
}
static FORCEINLINE HRESULT ISpeechRecognizer_GetPropertyString(ISpeechRecognizer* This,const BSTR Name,BSTR *Value,VARIANT_BOOL *Supported) {
    return This->lpVtbl->GetPropertyString(This,Name,Value,Supported);
}
static FORCEINLINE HRESULT ISpeechRecognizer_IsUISupported(ISpeechRecognizer* This,const BSTR TypeOfUI,const VARIANT *ExtraData,VARIANT_BOOL *Supported) {
    return This->lpVtbl->IsUISupported(This,TypeOfUI,ExtraData,Supported);
}
static FORCEINLINE HRESULT ISpeechRecognizer_DisplayUI(ISpeechRecognizer* This,LONG hWndParent,BSTR Title,const BSTR TypeOfUI,const VARIANT *ExtraData) {
    return This->lpVtbl->DisplayUI(This,hWndParent,Title,TypeOfUI,ExtraData);
}
static FORCEINLINE HRESULT ISpeechRecognizer_GetRecognizers(ISpeechRecognizer* This,BSTR RequiredAttributes,BSTR OptionalAttributes,ISpeechObjectTokens **ObjectTokens) {
    return This->lpVtbl->GetRecognizers(This,RequiredAttributes,OptionalAttributes,ObjectTokens);
}
static FORCEINLINE HRESULT ISpeechRecognizer_GetAudioInputs(ISpeechRecognizer* This,BSTR RequiredAttributes,BSTR OptionalAttributes,ISpeechObjectTokens **ObjectTokens) {
    return This->lpVtbl->GetAudioInputs(This,RequiredAttributes,OptionalAttributes,ObjectTokens);
}
static FORCEINLINE HRESULT ISpeechRecognizer_GetProfiles(ISpeechRecognizer* This,BSTR RequiredAttributes,BSTR OptionalAttributes,ISpeechObjectTokens **ObjectTokens) {
    return This->lpVtbl->GetProfiles(This,RequiredAttributes,OptionalAttributes,ObjectTokens);
}
#endif
#endif

#endif


#endif  /* __ISpeechRecognizer_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpeechRecognizerStatus interface
 */
#ifndef __ISpeechRecognizerStatus_INTERFACE_DEFINED__
#define __ISpeechRecognizerStatus_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpeechRecognizerStatus, 0xbff9e781, 0x53ec, 0x484e, 0xbb,0x8a, 0x0e,0x1b,0x55,0x51,0xe3,0x5c);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("bff9e781-53ec-484e-bb8a-0e1b5551e35c")
ISpeechRecognizerStatus : public IDispatch
{
    virtual HRESULT STDMETHODCALLTYPE get_AudioStatus(
        ISpeechAudioStatus **AudioStatus) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_CurrentStreamPosition(
        VARIANT *pCurrentStreamPos) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_CurrentStreamNumber(
        LONG *StreamNumber) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_NumberOfActiveRules(
        LONG *NumberOfActiveRules) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_ClsidEngine(
        BSTR *ClsidEngine) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_SupportedLanguages(
        VARIANT *SupportedLanguages) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpeechRecognizerStatus, 0xbff9e781, 0x53ec, 0x484e, 0xbb,0x8a, 0x0e,0x1b,0x55,0x51,0xe3,0x5c)
#endif
#else
typedef struct ISpeechRecognizerStatusVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpeechRecognizerStatus *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpeechRecognizerStatus *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpeechRecognizerStatus *This);

    /*** IDispatch methods ***/
    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
        ISpeechRecognizerStatus *This,
        UINT *pctinfo);

    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
        ISpeechRecognizerStatus *This,
        UINT iTInfo,
        LCID lcid,
        ITypeInfo **ppTInfo);

    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
        ISpeechRecognizerStatus *This,
        REFIID riid,
        LPOLESTR *rgszNames,
        UINT cNames,
        LCID lcid,
        DISPID *rgDispId);

    HRESULT (STDMETHODCALLTYPE *Invoke)(
        ISpeechRecognizerStatus *This,
        DISPID dispIdMember,
        REFIID riid,
        LCID lcid,
        WORD wFlags,
        DISPPARAMS *pDispParams,
        VARIANT *pVarResult,
        EXCEPINFO *pExcepInfo,
        UINT *puArgErr);

    /*** ISpeechRecognizerStatus methods ***/
    HRESULT (STDMETHODCALLTYPE *get_AudioStatus)(
        ISpeechRecognizerStatus *This,
        ISpeechAudioStatus **AudioStatus);

    HRESULT (STDMETHODCALLTYPE *get_CurrentStreamPosition)(
        ISpeechRecognizerStatus *This,
        VARIANT *pCurrentStreamPos);

    HRESULT (STDMETHODCALLTYPE *get_CurrentStreamNumber)(
        ISpeechRecognizerStatus *This,
        LONG *StreamNumber);

    HRESULT (STDMETHODCALLTYPE *get_NumberOfActiveRules)(
        ISpeechRecognizerStatus *This,
        LONG *NumberOfActiveRules);

    HRESULT (STDMETHODCALLTYPE *get_ClsidEngine)(
        ISpeechRecognizerStatus *This,
        BSTR *ClsidEngine);

    HRESULT (STDMETHODCALLTYPE *get_SupportedLanguages)(
        ISpeechRecognizerStatus *This,
        VARIANT *SupportedLanguages);

    END_INTERFACE
} ISpeechRecognizerStatusVtbl;

interface ISpeechRecognizerStatus {
    CONST_VTBL ISpeechRecognizerStatusVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpeechRecognizerStatus_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpeechRecognizerStatus_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpeechRecognizerStatus_Release(This) (This)->lpVtbl->Release(This)
/*** IDispatch methods ***/
#define ISpeechRecognizerStatus_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
#define ISpeechRecognizerStatus_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
#define ISpeechRecognizerStatus_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
#define ISpeechRecognizerStatus_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
/*** ISpeechRecognizerStatus methods ***/
#define ISpeechRecognizerStatus_get_AudioStatus(This,AudioStatus) (This)->lpVtbl->get_AudioStatus(This,AudioStatus)
#define ISpeechRecognizerStatus_get_CurrentStreamPosition(This,pCurrentStreamPos) (This)->lpVtbl->get_CurrentStreamPosition(This,pCurrentStreamPos)
#define ISpeechRecognizerStatus_get_CurrentStreamNumber(This,StreamNumber) (This)->lpVtbl->get_CurrentStreamNumber(This,StreamNumber)
#define ISpeechRecognizerStatus_get_NumberOfActiveRules(This,NumberOfActiveRules) (This)->lpVtbl->get_NumberOfActiveRules(This,NumberOfActiveRules)
#define ISpeechRecognizerStatus_get_ClsidEngine(This,ClsidEngine) (This)->lpVtbl->get_ClsidEngine(This,ClsidEngine)
#define ISpeechRecognizerStatus_get_SupportedLanguages(This,SupportedLanguages) (This)->lpVtbl->get_SupportedLanguages(This,SupportedLanguages)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpeechRecognizerStatus_QueryInterface(ISpeechRecognizerStatus* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpeechRecognizerStatus_AddRef(ISpeechRecognizerStatus* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpeechRecognizerStatus_Release(ISpeechRecognizerStatus* This) {
    return This->lpVtbl->Release(This);
}
/*** IDispatch methods ***/
static FORCEINLINE HRESULT ISpeechRecognizerStatus_GetTypeInfoCount(ISpeechRecognizerStatus* This,UINT *pctinfo) {
    return This->lpVtbl->GetTypeInfoCount(This,pctinfo);
}
static FORCEINLINE HRESULT ISpeechRecognizerStatus_GetTypeInfo(ISpeechRecognizerStatus* This,UINT iTInfo,LCID lcid,ITypeInfo **ppTInfo) {
    return This->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo);
}
static FORCEINLINE HRESULT ISpeechRecognizerStatus_GetIDsOfNames(ISpeechRecognizerStatus* This,REFIID riid,LPOLESTR *rgszNames,UINT cNames,LCID lcid,DISPID *rgDispId) {
    return This->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId);
}
static FORCEINLINE HRESULT ISpeechRecognizerStatus_Invoke(ISpeechRecognizerStatus* This,DISPID dispIdMember,REFIID riid,LCID lcid,WORD wFlags,DISPPARAMS *pDispParams,VARIANT *pVarResult,EXCEPINFO *pExcepInfo,UINT *puArgErr) {
    return This->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr);
}
/*** ISpeechRecognizerStatus methods ***/
static FORCEINLINE HRESULT ISpeechRecognizerStatus_get_AudioStatus(ISpeechRecognizerStatus* This,ISpeechAudioStatus **AudioStatus) {
    return This->lpVtbl->get_AudioStatus(This,AudioStatus);
}
static FORCEINLINE HRESULT ISpeechRecognizerStatus_get_CurrentStreamPosition(ISpeechRecognizerStatus* This,VARIANT *pCurrentStreamPos) {
    return This->lpVtbl->get_CurrentStreamPosition(This,pCurrentStreamPos);
}
static FORCEINLINE HRESULT ISpeechRecognizerStatus_get_CurrentStreamNumber(ISpeechRecognizerStatus* This,LONG *StreamNumber) {
    return This->lpVtbl->get_CurrentStreamNumber(This,StreamNumber);
}
static FORCEINLINE HRESULT ISpeechRecognizerStatus_get_NumberOfActiveRules(ISpeechRecognizerStatus* This,LONG *NumberOfActiveRules) {
    return This->lpVtbl->get_NumberOfActiveRules(This,NumberOfActiveRules);
}
static FORCEINLINE HRESULT ISpeechRecognizerStatus_get_ClsidEngine(ISpeechRecognizerStatus* This,BSTR *ClsidEngine) {
    return This->lpVtbl->get_ClsidEngine(This,ClsidEngine);
}
static FORCEINLINE HRESULT ISpeechRecognizerStatus_get_SupportedLanguages(ISpeechRecognizerStatus* This,VARIANT *SupportedLanguages) {
    return This->lpVtbl->get_SupportedLanguages(This,SupportedLanguages);
}
#endif
#endif

#endif


#endif  /* __ISpeechRecognizerStatus_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpeechRecoContext interface
 */
#ifndef __ISpeechRecoContext_INTERFACE_DEFINED__
#define __ISpeechRecoContext_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpeechRecoContext, 0x580aa49d, 0x7e1e, 0x4809, 0xb8,0xe2, 0x57,0xda,0x80,0x61,0x04,0xb8);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("580aa49d-7e1e-4809-b8e2-57da806104b8")
ISpeechRecoContext : public IDispatch
{
    virtual HRESULT STDMETHODCALLTYPE get_Recognizer(
        ISpeechRecognizer **Recognizer) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_AudioInputInterferenceStatus(
        SpeechInterference *Interference) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_RequestedUIType(
        BSTR *UIType) = 0;

    virtual HRESULT STDMETHODCALLTYPE putref_Voice(
        ISpeechVoice *Voice) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_Voice(
        ISpeechVoice **Voice) = 0;

    virtual HRESULT STDMETHODCALLTYPE put_AllowVoiceFormatMatchingOnNextSet(
        VARIANT_BOOL Allow) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_AllowVoiceFormatMatchingOnNextSet(
        VARIANT_BOOL *pAllow) = 0;

    virtual HRESULT STDMETHODCALLTYPE put_VoicePurgeEvent(
        SpeechRecoEvents EventInterest) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_VoicePurgeEvent(
        SpeechRecoEvents *EventInterest) = 0;

    virtual HRESULT STDMETHODCALLTYPE put_EventInterests(
        SpeechRecoEvents EventInterest) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_EventInterests(
        SpeechRecoEvents *EventInterest) = 0;

    virtual HRESULT STDMETHODCALLTYPE put_CmdMaxAlternates(
        LONG MaxAlternates) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_CmdMaxAlternates(
        LONG *MaxAlternates) = 0;

    virtual HRESULT STDMETHODCALLTYPE put_State(
        SpeechRecoContextState State) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_State(
        SpeechRecoContextState *State) = 0;

    virtual HRESULT STDMETHODCALLTYPE put_RetainedAudio(
        SpeechRetainedAudioOptions Option) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_RetainedAudio(
        SpeechRetainedAudioOptions *Option) = 0;

    virtual HRESULT STDMETHODCALLTYPE putref_RetainedAudioFormat(
        ISpeechAudioFormat *Format) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_RetainedAudioFormat(
        ISpeechAudioFormat **Format) = 0;

    virtual HRESULT STDMETHODCALLTYPE Pause(
        ) = 0;

    virtual HRESULT STDMETHODCALLTYPE Resume(
        ) = 0;

    virtual HRESULT STDMETHODCALLTYPE CreateGrammar(
        VARIANT GrammarId,
        ISpeechRecoGrammar **Grammar) = 0;

    virtual HRESULT STDMETHODCALLTYPE CreateResultFromMemory(
        VARIANT *ResultBlock,
        ISpeechRecoResult **Result) = 0;

    virtual HRESULT STDMETHODCALLTYPE Bookmark(
        SpeechBookmarkOptions Options,
        VARIANT StreamPos,
        VARIANT BookmarkId) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetAdaptationData(
        BSTR AdaptationString) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpeechRecoContext, 0x580aa49d, 0x7e1e, 0x4809, 0xb8,0xe2, 0x57,0xda,0x80,0x61,0x04,0xb8)
#endif
#else
typedef struct ISpeechRecoContextVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpeechRecoContext *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpeechRecoContext *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpeechRecoContext *This);

    /*** IDispatch methods ***/
    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
        ISpeechRecoContext *This,
        UINT *pctinfo);

    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
        ISpeechRecoContext *This,
        UINT iTInfo,
        LCID lcid,
        ITypeInfo **ppTInfo);

    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
        ISpeechRecoContext *This,
        REFIID riid,
        LPOLESTR *rgszNames,
        UINT cNames,
        LCID lcid,
        DISPID *rgDispId);

    HRESULT (STDMETHODCALLTYPE *Invoke)(
        ISpeechRecoContext *This,
        DISPID dispIdMember,
        REFIID riid,
        LCID lcid,
        WORD wFlags,
        DISPPARAMS *pDispParams,
        VARIANT *pVarResult,
        EXCEPINFO *pExcepInfo,
        UINT *puArgErr);

    /*** ISpeechRecoContext methods ***/
    HRESULT (STDMETHODCALLTYPE *get_Recognizer)(
        ISpeechRecoContext *This,
        ISpeechRecognizer **Recognizer);

    HRESULT (STDMETHODCALLTYPE *get_AudioInputInterferenceStatus)(
        ISpeechRecoContext *This,
        SpeechInterference *Interference);

    HRESULT (STDMETHODCALLTYPE *get_RequestedUIType)(
        ISpeechRecoContext *This,
        BSTR *UIType);

    HRESULT (STDMETHODCALLTYPE *putref_Voice)(
        ISpeechRecoContext *This,
        ISpeechVoice *Voice);

    HRESULT (STDMETHODCALLTYPE *get_Voice)(
        ISpeechRecoContext *This,
        ISpeechVoice **Voice);

    HRESULT (STDMETHODCALLTYPE *put_AllowVoiceFormatMatchingOnNextSet)(
        ISpeechRecoContext *This,
        VARIANT_BOOL Allow);

    HRESULT (STDMETHODCALLTYPE *get_AllowVoiceFormatMatchingOnNextSet)(
        ISpeechRecoContext *This,
        VARIANT_BOOL *pAllow);

    HRESULT (STDMETHODCALLTYPE *put_VoicePurgeEvent)(
        ISpeechRecoContext *This,
        SpeechRecoEvents EventInterest);

    HRESULT (STDMETHODCALLTYPE *get_VoicePurgeEvent)(
        ISpeechRecoContext *This,
        SpeechRecoEvents *EventInterest);

    HRESULT (STDMETHODCALLTYPE *put_EventInterests)(
        ISpeechRecoContext *This,
        SpeechRecoEvents EventInterest);

    HRESULT (STDMETHODCALLTYPE *get_EventInterests)(
        ISpeechRecoContext *This,
        SpeechRecoEvents *EventInterest);

    HRESULT (STDMETHODCALLTYPE *put_CmdMaxAlternates)(
        ISpeechRecoContext *This,
        LONG MaxAlternates);

    HRESULT (STDMETHODCALLTYPE *get_CmdMaxAlternates)(
        ISpeechRecoContext *This,
        LONG *MaxAlternates);

    HRESULT (STDMETHODCALLTYPE *put_State)(
        ISpeechRecoContext *This,
        SpeechRecoContextState State);

    HRESULT (STDMETHODCALLTYPE *get_State)(
        ISpeechRecoContext *This,
        SpeechRecoContextState *State);

    HRESULT (STDMETHODCALLTYPE *put_RetainedAudio)(
        ISpeechRecoContext *This,
        SpeechRetainedAudioOptions Option);

    HRESULT (STDMETHODCALLTYPE *get_RetainedAudio)(
        ISpeechRecoContext *This,
        SpeechRetainedAudioOptions *Option);

    HRESULT (STDMETHODCALLTYPE *putref_RetainedAudioFormat)(
        ISpeechRecoContext *This,
        ISpeechAudioFormat *Format);

    HRESULT (STDMETHODCALLTYPE *get_RetainedAudioFormat)(
        ISpeechRecoContext *This,
        ISpeechAudioFormat **Format);

    HRESULT (STDMETHODCALLTYPE *Pause)(
        ISpeechRecoContext *This);

    HRESULT (STDMETHODCALLTYPE *Resume)(
        ISpeechRecoContext *This);

    HRESULT (STDMETHODCALLTYPE *CreateGrammar)(
        ISpeechRecoContext *This,
        VARIANT GrammarId,
        ISpeechRecoGrammar **Grammar);

    HRESULT (STDMETHODCALLTYPE *CreateResultFromMemory)(
        ISpeechRecoContext *This,
        VARIANT *ResultBlock,
        ISpeechRecoResult **Result);

    HRESULT (STDMETHODCALLTYPE *Bookmark)(
        ISpeechRecoContext *This,
        SpeechBookmarkOptions Options,
        VARIANT StreamPos,
        VARIANT BookmarkId);

    HRESULT (STDMETHODCALLTYPE *SetAdaptationData)(
        ISpeechRecoContext *This,
        BSTR AdaptationString);

    END_INTERFACE
} ISpeechRecoContextVtbl;

interface ISpeechRecoContext {
    CONST_VTBL ISpeechRecoContextVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpeechRecoContext_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpeechRecoContext_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpeechRecoContext_Release(This) (This)->lpVtbl->Release(This)
/*** IDispatch methods ***/
#define ISpeechRecoContext_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
#define ISpeechRecoContext_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
#define ISpeechRecoContext_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
#define ISpeechRecoContext_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
/*** ISpeechRecoContext methods ***/
#define ISpeechRecoContext_get_Recognizer(This,Recognizer) (This)->lpVtbl->get_Recognizer(This,Recognizer)
#define ISpeechRecoContext_get_AudioInputInterferenceStatus(This,Interference) (This)->lpVtbl->get_AudioInputInterferenceStatus(This,Interference)
#define ISpeechRecoContext_get_RequestedUIType(This,UIType) (This)->lpVtbl->get_RequestedUIType(This,UIType)
#define ISpeechRecoContext_putref_Voice(This,Voice) (This)->lpVtbl->putref_Voice(This,Voice)
#define ISpeechRecoContext_get_Voice(This,Voice) (This)->lpVtbl->get_Voice(This,Voice)
#define ISpeechRecoContext_put_AllowVoiceFormatMatchingOnNextSet(This,Allow) (This)->lpVtbl->put_AllowVoiceFormatMatchingOnNextSet(This,Allow)
#define ISpeechRecoContext_get_AllowVoiceFormatMatchingOnNextSet(This,pAllow) (This)->lpVtbl->get_AllowVoiceFormatMatchingOnNextSet(This,pAllow)
#define ISpeechRecoContext_put_VoicePurgeEvent(This,EventInterest) (This)->lpVtbl->put_VoicePurgeEvent(This,EventInterest)
#define ISpeechRecoContext_get_VoicePurgeEvent(This,EventInterest) (This)->lpVtbl->get_VoicePurgeEvent(This,EventInterest)
#define ISpeechRecoContext_put_EventInterests(This,EventInterest) (This)->lpVtbl->put_EventInterests(This,EventInterest)
#define ISpeechRecoContext_get_EventInterests(This,EventInterest) (This)->lpVtbl->get_EventInterests(This,EventInterest)
#define ISpeechRecoContext_put_CmdMaxAlternates(This,MaxAlternates) (This)->lpVtbl->put_CmdMaxAlternates(This,MaxAlternates)
#define ISpeechRecoContext_get_CmdMaxAlternates(This,MaxAlternates) (This)->lpVtbl->get_CmdMaxAlternates(This,MaxAlternates)
#define ISpeechRecoContext_put_State(This,State) (This)->lpVtbl->put_State(This,State)
#define ISpeechRecoContext_get_State(This,State) (This)->lpVtbl->get_State(This,State)
#define ISpeechRecoContext_put_RetainedAudio(This,Option) (This)->lpVtbl->put_RetainedAudio(This,Option)
#define ISpeechRecoContext_get_RetainedAudio(This,Option) (This)->lpVtbl->get_RetainedAudio(This,Option)
#define ISpeechRecoContext_putref_RetainedAudioFormat(This,Format) (This)->lpVtbl->putref_RetainedAudioFormat(This,Format)
#define ISpeechRecoContext_get_RetainedAudioFormat(This,Format) (This)->lpVtbl->get_RetainedAudioFormat(This,Format)
#define ISpeechRecoContext_Pause(This) (This)->lpVtbl->Pause(This)
#define ISpeechRecoContext_Resume(This) (This)->lpVtbl->Resume(This)
#define ISpeechRecoContext_CreateGrammar(This,GrammarId,Grammar) (This)->lpVtbl->CreateGrammar(This,GrammarId,Grammar)
#define ISpeechRecoContext_CreateResultFromMemory(This,ResultBlock,Result) (This)->lpVtbl->CreateResultFromMemory(This,ResultBlock,Result)
#define ISpeechRecoContext_Bookmark(This,Options,StreamPos,BookmarkId) (This)->lpVtbl->Bookmark(This,Options,StreamPos,BookmarkId)
#define ISpeechRecoContext_SetAdaptationData(This,AdaptationString) (This)->lpVtbl->SetAdaptationData(This,AdaptationString)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpeechRecoContext_QueryInterface(ISpeechRecoContext* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpeechRecoContext_AddRef(ISpeechRecoContext* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpeechRecoContext_Release(ISpeechRecoContext* This) {
    return This->lpVtbl->Release(This);
}
/*** IDispatch methods ***/
static FORCEINLINE HRESULT ISpeechRecoContext_GetTypeInfoCount(ISpeechRecoContext* This,UINT *pctinfo) {
    return This->lpVtbl->GetTypeInfoCount(This,pctinfo);
}
static FORCEINLINE HRESULT ISpeechRecoContext_GetTypeInfo(ISpeechRecoContext* This,UINT iTInfo,LCID lcid,ITypeInfo **ppTInfo) {
    return This->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo);
}
static FORCEINLINE HRESULT ISpeechRecoContext_GetIDsOfNames(ISpeechRecoContext* This,REFIID riid,LPOLESTR *rgszNames,UINT cNames,LCID lcid,DISPID *rgDispId) {
    return This->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId);
}
static FORCEINLINE HRESULT ISpeechRecoContext_Invoke(ISpeechRecoContext* This,DISPID dispIdMember,REFIID riid,LCID lcid,WORD wFlags,DISPPARAMS *pDispParams,VARIANT *pVarResult,EXCEPINFO *pExcepInfo,UINT *puArgErr) {
    return This->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr);
}
/*** ISpeechRecoContext methods ***/
static FORCEINLINE HRESULT ISpeechRecoContext_get_Recognizer(ISpeechRecoContext* This,ISpeechRecognizer **Recognizer) {
    return This->lpVtbl->get_Recognizer(This,Recognizer);
}
static FORCEINLINE HRESULT ISpeechRecoContext_get_AudioInputInterferenceStatus(ISpeechRecoContext* This,SpeechInterference *Interference) {
    return This->lpVtbl->get_AudioInputInterferenceStatus(This,Interference);
}
static FORCEINLINE HRESULT ISpeechRecoContext_get_RequestedUIType(ISpeechRecoContext* This,BSTR *UIType) {
    return This->lpVtbl->get_RequestedUIType(This,UIType);
}
static FORCEINLINE HRESULT ISpeechRecoContext_putref_Voice(ISpeechRecoContext* This,ISpeechVoice *Voice) {
    return This->lpVtbl->putref_Voice(This,Voice);
}
static FORCEINLINE HRESULT ISpeechRecoContext_get_Voice(ISpeechRecoContext* This,ISpeechVoice **Voice) {
    return This->lpVtbl->get_Voice(This,Voice);
}
static FORCEINLINE HRESULT ISpeechRecoContext_put_AllowVoiceFormatMatchingOnNextSet(ISpeechRecoContext* This,VARIANT_BOOL Allow) {
    return This->lpVtbl->put_AllowVoiceFormatMatchingOnNextSet(This,Allow);
}
static FORCEINLINE HRESULT ISpeechRecoContext_get_AllowVoiceFormatMatchingOnNextSet(ISpeechRecoContext* This,VARIANT_BOOL *pAllow) {
    return This->lpVtbl->get_AllowVoiceFormatMatchingOnNextSet(This,pAllow);
}
static FORCEINLINE HRESULT ISpeechRecoContext_put_VoicePurgeEvent(ISpeechRecoContext* This,SpeechRecoEvents EventInterest) {
    return This->lpVtbl->put_VoicePurgeEvent(This,EventInterest);
}
static FORCEINLINE HRESULT ISpeechRecoContext_get_VoicePurgeEvent(ISpeechRecoContext* This,SpeechRecoEvents *EventInterest) {
    return This->lpVtbl->get_VoicePurgeEvent(This,EventInterest);
}
static FORCEINLINE HRESULT ISpeechRecoContext_put_EventInterests(ISpeechRecoContext* This,SpeechRecoEvents EventInterest) {
    return This->lpVtbl->put_EventInterests(This,EventInterest);
}
static FORCEINLINE HRESULT ISpeechRecoContext_get_EventInterests(ISpeechRecoContext* This,SpeechRecoEvents *EventInterest) {
    return This->lpVtbl->get_EventInterests(This,EventInterest);
}
static FORCEINLINE HRESULT ISpeechRecoContext_put_CmdMaxAlternates(ISpeechRecoContext* This,LONG MaxAlternates) {
    return This->lpVtbl->put_CmdMaxAlternates(This,MaxAlternates);
}
static FORCEINLINE HRESULT ISpeechRecoContext_get_CmdMaxAlternates(ISpeechRecoContext* This,LONG *MaxAlternates) {
    return This->lpVtbl->get_CmdMaxAlternates(This,MaxAlternates);
}
static FORCEINLINE HRESULT ISpeechRecoContext_put_State(ISpeechRecoContext* This,SpeechRecoContextState State) {
    return This->lpVtbl->put_State(This,State);
}
static FORCEINLINE HRESULT ISpeechRecoContext_get_State(ISpeechRecoContext* This,SpeechRecoContextState *State) {
    return This->lpVtbl->get_State(This,State);
}
static FORCEINLINE HRESULT ISpeechRecoContext_put_RetainedAudio(ISpeechRecoContext* This,SpeechRetainedAudioOptions Option) {
    return This->lpVtbl->put_RetainedAudio(This,Option);
}
static FORCEINLINE HRESULT ISpeechRecoContext_get_RetainedAudio(ISpeechRecoContext* This,SpeechRetainedAudioOptions *Option) {
    return This->lpVtbl->get_RetainedAudio(This,Option);
}
static FORCEINLINE HRESULT ISpeechRecoContext_putref_RetainedAudioFormat(ISpeechRecoContext* This,ISpeechAudioFormat *Format) {
    return This->lpVtbl->putref_RetainedAudioFormat(This,Format);
}
static FORCEINLINE HRESULT ISpeechRecoContext_get_RetainedAudioFormat(ISpeechRecoContext* This,ISpeechAudioFormat **Format) {
    return This->lpVtbl->get_RetainedAudioFormat(This,Format);
}
static FORCEINLINE HRESULT ISpeechRecoContext_Pause(ISpeechRecoContext* This) {
    return This->lpVtbl->Pause(This);
}
static FORCEINLINE HRESULT ISpeechRecoContext_Resume(ISpeechRecoContext* This) {
    return This->lpVtbl->Resume(This);
}
static FORCEINLINE HRESULT ISpeechRecoContext_CreateGrammar(ISpeechRecoContext* This,VARIANT GrammarId,ISpeechRecoGrammar **Grammar) {
    return This->lpVtbl->CreateGrammar(This,GrammarId,Grammar);
}
static FORCEINLINE HRESULT ISpeechRecoContext_CreateResultFromMemory(ISpeechRecoContext* This,VARIANT *ResultBlock,ISpeechRecoResult **Result) {
    return This->lpVtbl->CreateResultFromMemory(This,ResultBlock,Result);
}
static FORCEINLINE HRESULT ISpeechRecoContext_Bookmark(ISpeechRecoContext* This,SpeechBookmarkOptions Options,VARIANT StreamPos,VARIANT BookmarkId) {
    return This->lpVtbl->Bookmark(This,Options,StreamPos,BookmarkId);
}
static FORCEINLINE HRESULT ISpeechRecoContext_SetAdaptationData(ISpeechRecoContext* This,BSTR AdaptationString) {
    return This->lpVtbl->SetAdaptationData(This,AdaptationString);
}
#endif
#endif

#endif


#endif  /* __ISpeechRecoContext_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpeechRecoGrammar interface
 */
#ifndef __ISpeechRecoGrammar_INTERFACE_DEFINED__
#define __ISpeechRecoGrammar_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpeechRecoGrammar, 0xb6d6f79f, 0x2158, 0x4e50, 0xb5,0xbc, 0x9a,0x9c,0xcd,0x85,0x2a,0x09);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("b6d6f79f-2158-4e50-b5bc-9a9ccd852a09")
ISpeechRecoGrammar : public IDispatch
{
    virtual HRESULT STDMETHODCALLTYPE get_Id(
        VARIANT *Id) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_RecoContext(
        ISpeechRecoContext **RecoContext) = 0;

    virtual HRESULT STDMETHODCALLTYPE put_State(
        SpeechGrammarState State) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_State(
        SpeechGrammarState *State) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_Rules(
        ISpeechGrammarRules **Rules) = 0;

    virtual HRESULT STDMETHODCALLTYPE Reset(
        SpeechLanguageId NewLanguage = 0) = 0;

    virtual HRESULT STDMETHODCALLTYPE CmdLoadFromFile(
        const BSTR FileName,
        SpeechLoadOption LoadOption = SLOStatic) = 0;

    virtual HRESULT STDMETHODCALLTYPE CmdLoadFromObject(
        const BSTR ClassId,
        const BSTR GrammarName,
        SpeechLoadOption LoadOption = SLOStatic) = 0;

    virtual HRESULT STDMETHODCALLTYPE CmdLoadFromResource(
        LONG hModule,
        VARIANT ResourceName,
        VARIANT ResourceType,
        SpeechLanguageId LanguageId,
        SpeechLoadOption LoadOption = SLOStatic) = 0;

    virtual HRESULT STDMETHODCALLTYPE CmdLoadFromMemory(
        VARIANT GrammarData,
        SpeechLoadOption LoadOption = SLOStatic) = 0;

    virtual HRESULT STDMETHODCALLTYPE CmdLoadFromProprietaryGrammar(
        const BSTR ProprietaryGuid,
        const BSTR ProprietaryString,
        VARIANT ProprietaryData,
        SpeechLoadOption LoadOption = SLOStatic) = 0;

    virtual HRESULT STDMETHODCALLTYPE CmdSetRuleState(
        const BSTR Name,
        SpeechRuleState State) = 0;

    virtual HRESULT STDMETHODCALLTYPE CmdSetRuleIdState(
        LONG RuleId,
        SpeechRuleState State) = 0;

    virtual HRESULT STDMETHODCALLTYPE DictationLoad(
        const BSTR TopicName = L"",
        SpeechLoadOption LoadOption = SLOStatic) = 0;

    virtual HRESULT STDMETHODCALLTYPE DictationUnload(
        ) = 0;

    virtual HRESULT STDMETHODCALLTYPE DictationSetState(
        SpeechRuleState State) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetWordSequenceData(
        const BSTR Text,
        LONG TextLength,
        ISpeechTextSelectionInformation *Info) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetTextSelection(
        ISpeechTextSelectionInformation *Info) = 0;

    virtual HRESULT STDMETHODCALLTYPE IsPronounceable(
        const BSTR Word,
        SpeechWordPronounceable *WordPronounceable) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpeechRecoGrammar, 0xb6d6f79f, 0x2158, 0x4e50, 0xb5,0xbc, 0x9a,0x9c,0xcd,0x85,0x2a,0x09)
#endif
#else
typedef struct ISpeechRecoGrammarVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpeechRecoGrammar *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpeechRecoGrammar *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpeechRecoGrammar *This);

    /*** IDispatch methods ***/
    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
        ISpeechRecoGrammar *This,
        UINT *pctinfo);

    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
        ISpeechRecoGrammar *This,
        UINT iTInfo,
        LCID lcid,
        ITypeInfo **ppTInfo);

    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
        ISpeechRecoGrammar *This,
        REFIID riid,
        LPOLESTR *rgszNames,
        UINT cNames,
        LCID lcid,
        DISPID *rgDispId);

    HRESULT (STDMETHODCALLTYPE *Invoke)(
        ISpeechRecoGrammar *This,
        DISPID dispIdMember,
        REFIID riid,
        LCID lcid,
        WORD wFlags,
        DISPPARAMS *pDispParams,
        VARIANT *pVarResult,
        EXCEPINFO *pExcepInfo,
        UINT *puArgErr);

    /*** ISpeechRecoGrammar methods ***/
    HRESULT (STDMETHODCALLTYPE *get_Id)(
        ISpeechRecoGrammar *This,
        VARIANT *Id);

    HRESULT (STDMETHODCALLTYPE *get_RecoContext)(
        ISpeechRecoGrammar *This,
        ISpeechRecoContext **RecoContext);

    HRESULT (STDMETHODCALLTYPE *put_State)(
        ISpeechRecoGrammar *This,
        SpeechGrammarState State);

    HRESULT (STDMETHODCALLTYPE *get_State)(
        ISpeechRecoGrammar *This,
        SpeechGrammarState *State);

    HRESULT (STDMETHODCALLTYPE *get_Rules)(
        ISpeechRecoGrammar *This,
        ISpeechGrammarRules **Rules);

    HRESULT (STDMETHODCALLTYPE *Reset)(
        ISpeechRecoGrammar *This,
        SpeechLanguageId NewLanguage);

    HRESULT (STDMETHODCALLTYPE *CmdLoadFromFile)(
        ISpeechRecoGrammar *This,
        const BSTR FileName,
        SpeechLoadOption LoadOption);

    HRESULT (STDMETHODCALLTYPE *CmdLoadFromObject)(
        ISpeechRecoGrammar *This,
        const BSTR ClassId,
        const BSTR GrammarName,
        SpeechLoadOption LoadOption);

    HRESULT (STDMETHODCALLTYPE *CmdLoadFromResource)(
        ISpeechRecoGrammar *This,
        LONG hModule,
        VARIANT ResourceName,
        VARIANT ResourceType,
        SpeechLanguageId LanguageId,
        SpeechLoadOption LoadOption);

    HRESULT (STDMETHODCALLTYPE *CmdLoadFromMemory)(
        ISpeechRecoGrammar *This,
        VARIANT GrammarData,
        SpeechLoadOption LoadOption);

    HRESULT (STDMETHODCALLTYPE *CmdLoadFromProprietaryGrammar)(
        ISpeechRecoGrammar *This,
        const BSTR ProprietaryGuid,
        const BSTR ProprietaryString,
        VARIANT ProprietaryData,
        SpeechLoadOption LoadOption);

    HRESULT (STDMETHODCALLTYPE *CmdSetRuleState)(
        ISpeechRecoGrammar *This,
        const BSTR Name,
        SpeechRuleState State);

    HRESULT (STDMETHODCALLTYPE *CmdSetRuleIdState)(
        ISpeechRecoGrammar *This,
        LONG RuleId,
        SpeechRuleState State);

    HRESULT (STDMETHODCALLTYPE *DictationLoad)(
        ISpeechRecoGrammar *This,
        const BSTR TopicName,
        SpeechLoadOption LoadOption);

    HRESULT (STDMETHODCALLTYPE *DictationUnload)(
        ISpeechRecoGrammar *This);

    HRESULT (STDMETHODCALLTYPE *DictationSetState)(
        ISpeechRecoGrammar *This,
        SpeechRuleState State);

    HRESULT (STDMETHODCALLTYPE *SetWordSequenceData)(
        ISpeechRecoGrammar *This,
        const BSTR Text,
        LONG TextLength,
        ISpeechTextSelectionInformation *Info);

    HRESULT (STDMETHODCALLTYPE *SetTextSelection)(
        ISpeechRecoGrammar *This,
        ISpeechTextSelectionInformation *Info);

    HRESULT (STDMETHODCALLTYPE *IsPronounceable)(
        ISpeechRecoGrammar *This,
        const BSTR Word,
        SpeechWordPronounceable *WordPronounceable);

    END_INTERFACE
} ISpeechRecoGrammarVtbl;

interface ISpeechRecoGrammar {
    CONST_VTBL ISpeechRecoGrammarVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpeechRecoGrammar_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpeechRecoGrammar_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpeechRecoGrammar_Release(This) (This)->lpVtbl->Release(This)
/*** IDispatch methods ***/
#define ISpeechRecoGrammar_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
#define ISpeechRecoGrammar_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
#define ISpeechRecoGrammar_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
#define ISpeechRecoGrammar_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
/*** ISpeechRecoGrammar methods ***/
#define ISpeechRecoGrammar_get_Id(This,Id) (This)->lpVtbl->get_Id(This,Id)
#define ISpeechRecoGrammar_get_RecoContext(This,RecoContext) (This)->lpVtbl->get_RecoContext(This,RecoContext)
#define ISpeechRecoGrammar_put_State(This,State) (This)->lpVtbl->put_State(This,State)
#define ISpeechRecoGrammar_get_State(This,State) (This)->lpVtbl->get_State(This,State)
#define ISpeechRecoGrammar_get_Rules(This,Rules) (This)->lpVtbl->get_Rules(This,Rules)
#define ISpeechRecoGrammar_Reset(This,NewLanguage) (This)->lpVtbl->Reset(This,NewLanguage)
#define ISpeechRecoGrammar_CmdLoadFromFile(This,FileName,LoadOption) (This)->lpVtbl->CmdLoadFromFile(This,FileName,LoadOption)
#define ISpeechRecoGrammar_CmdLoadFromObject(This,ClassId,GrammarName,LoadOption) (This)->lpVtbl->CmdLoadFromObject(This,ClassId,GrammarName,LoadOption)
#define ISpeechRecoGrammar_CmdLoadFromResource(This,hModule,ResourceName,ResourceType,LanguageId,LoadOption) (This)->lpVtbl->CmdLoadFromResource(This,hModule,ResourceName,ResourceType,LanguageId,LoadOption)
#define ISpeechRecoGrammar_CmdLoadFromMemory(This,GrammarData,LoadOption) (This)->lpVtbl->CmdLoadFromMemory(This,GrammarData,LoadOption)
#define ISpeechRecoGrammar_CmdLoadFromProprietaryGrammar(This,ProprietaryGuid,ProprietaryString,ProprietaryData,LoadOption) (This)->lpVtbl->CmdLoadFromProprietaryGrammar(This,ProprietaryGuid,ProprietaryString,ProprietaryData,LoadOption)
#define ISpeechRecoGrammar_CmdSetRuleState(This,Name,State) (This)->lpVtbl->CmdSetRuleState(This,Name,State)
#define ISpeechRecoGrammar_CmdSetRuleIdState(This,RuleId,State) (This)->lpVtbl->CmdSetRuleIdState(This,RuleId,State)
#define ISpeechRecoGrammar_DictationLoad(This,TopicName,LoadOption) (This)->lpVtbl->DictationLoad(This,TopicName,LoadOption)
#define ISpeechRecoGrammar_DictationUnload(This) (This)->lpVtbl->DictationUnload(This)
#define ISpeechRecoGrammar_DictationSetState(This,State) (This)->lpVtbl->DictationSetState(This,State)
#define ISpeechRecoGrammar_SetWordSequenceData(This,Text,TextLength,Info) (This)->lpVtbl->SetWordSequenceData(This,Text,TextLength,Info)
#define ISpeechRecoGrammar_SetTextSelection(This,Info) (This)->lpVtbl->SetTextSelection(This,Info)
#define ISpeechRecoGrammar_IsPronounceable(This,Word,WordPronounceable) (This)->lpVtbl->IsPronounceable(This,Word,WordPronounceable)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpeechRecoGrammar_QueryInterface(ISpeechRecoGrammar* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpeechRecoGrammar_AddRef(ISpeechRecoGrammar* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpeechRecoGrammar_Release(ISpeechRecoGrammar* This) {
    return This->lpVtbl->Release(This);
}
/*** IDispatch methods ***/
static FORCEINLINE HRESULT ISpeechRecoGrammar_GetTypeInfoCount(ISpeechRecoGrammar* This,UINT *pctinfo) {
    return This->lpVtbl->GetTypeInfoCount(This,pctinfo);
}
static FORCEINLINE HRESULT ISpeechRecoGrammar_GetTypeInfo(ISpeechRecoGrammar* This,UINT iTInfo,LCID lcid,ITypeInfo **ppTInfo) {
    return This->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo);
}
static FORCEINLINE HRESULT ISpeechRecoGrammar_GetIDsOfNames(ISpeechRecoGrammar* This,REFIID riid,LPOLESTR *rgszNames,UINT cNames,LCID lcid,DISPID *rgDispId) {
    return This->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId);
}
static FORCEINLINE HRESULT ISpeechRecoGrammar_Invoke(ISpeechRecoGrammar* This,DISPID dispIdMember,REFIID riid,LCID lcid,WORD wFlags,DISPPARAMS *pDispParams,VARIANT *pVarResult,EXCEPINFO *pExcepInfo,UINT *puArgErr) {
    return This->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr);
}
/*** ISpeechRecoGrammar methods ***/
static FORCEINLINE HRESULT ISpeechRecoGrammar_get_Id(ISpeechRecoGrammar* This,VARIANT *Id) {
    return This->lpVtbl->get_Id(This,Id);
}
static FORCEINLINE HRESULT ISpeechRecoGrammar_get_RecoContext(ISpeechRecoGrammar* This,ISpeechRecoContext **RecoContext) {
    return This->lpVtbl->get_RecoContext(This,RecoContext);
}
static FORCEINLINE HRESULT ISpeechRecoGrammar_put_State(ISpeechRecoGrammar* This,SpeechGrammarState State) {
    return This->lpVtbl->put_State(This,State);
}
static FORCEINLINE HRESULT ISpeechRecoGrammar_get_State(ISpeechRecoGrammar* This,SpeechGrammarState *State) {
    return This->lpVtbl->get_State(This,State);
}
static FORCEINLINE HRESULT ISpeechRecoGrammar_get_Rules(ISpeechRecoGrammar* This,ISpeechGrammarRules **Rules) {
    return This->lpVtbl->get_Rules(This,Rules);
}
static FORCEINLINE HRESULT ISpeechRecoGrammar_Reset(ISpeechRecoGrammar* This,SpeechLanguageId NewLanguage) {
    return This->lpVtbl->Reset(This,NewLanguage);
}
static FORCEINLINE HRESULT ISpeechRecoGrammar_CmdLoadFromFile(ISpeechRecoGrammar* This,const BSTR FileName,SpeechLoadOption LoadOption) {
    return This->lpVtbl->CmdLoadFromFile(This,FileName,LoadOption);
}
static FORCEINLINE HRESULT ISpeechRecoGrammar_CmdLoadFromObject(ISpeechRecoGrammar* This,const BSTR ClassId,const BSTR GrammarName,SpeechLoadOption LoadOption) {
    return This->lpVtbl->CmdLoadFromObject(This,ClassId,GrammarName,LoadOption);
}
static FORCEINLINE HRESULT ISpeechRecoGrammar_CmdLoadFromResource(ISpeechRecoGrammar* This,LONG hModule,VARIANT ResourceName,VARIANT ResourceType,SpeechLanguageId LanguageId,SpeechLoadOption LoadOption) {
    return This->lpVtbl->CmdLoadFromResource(This,hModule,ResourceName,ResourceType,LanguageId,LoadOption);
}
static FORCEINLINE HRESULT ISpeechRecoGrammar_CmdLoadFromMemory(ISpeechRecoGrammar* This,VARIANT GrammarData,SpeechLoadOption LoadOption) {
    return This->lpVtbl->CmdLoadFromMemory(This,GrammarData,LoadOption);
}
static FORCEINLINE HRESULT ISpeechRecoGrammar_CmdLoadFromProprietaryGrammar(ISpeechRecoGrammar* This,const BSTR ProprietaryGuid,const BSTR ProprietaryString,VARIANT ProprietaryData,SpeechLoadOption LoadOption) {
    return This->lpVtbl->CmdLoadFromProprietaryGrammar(This,ProprietaryGuid,ProprietaryString,ProprietaryData,LoadOption);
}
static FORCEINLINE HRESULT ISpeechRecoGrammar_CmdSetRuleState(ISpeechRecoGrammar* This,const BSTR Name,SpeechRuleState State) {
    return This->lpVtbl->CmdSetRuleState(This,Name,State);
}
static FORCEINLINE HRESULT ISpeechRecoGrammar_CmdSetRuleIdState(ISpeechRecoGrammar* This,LONG RuleId,SpeechRuleState State) {
    return This->lpVtbl->CmdSetRuleIdState(This,RuleId,State);
}
static FORCEINLINE HRESULT ISpeechRecoGrammar_DictationLoad(ISpeechRecoGrammar* This,const BSTR TopicName,SpeechLoadOption LoadOption) {
    return This->lpVtbl->DictationLoad(This,TopicName,LoadOption);
}
static FORCEINLINE HRESULT ISpeechRecoGrammar_DictationUnload(ISpeechRecoGrammar* This) {
    return This->lpVtbl->DictationUnload(This);
}
static FORCEINLINE HRESULT ISpeechRecoGrammar_DictationSetState(ISpeechRecoGrammar* This,SpeechRuleState State) {
    return This->lpVtbl->DictationSetState(This,State);
}
static FORCEINLINE HRESULT ISpeechRecoGrammar_SetWordSequenceData(ISpeechRecoGrammar* This,const BSTR Text,LONG TextLength,ISpeechTextSelectionInformation *Info) {
    return This->lpVtbl->SetWordSequenceData(This,Text,TextLength,Info);
}
static FORCEINLINE HRESULT ISpeechRecoGrammar_SetTextSelection(ISpeechRecoGrammar* This,ISpeechTextSelectionInformation *Info) {
    return This->lpVtbl->SetTextSelection(This,Info);
}
static FORCEINLINE HRESULT ISpeechRecoGrammar_IsPronounceable(ISpeechRecoGrammar* This,const BSTR Word,SpeechWordPronounceable *WordPronounceable) {
    return This->lpVtbl->IsPronounceable(This,Word,WordPronounceable);
}
#endif
#endif

#endif


#endif  /* __ISpeechRecoGrammar_INTERFACE_DEFINED__ */

/*****************************************************************************
 * _ISpeechRecoContextEvents dispinterface
 */
#ifndef ___ISpeechRecoContextEvents_DISPINTERFACE_DEFINED__
#define ___ISpeechRecoContextEvents_DISPINTERFACE_DEFINED__

DEFINE_GUID(DIID__ISpeechRecoContextEvents, 0x7b8fcb42, 0x0e9d, 0x4f00, 0xa0,0x48, 0x7b,0x04,0xd6,0x17,0x9d,0x3d);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("7b8fcb42-0e9d-4f00-a048-7b04d6179d3d")
_ISpeechRecoContextEvents : public IDispatch
{
};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(_ISpeechRecoContextEvents, 0x7b8fcb42, 0x0e9d, 0x4f00, 0xa0,0x48, 0x7b,0x04,0xd6,0x17,0x9d,0x3d)
#endif
#else
typedef struct _ISpeechRecoContextEventsVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        _ISpeechRecoContextEvents *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        _ISpeechRecoContextEvents *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        _ISpeechRecoContextEvents *This);

    /*** IDispatch methods ***/
    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
        _ISpeechRecoContextEvents *This,
        UINT *pctinfo);

    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
        _ISpeechRecoContextEvents *This,
        UINT iTInfo,
        LCID lcid,
        ITypeInfo **ppTInfo);

    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
        _ISpeechRecoContextEvents *This,
        REFIID riid,
        LPOLESTR *rgszNames,
        UINT cNames,
        LCID lcid,
        DISPID *rgDispId);

    HRESULT (STDMETHODCALLTYPE *Invoke)(
        _ISpeechRecoContextEvents *This,
        DISPID dispIdMember,
        REFIID riid,
        LCID lcid,
        WORD wFlags,
        DISPPARAMS *pDispParams,
        VARIANT *pVarResult,
        EXCEPINFO *pExcepInfo,
        UINT *puArgErr);

    END_INTERFACE
} _ISpeechRecoContextEventsVtbl;

interface _ISpeechRecoContextEvents {
    CONST_VTBL _ISpeechRecoContextEventsVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define _ISpeechRecoContextEvents_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define _ISpeechRecoContextEvents_AddRef(This) (This)->lpVtbl->AddRef(This)
#define _ISpeechRecoContextEvents_Release(This) (This)->lpVtbl->Release(This)
/*** IDispatch methods ***/
#define _ISpeechRecoContextEvents_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
#define _ISpeechRecoContextEvents_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
#define _ISpeechRecoContextEvents_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
#define _ISpeechRecoContextEvents_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT _ISpeechRecoContextEvents_QueryInterface(_ISpeechRecoContextEvents* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG _ISpeechRecoContextEvents_AddRef(_ISpeechRecoContextEvents* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG _ISpeechRecoContextEvents_Release(_ISpeechRecoContextEvents* This) {
    return This->lpVtbl->Release(This);
}
/*** IDispatch methods ***/
static FORCEINLINE HRESULT _ISpeechRecoContextEvents_GetTypeInfoCount(_ISpeechRecoContextEvents* This,UINT *pctinfo) {
    return This->lpVtbl->GetTypeInfoCount(This,pctinfo);
}
static FORCEINLINE HRESULT _ISpeechRecoContextEvents_GetTypeInfo(_ISpeechRecoContextEvents* This,UINT iTInfo,LCID lcid,ITypeInfo **ppTInfo) {
    return This->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo);
}
static FORCEINLINE HRESULT _ISpeechRecoContextEvents_GetIDsOfNames(_ISpeechRecoContextEvents* This,REFIID riid,LPOLESTR *rgszNames,UINT cNames,LCID lcid,DISPID *rgDispId) {
    return This->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId);
}
static FORCEINLINE HRESULT _ISpeechRecoContextEvents_Invoke(_ISpeechRecoContextEvents* This,DISPID dispIdMember,REFIID riid,LCID lcid,WORD wFlags,DISPPARAMS *pDispParams,VARIANT *pVarResult,EXCEPINFO *pExcepInfo,UINT *puArgErr) {
    return This->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr);
}
#endif
#endif

#endif

#endif  /* ___ISpeechRecoContextEvents_DISPINTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpeechGrammarRule interface
 */
#ifndef __ISpeechGrammarRule_INTERFACE_DEFINED__
#define __ISpeechGrammarRule_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpeechGrammarRule, 0xafe719cf, 0x5dd1, 0x44f2, 0x99,0x9c, 0x7a,0x39,0x9f,0x1c,0xfc,0xcc);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("afe719cf-5dd1-44f2-999c-7a399f1cfccc")
ISpeechGrammarRule : public IDispatch
{
    virtual HRESULT STDMETHODCALLTYPE get_Attributes(
        SpeechRuleAttributes *Attributes) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_InitialState(
        ISpeechGrammarRuleState **State) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_Name(
        BSTR *Name) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_Id(
        LONG *Id) = 0;

    virtual HRESULT STDMETHODCALLTYPE Clear(
        ) = 0;

    virtual HRESULT STDMETHODCALLTYPE AddResource(
        const BSTR ResourceName,
        const BSTR ResourceValue) = 0;

    virtual HRESULT STDMETHODCALLTYPE AddState(
        ISpeechGrammarRuleState **State) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpeechGrammarRule, 0xafe719cf, 0x5dd1, 0x44f2, 0x99,0x9c, 0x7a,0x39,0x9f,0x1c,0xfc,0xcc)
#endif
#else
typedef struct ISpeechGrammarRuleVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpeechGrammarRule *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpeechGrammarRule *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpeechGrammarRule *This);

    /*** IDispatch methods ***/
    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
        ISpeechGrammarRule *This,
        UINT *pctinfo);

    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
        ISpeechGrammarRule *This,
        UINT iTInfo,
        LCID lcid,
        ITypeInfo **ppTInfo);

    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
        ISpeechGrammarRule *This,
        REFIID riid,
        LPOLESTR *rgszNames,
        UINT cNames,
        LCID lcid,
        DISPID *rgDispId);

    HRESULT (STDMETHODCALLTYPE *Invoke)(
        ISpeechGrammarRule *This,
        DISPID dispIdMember,
        REFIID riid,
        LCID lcid,
        WORD wFlags,
        DISPPARAMS *pDispParams,
        VARIANT *pVarResult,
        EXCEPINFO *pExcepInfo,
        UINT *puArgErr);

    /*** ISpeechGrammarRule methods ***/
    HRESULT (STDMETHODCALLTYPE *get_Attributes)(
        ISpeechGrammarRule *This,
        SpeechRuleAttributes *Attributes);

    HRESULT (STDMETHODCALLTYPE *get_InitialState)(
        ISpeechGrammarRule *This,
        ISpeechGrammarRuleState **State);

    HRESULT (STDMETHODCALLTYPE *get_Name)(
        ISpeechGrammarRule *This,
        BSTR *Name);

    HRESULT (STDMETHODCALLTYPE *get_Id)(
        ISpeechGrammarRule *This,
        LONG *Id);

    HRESULT (STDMETHODCALLTYPE *Clear)(
        ISpeechGrammarRule *This);

    HRESULT (STDMETHODCALLTYPE *AddResource)(
        ISpeechGrammarRule *This,
        const BSTR ResourceName,
        const BSTR ResourceValue);

    HRESULT (STDMETHODCALLTYPE *AddState)(
        ISpeechGrammarRule *This,
        ISpeechGrammarRuleState **State);

    END_INTERFACE
} ISpeechGrammarRuleVtbl;

interface ISpeechGrammarRule {
    CONST_VTBL ISpeechGrammarRuleVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpeechGrammarRule_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpeechGrammarRule_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpeechGrammarRule_Release(This) (This)->lpVtbl->Release(This)
/*** IDispatch methods ***/
#define ISpeechGrammarRule_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
#define ISpeechGrammarRule_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
#define ISpeechGrammarRule_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
#define ISpeechGrammarRule_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
/*** ISpeechGrammarRule methods ***/
#define ISpeechGrammarRule_get_Attributes(This,Attributes) (This)->lpVtbl->get_Attributes(This,Attributes)
#define ISpeechGrammarRule_get_InitialState(This,State) (This)->lpVtbl->get_InitialState(This,State)
#define ISpeechGrammarRule_get_Name(This,Name) (This)->lpVtbl->get_Name(This,Name)
#define ISpeechGrammarRule_get_Id(This,Id) (This)->lpVtbl->get_Id(This,Id)
#define ISpeechGrammarRule_Clear(This) (This)->lpVtbl->Clear(This)
#define ISpeechGrammarRule_AddResource(This,ResourceName,ResourceValue) (This)->lpVtbl->AddResource(This,ResourceName,ResourceValue)
#define ISpeechGrammarRule_AddState(This,State) (This)->lpVtbl->AddState(This,State)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpeechGrammarRule_QueryInterface(ISpeechGrammarRule* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpeechGrammarRule_AddRef(ISpeechGrammarRule* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpeechGrammarRule_Release(ISpeechGrammarRule* This) {
    return This->lpVtbl->Release(This);
}
/*** IDispatch methods ***/
static FORCEINLINE HRESULT ISpeechGrammarRule_GetTypeInfoCount(ISpeechGrammarRule* This,UINT *pctinfo) {
    return This->lpVtbl->GetTypeInfoCount(This,pctinfo);
}
static FORCEINLINE HRESULT ISpeechGrammarRule_GetTypeInfo(ISpeechGrammarRule* This,UINT iTInfo,LCID lcid,ITypeInfo **ppTInfo) {
    return This->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo);
}
static FORCEINLINE HRESULT ISpeechGrammarRule_GetIDsOfNames(ISpeechGrammarRule* This,REFIID riid,LPOLESTR *rgszNames,UINT cNames,LCID lcid,DISPID *rgDispId) {
    return This->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId);
}
static FORCEINLINE HRESULT ISpeechGrammarRule_Invoke(ISpeechGrammarRule* This,DISPID dispIdMember,REFIID riid,LCID lcid,WORD wFlags,DISPPARAMS *pDispParams,VARIANT *pVarResult,EXCEPINFO *pExcepInfo,UINT *puArgErr) {
    return This->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr);
}
/*** ISpeechGrammarRule methods ***/
static FORCEINLINE HRESULT ISpeechGrammarRule_get_Attributes(ISpeechGrammarRule* This,SpeechRuleAttributes *Attributes) {
    return This->lpVtbl->get_Attributes(This,Attributes);
}
static FORCEINLINE HRESULT ISpeechGrammarRule_get_InitialState(ISpeechGrammarRule* This,ISpeechGrammarRuleState **State) {
    return This->lpVtbl->get_InitialState(This,State);
}
static FORCEINLINE HRESULT ISpeechGrammarRule_get_Name(ISpeechGrammarRule* This,BSTR *Name) {
    return This->lpVtbl->get_Name(This,Name);
}
static FORCEINLINE HRESULT ISpeechGrammarRule_get_Id(ISpeechGrammarRule* This,LONG *Id) {
    return This->lpVtbl->get_Id(This,Id);
}
static FORCEINLINE HRESULT ISpeechGrammarRule_Clear(ISpeechGrammarRule* This) {
    return This->lpVtbl->Clear(This);
}
static FORCEINLINE HRESULT ISpeechGrammarRule_AddResource(ISpeechGrammarRule* This,const BSTR ResourceName,const BSTR ResourceValue) {
    return This->lpVtbl->AddResource(This,ResourceName,ResourceValue);
}
static FORCEINLINE HRESULT ISpeechGrammarRule_AddState(ISpeechGrammarRule* This,ISpeechGrammarRuleState **State) {
    return This->lpVtbl->AddState(This,State);
}
#endif
#endif

#endif


#endif  /* __ISpeechGrammarRule_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpeechGrammarRules interface
 */
#ifndef __ISpeechGrammarRules_INTERFACE_DEFINED__
#define __ISpeechGrammarRules_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpeechGrammarRules, 0x6ffa3b44, 0xfc2d, 0x40d1, 0x8a,0xfc, 0x32,0x91,0x1c,0x7f,0x1a,0xd1);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("6ffa3b44-fc2d-40d1-8afc-32911c7f1ad1")
ISpeechGrammarRules : public IDispatch
{
    virtual HRESULT STDMETHODCALLTYPE get_Count(
        LONG *Count) = 0;

    virtual HRESULT STDMETHODCALLTYPE FindRule(
        VARIANT RuleNameOrId,
        ISpeechGrammarRule **Rule) = 0;

    virtual HRESULT STDMETHODCALLTYPE Item(
        LONG Index,
        ISpeechGrammarRule **Rule) = 0;

    virtual HRESULT STDMETHODCALLTYPE get__NewEnum(
        IUnknown **EnumVARIANT) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_Dynamic(
        VARIANT_BOOL *Dynamic) = 0;

    virtual HRESULT STDMETHODCALLTYPE Add(
        BSTR RuleName,
        SpeechRuleAttributes Attributes,
        LONG RuleId,
        ISpeechGrammarRule **Rule) = 0;

    virtual HRESULT STDMETHODCALLTYPE Commit(
        ) = 0;

    virtual HRESULT STDMETHODCALLTYPE CommitAndSave(
        BSTR *ErrorText,
        VARIANT *SaveStream) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpeechGrammarRules, 0x6ffa3b44, 0xfc2d, 0x40d1, 0x8a,0xfc, 0x32,0x91,0x1c,0x7f,0x1a,0xd1)
#endif
#else
typedef struct ISpeechGrammarRulesVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpeechGrammarRules *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpeechGrammarRules *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpeechGrammarRules *This);

    /*** IDispatch methods ***/
    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
        ISpeechGrammarRules *This,
        UINT *pctinfo);

    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
        ISpeechGrammarRules *This,
        UINT iTInfo,
        LCID lcid,
        ITypeInfo **ppTInfo);

    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
        ISpeechGrammarRules *This,
        REFIID riid,
        LPOLESTR *rgszNames,
        UINT cNames,
        LCID lcid,
        DISPID *rgDispId);

    HRESULT (STDMETHODCALLTYPE *Invoke)(
        ISpeechGrammarRules *This,
        DISPID dispIdMember,
        REFIID riid,
        LCID lcid,
        WORD wFlags,
        DISPPARAMS *pDispParams,
        VARIANT *pVarResult,
        EXCEPINFO *pExcepInfo,
        UINT *puArgErr);

    /*** ISpeechGrammarRules methods ***/
    HRESULT (STDMETHODCALLTYPE *get_Count)(
        ISpeechGrammarRules *This,
        LONG *Count);

    HRESULT (STDMETHODCALLTYPE *FindRule)(
        ISpeechGrammarRules *This,
        VARIANT RuleNameOrId,
        ISpeechGrammarRule **Rule);

    HRESULT (STDMETHODCALLTYPE *Item)(
        ISpeechGrammarRules *This,
        LONG Index,
        ISpeechGrammarRule **Rule);

    HRESULT (STDMETHODCALLTYPE *get__NewEnum)(
        ISpeechGrammarRules *This,
        IUnknown **EnumVARIANT);

    HRESULT (STDMETHODCALLTYPE *get_Dynamic)(
        ISpeechGrammarRules *This,
        VARIANT_BOOL *Dynamic);

    HRESULT (STDMETHODCALLTYPE *Add)(
        ISpeechGrammarRules *This,
        BSTR RuleName,
        SpeechRuleAttributes Attributes,
        LONG RuleId,
        ISpeechGrammarRule **Rule);

    HRESULT (STDMETHODCALLTYPE *Commit)(
        ISpeechGrammarRules *This);

    HRESULT (STDMETHODCALLTYPE *CommitAndSave)(
        ISpeechGrammarRules *This,
        BSTR *ErrorText,
        VARIANT *SaveStream);

    END_INTERFACE
} ISpeechGrammarRulesVtbl;

interface ISpeechGrammarRules {
    CONST_VTBL ISpeechGrammarRulesVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpeechGrammarRules_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpeechGrammarRules_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpeechGrammarRules_Release(This) (This)->lpVtbl->Release(This)
/*** IDispatch methods ***/
#define ISpeechGrammarRules_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
#define ISpeechGrammarRules_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
#define ISpeechGrammarRules_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
#define ISpeechGrammarRules_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
/*** ISpeechGrammarRules methods ***/
#define ISpeechGrammarRules_get_Count(This,Count) (This)->lpVtbl->get_Count(This,Count)
#define ISpeechGrammarRules_FindRule(This,RuleNameOrId,Rule) (This)->lpVtbl->FindRule(This,RuleNameOrId,Rule)
#define ISpeechGrammarRules_Item(This,Index,Rule) (This)->lpVtbl->Item(This,Index,Rule)
#define ISpeechGrammarRules_get__NewEnum(This,EnumVARIANT) (This)->lpVtbl->get__NewEnum(This,EnumVARIANT)
#define ISpeechGrammarRules_get_Dynamic(This,Dynamic) (This)->lpVtbl->get_Dynamic(This,Dynamic)
#define ISpeechGrammarRules_Add(This,RuleName,Attributes,RuleId,Rule) (This)->lpVtbl->Add(This,RuleName,Attributes,RuleId,Rule)
#define ISpeechGrammarRules_Commit(This) (This)->lpVtbl->Commit(This)
#define ISpeechGrammarRules_CommitAndSave(This,ErrorText,SaveStream) (This)->lpVtbl->CommitAndSave(This,ErrorText,SaveStream)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpeechGrammarRules_QueryInterface(ISpeechGrammarRules* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpeechGrammarRules_AddRef(ISpeechGrammarRules* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpeechGrammarRules_Release(ISpeechGrammarRules* This) {
    return This->lpVtbl->Release(This);
}
/*** IDispatch methods ***/
static FORCEINLINE HRESULT ISpeechGrammarRules_GetTypeInfoCount(ISpeechGrammarRules* This,UINT *pctinfo) {
    return This->lpVtbl->GetTypeInfoCount(This,pctinfo);
}
static FORCEINLINE HRESULT ISpeechGrammarRules_GetTypeInfo(ISpeechGrammarRules* This,UINT iTInfo,LCID lcid,ITypeInfo **ppTInfo) {
    return This->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo);
}
static FORCEINLINE HRESULT ISpeechGrammarRules_GetIDsOfNames(ISpeechGrammarRules* This,REFIID riid,LPOLESTR *rgszNames,UINT cNames,LCID lcid,DISPID *rgDispId) {
    return This->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId);
}
static FORCEINLINE HRESULT ISpeechGrammarRules_Invoke(ISpeechGrammarRules* This,DISPID dispIdMember,REFIID riid,LCID lcid,WORD wFlags,DISPPARAMS *pDispParams,VARIANT *pVarResult,EXCEPINFO *pExcepInfo,UINT *puArgErr) {
    return This->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr);
}
/*** ISpeechGrammarRules methods ***/
static FORCEINLINE HRESULT ISpeechGrammarRules_get_Count(ISpeechGrammarRules* This,LONG *Count) {
    return This->lpVtbl->get_Count(This,Count);
}
static FORCEINLINE HRESULT ISpeechGrammarRules_FindRule(ISpeechGrammarRules* This,VARIANT RuleNameOrId,ISpeechGrammarRule **Rule) {
    return This->lpVtbl->FindRule(This,RuleNameOrId,Rule);
}
static FORCEINLINE HRESULT ISpeechGrammarRules_Item(ISpeechGrammarRules* This,LONG Index,ISpeechGrammarRule **Rule) {
    return This->lpVtbl->Item(This,Index,Rule);
}
static FORCEINLINE HRESULT ISpeechGrammarRules_get__NewEnum(ISpeechGrammarRules* This,IUnknown **EnumVARIANT) {
    return This->lpVtbl->get__NewEnum(This,EnumVARIANT);
}
static FORCEINLINE HRESULT ISpeechGrammarRules_get_Dynamic(ISpeechGrammarRules* This,VARIANT_BOOL *Dynamic) {
    return This->lpVtbl->get_Dynamic(This,Dynamic);
}
static FORCEINLINE HRESULT ISpeechGrammarRules_Add(ISpeechGrammarRules* This,BSTR RuleName,SpeechRuleAttributes Attributes,LONG RuleId,ISpeechGrammarRule **Rule) {
    return This->lpVtbl->Add(This,RuleName,Attributes,RuleId,Rule);
}
static FORCEINLINE HRESULT ISpeechGrammarRules_Commit(ISpeechGrammarRules* This) {
    return This->lpVtbl->Commit(This);
}
static FORCEINLINE HRESULT ISpeechGrammarRules_CommitAndSave(ISpeechGrammarRules* This,BSTR *ErrorText,VARIANT *SaveStream) {
    return This->lpVtbl->CommitAndSave(This,ErrorText,SaveStream);
}
#endif
#endif

#endif


#endif  /* __ISpeechGrammarRules_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpeechGrammarRuleState interface
 */
#ifndef __ISpeechGrammarRuleState_INTERFACE_DEFINED__
#define __ISpeechGrammarRuleState_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpeechGrammarRuleState, 0xd4286f2c, 0xee67, 0x45ae, 0xb9,0x28, 0x28,0xd6,0x95,0x36,0x2e,0xda);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("d4286f2c-ee67-45ae-b928-28d695362eda")
ISpeechGrammarRuleState : public IDispatch
{
    virtual HRESULT STDMETHODCALLTYPE get_Rule(
        ISpeechGrammarRule **Rule) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_Transitions(
        ISpeechGrammarRuleStateTransitions **Transitions) = 0;

    virtual HRESULT STDMETHODCALLTYPE AddWordTransition(
        ISpeechGrammarRuleState *DestState,
        const BSTR Words,
        const BSTR Separators = L" ",
        SpeechGrammarWordType Type = SGLexical,
        const BSTR PropertyName = L"",
        LONG PropertyId = 0,
        VARIANT *PropertyValue = 0,
        float Weight = 1) = 0;

    virtual HRESULT STDMETHODCALLTYPE AddRuleTransition(
        ISpeechGrammarRuleState *DestinationState,
        ISpeechGrammarRule *Rule,
        const BSTR PropertyName = L"",
        LONG PropertyId = 0,
        VARIANT *PropertyValue = 0,
        float Weight = 1) = 0;

    virtual HRESULT STDMETHODCALLTYPE AddSpecialTransition(
        ISpeechGrammarRuleState *DestinationState,
        SpeechSpecialTransitionType Type,
        const BSTR PropertyName = L"",
        LONG PropertyId = 0,
        VARIANT *PropertyValue = 0,
        float Weight = 1) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpeechGrammarRuleState, 0xd4286f2c, 0xee67, 0x45ae, 0xb9,0x28, 0x28,0xd6,0x95,0x36,0x2e,0xda)
#endif
#else
typedef struct ISpeechGrammarRuleStateVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpeechGrammarRuleState *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpeechGrammarRuleState *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpeechGrammarRuleState *This);

    /*** IDispatch methods ***/
    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
        ISpeechGrammarRuleState *This,
        UINT *pctinfo);

    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
        ISpeechGrammarRuleState *This,
        UINT iTInfo,
        LCID lcid,
        ITypeInfo **ppTInfo);

    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
        ISpeechGrammarRuleState *This,
        REFIID riid,
        LPOLESTR *rgszNames,
        UINT cNames,
        LCID lcid,
        DISPID *rgDispId);

    HRESULT (STDMETHODCALLTYPE *Invoke)(
        ISpeechGrammarRuleState *This,
        DISPID dispIdMember,
        REFIID riid,
        LCID lcid,
        WORD wFlags,
        DISPPARAMS *pDispParams,
        VARIANT *pVarResult,
        EXCEPINFO *pExcepInfo,
        UINT *puArgErr);

    /*** ISpeechGrammarRuleState methods ***/
    HRESULT (STDMETHODCALLTYPE *get_Rule)(
        ISpeechGrammarRuleState *This,
        ISpeechGrammarRule **Rule);

    HRESULT (STDMETHODCALLTYPE *get_Transitions)(
        ISpeechGrammarRuleState *This,
        ISpeechGrammarRuleStateTransitions **Transitions);

    HRESULT (STDMETHODCALLTYPE *AddWordTransition)(
        ISpeechGrammarRuleState *This,
        ISpeechGrammarRuleState *DestState,
        const BSTR Words,
        const BSTR Separators,
        SpeechGrammarWordType Type,
        const BSTR PropertyName,
        LONG PropertyId,
        VARIANT *PropertyValue,
        float Weight);

    HRESULT (STDMETHODCALLTYPE *AddRuleTransition)(
        ISpeechGrammarRuleState *This,
        ISpeechGrammarRuleState *DestinationState,
        ISpeechGrammarRule *Rule,
        const BSTR PropertyName,
        LONG PropertyId,
        VARIANT *PropertyValue,
        float Weight);

    HRESULT (STDMETHODCALLTYPE *AddSpecialTransition)(
        ISpeechGrammarRuleState *This,
        ISpeechGrammarRuleState *DestinationState,
        SpeechSpecialTransitionType Type,
        const BSTR PropertyName,
        LONG PropertyId,
        VARIANT *PropertyValue,
        float Weight);

    END_INTERFACE
} ISpeechGrammarRuleStateVtbl;

interface ISpeechGrammarRuleState {
    CONST_VTBL ISpeechGrammarRuleStateVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpeechGrammarRuleState_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpeechGrammarRuleState_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpeechGrammarRuleState_Release(This) (This)->lpVtbl->Release(This)
/*** IDispatch methods ***/
#define ISpeechGrammarRuleState_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
#define ISpeechGrammarRuleState_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
#define ISpeechGrammarRuleState_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
#define ISpeechGrammarRuleState_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
/*** ISpeechGrammarRuleState methods ***/
#define ISpeechGrammarRuleState_get_Rule(This,Rule) (This)->lpVtbl->get_Rule(This,Rule)
#define ISpeechGrammarRuleState_get_Transitions(This,Transitions) (This)->lpVtbl->get_Transitions(This,Transitions)
#define ISpeechGrammarRuleState_AddWordTransition(This,DestState,Words,Separators,Type,PropertyName,PropertyId,PropertyValue,Weight) (This)->lpVtbl->AddWordTransition(This,DestState,Words,Separators,Type,PropertyName,PropertyId,PropertyValue,Weight)
#define ISpeechGrammarRuleState_AddRuleTransition(This,DestinationState,Rule,PropertyName,PropertyId,PropertyValue,Weight) (This)->lpVtbl->AddRuleTransition(This,DestinationState,Rule,PropertyName,PropertyId,PropertyValue,Weight)
#define ISpeechGrammarRuleState_AddSpecialTransition(This,DestinationState,Type,PropertyName,PropertyId,PropertyValue,Weight) (This)->lpVtbl->AddSpecialTransition(This,DestinationState,Type,PropertyName,PropertyId,PropertyValue,Weight)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpeechGrammarRuleState_QueryInterface(ISpeechGrammarRuleState* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpeechGrammarRuleState_AddRef(ISpeechGrammarRuleState* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpeechGrammarRuleState_Release(ISpeechGrammarRuleState* This) {
    return This->lpVtbl->Release(This);
}
/*** IDispatch methods ***/
static FORCEINLINE HRESULT ISpeechGrammarRuleState_GetTypeInfoCount(ISpeechGrammarRuleState* This,UINT *pctinfo) {
    return This->lpVtbl->GetTypeInfoCount(This,pctinfo);
}
static FORCEINLINE HRESULT ISpeechGrammarRuleState_GetTypeInfo(ISpeechGrammarRuleState* This,UINT iTInfo,LCID lcid,ITypeInfo **ppTInfo) {
    return This->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo);
}
static FORCEINLINE HRESULT ISpeechGrammarRuleState_GetIDsOfNames(ISpeechGrammarRuleState* This,REFIID riid,LPOLESTR *rgszNames,UINT cNames,LCID lcid,DISPID *rgDispId) {
    return This->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId);
}
static FORCEINLINE HRESULT ISpeechGrammarRuleState_Invoke(ISpeechGrammarRuleState* This,DISPID dispIdMember,REFIID riid,LCID lcid,WORD wFlags,DISPPARAMS *pDispParams,VARIANT *pVarResult,EXCEPINFO *pExcepInfo,UINT *puArgErr) {
    return This->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr);
}
/*** ISpeechGrammarRuleState methods ***/
static FORCEINLINE HRESULT ISpeechGrammarRuleState_get_Rule(ISpeechGrammarRuleState* This,ISpeechGrammarRule **Rule) {
    return This->lpVtbl->get_Rule(This,Rule);
}
static FORCEINLINE HRESULT ISpeechGrammarRuleState_get_Transitions(ISpeechGrammarRuleState* This,ISpeechGrammarRuleStateTransitions **Transitions) {
    return This->lpVtbl->get_Transitions(This,Transitions);
}
static FORCEINLINE HRESULT ISpeechGrammarRuleState_AddWordTransition(ISpeechGrammarRuleState* This,ISpeechGrammarRuleState *DestState,const BSTR Words,const BSTR Separators,SpeechGrammarWordType Type,const BSTR PropertyName,LONG PropertyId,VARIANT *PropertyValue,float Weight) {
    return This->lpVtbl->AddWordTransition(This,DestState,Words,Separators,Type,PropertyName,PropertyId,PropertyValue,Weight);
}
static FORCEINLINE HRESULT ISpeechGrammarRuleState_AddRuleTransition(ISpeechGrammarRuleState* This,ISpeechGrammarRuleState *DestinationState,ISpeechGrammarRule *Rule,const BSTR PropertyName,LONG PropertyId,VARIANT *PropertyValue,float Weight) {
    return This->lpVtbl->AddRuleTransition(This,DestinationState,Rule,PropertyName,PropertyId,PropertyValue,Weight);
}
static FORCEINLINE HRESULT ISpeechGrammarRuleState_AddSpecialTransition(ISpeechGrammarRuleState* This,ISpeechGrammarRuleState *DestinationState,SpeechSpecialTransitionType Type,const BSTR PropertyName,LONG PropertyId,VARIANT *PropertyValue,float Weight) {
    return This->lpVtbl->AddSpecialTransition(This,DestinationState,Type,PropertyName,PropertyId,PropertyValue,Weight);
}
#endif
#endif

#endif


#endif  /* __ISpeechGrammarRuleState_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpeechGrammarRuleStateTransitions interface
 */
#ifndef __ISpeechGrammarRuleStateTransitions_INTERFACE_DEFINED__
#define __ISpeechGrammarRuleStateTransitions_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpeechGrammarRuleStateTransitions, 0xeabce657, 0x75bc, 0x44a2, 0xaa,0x7f, 0xc5,0x64,0x76,0x74,0x29,0x63);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("eabce657-75bc-44a2-aa7f-c56476742963")
ISpeechGrammarRuleStateTransitions : public IDispatch
{
    virtual HRESULT STDMETHODCALLTYPE get_Count(
        LONG *Count) = 0;

    virtual HRESULT STDMETHODCALLTYPE Item(
        LONG Index,
        ISpeechGrammarRuleStateTransition **Transition) = 0;

    virtual HRESULT STDMETHODCALLTYPE get__NewEnum(
        IUnknown **EnumVARIANT) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpeechGrammarRuleStateTransitions, 0xeabce657, 0x75bc, 0x44a2, 0xaa,0x7f, 0xc5,0x64,0x76,0x74,0x29,0x63)
#endif
#else
typedef struct ISpeechGrammarRuleStateTransitionsVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpeechGrammarRuleStateTransitions *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpeechGrammarRuleStateTransitions *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpeechGrammarRuleStateTransitions *This);

    /*** IDispatch methods ***/
    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
        ISpeechGrammarRuleStateTransitions *This,
        UINT *pctinfo);

    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
        ISpeechGrammarRuleStateTransitions *This,
        UINT iTInfo,
        LCID lcid,
        ITypeInfo **ppTInfo);

    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
        ISpeechGrammarRuleStateTransitions *This,
        REFIID riid,
        LPOLESTR *rgszNames,
        UINT cNames,
        LCID lcid,
        DISPID *rgDispId);

    HRESULT (STDMETHODCALLTYPE *Invoke)(
        ISpeechGrammarRuleStateTransitions *This,
        DISPID dispIdMember,
        REFIID riid,
        LCID lcid,
        WORD wFlags,
        DISPPARAMS *pDispParams,
        VARIANT *pVarResult,
        EXCEPINFO *pExcepInfo,
        UINT *puArgErr);

    /*** ISpeechGrammarRuleStateTransitions methods ***/
    HRESULT (STDMETHODCALLTYPE *get_Count)(
        ISpeechGrammarRuleStateTransitions *This,
        LONG *Count);

    HRESULT (STDMETHODCALLTYPE *Item)(
        ISpeechGrammarRuleStateTransitions *This,
        LONG Index,
        ISpeechGrammarRuleStateTransition **Transition);

    HRESULT (STDMETHODCALLTYPE *get__NewEnum)(
        ISpeechGrammarRuleStateTransitions *This,
        IUnknown **EnumVARIANT);

    END_INTERFACE
} ISpeechGrammarRuleStateTransitionsVtbl;

interface ISpeechGrammarRuleStateTransitions {
    CONST_VTBL ISpeechGrammarRuleStateTransitionsVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpeechGrammarRuleStateTransitions_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpeechGrammarRuleStateTransitions_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpeechGrammarRuleStateTransitions_Release(This) (This)->lpVtbl->Release(This)
/*** IDispatch methods ***/
#define ISpeechGrammarRuleStateTransitions_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
#define ISpeechGrammarRuleStateTransitions_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
#define ISpeechGrammarRuleStateTransitions_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
#define ISpeechGrammarRuleStateTransitions_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
/*** ISpeechGrammarRuleStateTransitions methods ***/
#define ISpeechGrammarRuleStateTransitions_get_Count(This,Count) (This)->lpVtbl->get_Count(This,Count)
#define ISpeechGrammarRuleStateTransitions_Item(This,Index,Transition) (This)->lpVtbl->Item(This,Index,Transition)
#define ISpeechGrammarRuleStateTransitions_get__NewEnum(This,EnumVARIANT) (This)->lpVtbl->get__NewEnum(This,EnumVARIANT)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpeechGrammarRuleStateTransitions_QueryInterface(ISpeechGrammarRuleStateTransitions* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpeechGrammarRuleStateTransitions_AddRef(ISpeechGrammarRuleStateTransitions* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpeechGrammarRuleStateTransitions_Release(ISpeechGrammarRuleStateTransitions* This) {
    return This->lpVtbl->Release(This);
}
/*** IDispatch methods ***/
static FORCEINLINE HRESULT ISpeechGrammarRuleStateTransitions_GetTypeInfoCount(ISpeechGrammarRuleStateTransitions* This,UINT *pctinfo) {
    return This->lpVtbl->GetTypeInfoCount(This,pctinfo);
}
static FORCEINLINE HRESULT ISpeechGrammarRuleStateTransitions_GetTypeInfo(ISpeechGrammarRuleStateTransitions* This,UINT iTInfo,LCID lcid,ITypeInfo **ppTInfo) {
    return This->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo);
}
static FORCEINLINE HRESULT ISpeechGrammarRuleStateTransitions_GetIDsOfNames(ISpeechGrammarRuleStateTransitions* This,REFIID riid,LPOLESTR *rgszNames,UINT cNames,LCID lcid,DISPID *rgDispId) {
    return This->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId);
}
static FORCEINLINE HRESULT ISpeechGrammarRuleStateTransitions_Invoke(ISpeechGrammarRuleStateTransitions* This,DISPID dispIdMember,REFIID riid,LCID lcid,WORD wFlags,DISPPARAMS *pDispParams,VARIANT *pVarResult,EXCEPINFO *pExcepInfo,UINT *puArgErr) {
    return This->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr);
}
/*** ISpeechGrammarRuleStateTransitions methods ***/
static FORCEINLINE HRESULT ISpeechGrammarRuleStateTransitions_get_Count(ISpeechGrammarRuleStateTransitions* This,LONG *Count) {
    return This->lpVtbl->get_Count(This,Count);
}
static FORCEINLINE HRESULT ISpeechGrammarRuleStateTransitions_Item(ISpeechGrammarRuleStateTransitions* This,LONG Index,ISpeechGrammarRuleStateTransition **Transition) {
    return This->lpVtbl->Item(This,Index,Transition);
}
static FORCEINLINE HRESULT ISpeechGrammarRuleStateTransitions_get__NewEnum(ISpeechGrammarRuleStateTransitions* This,IUnknown **EnumVARIANT) {
    return This->lpVtbl->get__NewEnum(This,EnumVARIANT);
}
#endif
#endif

#endif


#endif  /* __ISpeechGrammarRuleStateTransitions_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpeechGrammarRuleStateTransition interface
 */
#ifndef __ISpeechGrammarRuleStateTransition_INTERFACE_DEFINED__
#define __ISpeechGrammarRuleStateTransition_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpeechGrammarRuleStateTransition, 0xcafd1db1, 0x41d1, 0x4a06, 0x98,0x63, 0xe2,0xe8,0x1d,0xa1,0x7a,0x9a);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("cafd1db1-41d1-4a06-9863-e2e81da17a9a")
ISpeechGrammarRuleStateTransition : public IDispatch
{
    virtual HRESULT STDMETHODCALLTYPE get_Type(
        SpeechGrammarRuleStateTransitionType *Type) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_Text(
        BSTR *Text) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_Rule(
        ISpeechGrammarRule **Rule) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_Weight(
        VARIANT *Weight) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_PropertyName(
        BSTR *PropertyName) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_PropertyId(
        LONG *PropertyId) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_PropertyValue(
        VARIANT *PropertyValue) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_NextState(
        ISpeechGrammarRuleState **NextState) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpeechGrammarRuleStateTransition, 0xcafd1db1, 0x41d1, 0x4a06, 0x98,0x63, 0xe2,0xe8,0x1d,0xa1,0x7a,0x9a)
#endif
#else
typedef struct ISpeechGrammarRuleStateTransitionVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpeechGrammarRuleStateTransition *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpeechGrammarRuleStateTransition *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpeechGrammarRuleStateTransition *This);

    /*** IDispatch methods ***/
    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
        ISpeechGrammarRuleStateTransition *This,
        UINT *pctinfo);

    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
        ISpeechGrammarRuleStateTransition *This,
        UINT iTInfo,
        LCID lcid,
        ITypeInfo **ppTInfo);

    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
        ISpeechGrammarRuleStateTransition *This,
        REFIID riid,
        LPOLESTR *rgszNames,
        UINT cNames,
        LCID lcid,
        DISPID *rgDispId);

    HRESULT (STDMETHODCALLTYPE *Invoke)(
        ISpeechGrammarRuleStateTransition *This,
        DISPID dispIdMember,
        REFIID riid,
        LCID lcid,
        WORD wFlags,
        DISPPARAMS *pDispParams,
        VARIANT *pVarResult,
        EXCEPINFO *pExcepInfo,
        UINT *puArgErr);

    /*** ISpeechGrammarRuleStateTransition methods ***/
    HRESULT (STDMETHODCALLTYPE *get_Type)(
        ISpeechGrammarRuleStateTransition *This,
        SpeechGrammarRuleStateTransitionType *Type);

    HRESULT (STDMETHODCALLTYPE *get_Text)(
        ISpeechGrammarRuleStateTransition *This,
        BSTR *Text);

    HRESULT (STDMETHODCALLTYPE *get_Rule)(
        ISpeechGrammarRuleStateTransition *This,
        ISpeechGrammarRule **Rule);

    HRESULT (STDMETHODCALLTYPE *get_Weight)(
        ISpeechGrammarRuleStateTransition *This,
        VARIANT *Weight);

    HRESULT (STDMETHODCALLTYPE *get_PropertyName)(
        ISpeechGrammarRuleStateTransition *This,
        BSTR *PropertyName);

    HRESULT (STDMETHODCALLTYPE *get_PropertyId)(
        ISpeechGrammarRuleStateTransition *This,
        LONG *PropertyId);

    HRESULT (STDMETHODCALLTYPE *get_PropertyValue)(
        ISpeechGrammarRuleStateTransition *This,
        VARIANT *PropertyValue);

    HRESULT (STDMETHODCALLTYPE *get_NextState)(
        ISpeechGrammarRuleStateTransition *This,
        ISpeechGrammarRuleState **NextState);

    END_INTERFACE
} ISpeechGrammarRuleStateTransitionVtbl;

interface ISpeechGrammarRuleStateTransition {
    CONST_VTBL ISpeechGrammarRuleStateTransitionVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpeechGrammarRuleStateTransition_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpeechGrammarRuleStateTransition_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpeechGrammarRuleStateTransition_Release(This) (This)->lpVtbl->Release(This)
/*** IDispatch methods ***/
#define ISpeechGrammarRuleStateTransition_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
#define ISpeechGrammarRuleStateTransition_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
#define ISpeechGrammarRuleStateTransition_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
#define ISpeechGrammarRuleStateTransition_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
/*** ISpeechGrammarRuleStateTransition methods ***/
#define ISpeechGrammarRuleStateTransition_get_Type(This,Type) (This)->lpVtbl->get_Type(This,Type)
#define ISpeechGrammarRuleStateTransition_get_Text(This,Text) (This)->lpVtbl->get_Text(This,Text)
#define ISpeechGrammarRuleStateTransition_get_Rule(This,Rule) (This)->lpVtbl->get_Rule(This,Rule)
#define ISpeechGrammarRuleStateTransition_get_Weight(This,Weight) (This)->lpVtbl->get_Weight(This,Weight)
#define ISpeechGrammarRuleStateTransition_get_PropertyName(This,PropertyName) (This)->lpVtbl->get_PropertyName(This,PropertyName)
#define ISpeechGrammarRuleStateTransition_get_PropertyId(This,PropertyId) (This)->lpVtbl->get_PropertyId(This,PropertyId)
#define ISpeechGrammarRuleStateTransition_get_PropertyValue(This,PropertyValue) (This)->lpVtbl->get_PropertyValue(This,PropertyValue)
#define ISpeechGrammarRuleStateTransition_get_NextState(This,NextState) (This)->lpVtbl->get_NextState(This,NextState)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpeechGrammarRuleStateTransition_QueryInterface(ISpeechGrammarRuleStateTransition* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpeechGrammarRuleStateTransition_AddRef(ISpeechGrammarRuleStateTransition* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpeechGrammarRuleStateTransition_Release(ISpeechGrammarRuleStateTransition* This) {
    return This->lpVtbl->Release(This);
}
/*** IDispatch methods ***/
static FORCEINLINE HRESULT ISpeechGrammarRuleStateTransition_GetTypeInfoCount(ISpeechGrammarRuleStateTransition* This,UINT *pctinfo) {
    return This->lpVtbl->GetTypeInfoCount(This,pctinfo);
}
static FORCEINLINE HRESULT ISpeechGrammarRuleStateTransition_GetTypeInfo(ISpeechGrammarRuleStateTransition* This,UINT iTInfo,LCID lcid,ITypeInfo **ppTInfo) {
    return This->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo);
}
static FORCEINLINE HRESULT ISpeechGrammarRuleStateTransition_GetIDsOfNames(ISpeechGrammarRuleStateTransition* This,REFIID riid,LPOLESTR *rgszNames,UINT cNames,LCID lcid,DISPID *rgDispId) {
    return This->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId);
}
static FORCEINLINE HRESULT ISpeechGrammarRuleStateTransition_Invoke(ISpeechGrammarRuleStateTransition* This,DISPID dispIdMember,REFIID riid,LCID lcid,WORD wFlags,DISPPARAMS *pDispParams,VARIANT *pVarResult,EXCEPINFO *pExcepInfo,UINT *puArgErr) {
    return This->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr);
}
/*** ISpeechGrammarRuleStateTransition methods ***/
static FORCEINLINE HRESULT ISpeechGrammarRuleStateTransition_get_Type(ISpeechGrammarRuleStateTransition* This,SpeechGrammarRuleStateTransitionType *Type) {
    return This->lpVtbl->get_Type(This,Type);
}
static FORCEINLINE HRESULT ISpeechGrammarRuleStateTransition_get_Text(ISpeechGrammarRuleStateTransition* This,BSTR *Text) {
    return This->lpVtbl->get_Text(This,Text);
}
static FORCEINLINE HRESULT ISpeechGrammarRuleStateTransition_get_Rule(ISpeechGrammarRuleStateTransition* This,ISpeechGrammarRule **Rule) {
    return This->lpVtbl->get_Rule(This,Rule);
}
static FORCEINLINE HRESULT ISpeechGrammarRuleStateTransition_get_Weight(ISpeechGrammarRuleStateTransition* This,VARIANT *Weight) {
    return This->lpVtbl->get_Weight(This,Weight);
}
static FORCEINLINE HRESULT ISpeechGrammarRuleStateTransition_get_PropertyName(ISpeechGrammarRuleStateTransition* This,BSTR *PropertyName) {
    return This->lpVtbl->get_PropertyName(This,PropertyName);
}
static FORCEINLINE HRESULT ISpeechGrammarRuleStateTransition_get_PropertyId(ISpeechGrammarRuleStateTransition* This,LONG *PropertyId) {
    return This->lpVtbl->get_PropertyId(This,PropertyId);
}
static FORCEINLINE HRESULT ISpeechGrammarRuleStateTransition_get_PropertyValue(ISpeechGrammarRuleStateTransition* This,VARIANT *PropertyValue) {
    return This->lpVtbl->get_PropertyValue(This,PropertyValue);
}
static FORCEINLINE HRESULT ISpeechGrammarRuleStateTransition_get_NextState(ISpeechGrammarRuleStateTransition* This,ISpeechGrammarRuleState **NextState) {
    return This->lpVtbl->get_NextState(This,NextState);
}
#endif
#endif

#endif


#endif  /* __ISpeechGrammarRuleStateTransition_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpeechTextSelectionInformation interface
 */
#ifndef __ISpeechTextSelectionInformation_INTERFACE_DEFINED__
#define __ISpeechTextSelectionInformation_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpeechTextSelectionInformation, 0x3b9c7e7a, 0x6eee, 0x4ded, 0x90,0x92, 0x11,0x65,0x72,0x79,0xad,0xbe);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("3b9c7e7a-6eee-4ded-9092-11657279adbe")
ISpeechTextSelectionInformation : public IDispatch
{
    virtual HRESULT STDMETHODCALLTYPE put_ActiveOffset(
        LONG ActiveOffset) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_ActiveOffset(
        LONG *ActiveOffset) = 0;

    virtual HRESULT STDMETHODCALLTYPE put_ActiveLength(
        LONG ActiveLength) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_ActiveLength(
        LONG *ActiveLength) = 0;

    virtual HRESULT STDMETHODCALLTYPE put_SelectionOffset(
        LONG SelectionOffset) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_SelectionOffset(
        LONG *SelectionOffset) = 0;

    virtual HRESULT STDMETHODCALLTYPE put_SelectionLength(
        LONG SelectionLength) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_SelectionLength(
        LONG *SelectionLength) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpeechTextSelectionInformation, 0x3b9c7e7a, 0x6eee, 0x4ded, 0x90,0x92, 0x11,0x65,0x72,0x79,0xad,0xbe)
#endif
#else
typedef struct ISpeechTextSelectionInformationVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpeechTextSelectionInformation *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpeechTextSelectionInformation *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpeechTextSelectionInformation *This);

    /*** IDispatch methods ***/
    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
        ISpeechTextSelectionInformation *This,
        UINT *pctinfo);

    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
        ISpeechTextSelectionInformation *This,
        UINT iTInfo,
        LCID lcid,
        ITypeInfo **ppTInfo);

    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
        ISpeechTextSelectionInformation *This,
        REFIID riid,
        LPOLESTR *rgszNames,
        UINT cNames,
        LCID lcid,
        DISPID *rgDispId);

    HRESULT (STDMETHODCALLTYPE *Invoke)(
        ISpeechTextSelectionInformation *This,
        DISPID dispIdMember,
        REFIID riid,
        LCID lcid,
        WORD wFlags,
        DISPPARAMS *pDispParams,
        VARIANT *pVarResult,
        EXCEPINFO *pExcepInfo,
        UINT *puArgErr);

    /*** ISpeechTextSelectionInformation methods ***/
    HRESULT (STDMETHODCALLTYPE *put_ActiveOffset)(
        ISpeechTextSelectionInformation *This,
        LONG ActiveOffset);

    HRESULT (STDMETHODCALLTYPE *get_ActiveOffset)(
        ISpeechTextSelectionInformation *This,
        LONG *ActiveOffset);

    HRESULT (STDMETHODCALLTYPE *put_ActiveLength)(
        ISpeechTextSelectionInformation *This,
        LONG ActiveLength);

    HRESULT (STDMETHODCALLTYPE *get_ActiveLength)(
        ISpeechTextSelectionInformation *This,
        LONG *ActiveLength);

    HRESULT (STDMETHODCALLTYPE *put_SelectionOffset)(
        ISpeechTextSelectionInformation *This,
        LONG SelectionOffset);

    HRESULT (STDMETHODCALLTYPE *get_SelectionOffset)(
        ISpeechTextSelectionInformation *This,
        LONG *SelectionOffset);

    HRESULT (STDMETHODCALLTYPE *put_SelectionLength)(
        ISpeechTextSelectionInformation *This,
        LONG SelectionLength);

    HRESULT (STDMETHODCALLTYPE *get_SelectionLength)(
        ISpeechTextSelectionInformation *This,
        LONG *SelectionLength);

    END_INTERFACE
} ISpeechTextSelectionInformationVtbl;

interface ISpeechTextSelectionInformation {
    CONST_VTBL ISpeechTextSelectionInformationVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpeechTextSelectionInformation_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpeechTextSelectionInformation_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpeechTextSelectionInformation_Release(This) (This)->lpVtbl->Release(This)
/*** IDispatch methods ***/
#define ISpeechTextSelectionInformation_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
#define ISpeechTextSelectionInformation_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
#define ISpeechTextSelectionInformation_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
#define ISpeechTextSelectionInformation_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
/*** ISpeechTextSelectionInformation methods ***/
#define ISpeechTextSelectionInformation_put_ActiveOffset(This,ActiveOffset) (This)->lpVtbl->put_ActiveOffset(This,ActiveOffset)
#define ISpeechTextSelectionInformation_get_ActiveOffset(This,ActiveOffset) (This)->lpVtbl->get_ActiveOffset(This,ActiveOffset)
#define ISpeechTextSelectionInformation_put_ActiveLength(This,ActiveLength) (This)->lpVtbl->put_ActiveLength(This,ActiveLength)
#define ISpeechTextSelectionInformation_get_ActiveLength(This,ActiveLength) (This)->lpVtbl->get_ActiveLength(This,ActiveLength)
#define ISpeechTextSelectionInformation_put_SelectionOffset(This,SelectionOffset) (This)->lpVtbl->put_SelectionOffset(This,SelectionOffset)
#define ISpeechTextSelectionInformation_get_SelectionOffset(This,SelectionOffset) (This)->lpVtbl->get_SelectionOffset(This,SelectionOffset)
#define ISpeechTextSelectionInformation_put_SelectionLength(This,SelectionLength) (This)->lpVtbl->put_SelectionLength(This,SelectionLength)
#define ISpeechTextSelectionInformation_get_SelectionLength(This,SelectionLength) (This)->lpVtbl->get_SelectionLength(This,SelectionLength)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpeechTextSelectionInformation_QueryInterface(ISpeechTextSelectionInformation* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpeechTextSelectionInformation_AddRef(ISpeechTextSelectionInformation* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpeechTextSelectionInformation_Release(ISpeechTextSelectionInformation* This) {
    return This->lpVtbl->Release(This);
}
/*** IDispatch methods ***/
static FORCEINLINE HRESULT ISpeechTextSelectionInformation_GetTypeInfoCount(ISpeechTextSelectionInformation* This,UINT *pctinfo) {
    return This->lpVtbl->GetTypeInfoCount(This,pctinfo);
}
static FORCEINLINE HRESULT ISpeechTextSelectionInformation_GetTypeInfo(ISpeechTextSelectionInformation* This,UINT iTInfo,LCID lcid,ITypeInfo **ppTInfo) {
    return This->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo);
}
static FORCEINLINE HRESULT ISpeechTextSelectionInformation_GetIDsOfNames(ISpeechTextSelectionInformation* This,REFIID riid,LPOLESTR *rgszNames,UINT cNames,LCID lcid,DISPID *rgDispId) {
    return This->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId);
}
static FORCEINLINE HRESULT ISpeechTextSelectionInformation_Invoke(ISpeechTextSelectionInformation* This,DISPID dispIdMember,REFIID riid,LCID lcid,WORD wFlags,DISPPARAMS *pDispParams,VARIANT *pVarResult,EXCEPINFO *pExcepInfo,UINT *puArgErr) {
    return This->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr);
}
/*** ISpeechTextSelectionInformation methods ***/
static FORCEINLINE HRESULT ISpeechTextSelectionInformation_put_ActiveOffset(ISpeechTextSelectionInformation* This,LONG ActiveOffset) {
    return This->lpVtbl->put_ActiveOffset(This,ActiveOffset);
}
static FORCEINLINE HRESULT ISpeechTextSelectionInformation_get_ActiveOffset(ISpeechTextSelectionInformation* This,LONG *ActiveOffset) {
    return This->lpVtbl->get_ActiveOffset(This,ActiveOffset);
}
static FORCEINLINE HRESULT ISpeechTextSelectionInformation_put_ActiveLength(ISpeechTextSelectionInformation* This,LONG ActiveLength) {
    return This->lpVtbl->put_ActiveLength(This,ActiveLength);
}
static FORCEINLINE HRESULT ISpeechTextSelectionInformation_get_ActiveLength(ISpeechTextSelectionInformation* This,LONG *ActiveLength) {
    return This->lpVtbl->get_ActiveLength(This,ActiveLength);
}
static FORCEINLINE HRESULT ISpeechTextSelectionInformation_put_SelectionOffset(ISpeechTextSelectionInformation* This,LONG SelectionOffset) {
    return This->lpVtbl->put_SelectionOffset(This,SelectionOffset);
}
static FORCEINLINE HRESULT ISpeechTextSelectionInformation_get_SelectionOffset(ISpeechTextSelectionInformation* This,LONG *SelectionOffset) {
    return This->lpVtbl->get_SelectionOffset(This,SelectionOffset);
}
static FORCEINLINE HRESULT ISpeechTextSelectionInformation_put_SelectionLength(ISpeechTextSelectionInformation* This,LONG SelectionLength) {
    return This->lpVtbl->put_SelectionLength(This,SelectionLength);
}
static FORCEINLINE HRESULT ISpeechTextSelectionInformation_get_SelectionLength(ISpeechTextSelectionInformation* This,LONG *SelectionLength) {
    return This->lpVtbl->get_SelectionLength(This,SelectionLength);
}
#endif
#endif

#endif


#endif  /* __ISpeechTextSelectionInformation_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpeechRecoResult interface
 */
#ifndef __ISpeechRecoResult_INTERFACE_DEFINED__
#define __ISpeechRecoResult_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpeechRecoResult, 0xed2879cf, 0xced9, 0x4ee6, 0xa5,0x34, 0xde,0x01,0x91,0xd5,0x46,0x8d);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("ed2879cf-ced9-4ee6-a534-de0191d5468d")
ISpeechRecoResult : public IDispatch
{
    virtual HRESULT STDMETHODCALLTYPE get_RecoContext(
        ISpeechRecoContext **RecoContext) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_Times(
        ISpeechRecoResultTimes **Times) = 0;

    virtual HRESULT STDMETHODCALLTYPE putref_AudioFormat(
        ISpeechAudioFormat *Format) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_AudioFormat(
        ISpeechAudioFormat **Format) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_PhraseInfo(
        ISpeechPhraseInfo **PhraseInfo) = 0;

    virtual HRESULT STDMETHODCALLTYPE Alternates(
        LONG RequestCount,
        LONG StartElement,
        LONG Elements,
        ISpeechPhraseAlternates **Alternates) = 0;

    virtual HRESULT STDMETHODCALLTYPE Audio(
        LONG StartElement,
        LONG Elements,
        ISpeechMemoryStream **Stream) = 0;

    virtual HRESULT STDMETHODCALLTYPE SpeakAudio(
        LONG StartElement,
        LONG Elements,
        SpeechVoiceSpeakFlags Flags,
        LONG *StreamNumber) = 0;

    virtual HRESULT STDMETHODCALLTYPE SaveToMemory(
        VARIANT *ResultBlock) = 0;

    virtual HRESULT STDMETHODCALLTYPE DiscardResultInfo(
        SpeechDiscardType ValueTypes) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpeechRecoResult, 0xed2879cf, 0xced9, 0x4ee6, 0xa5,0x34, 0xde,0x01,0x91,0xd5,0x46,0x8d)
#endif
#else
typedef struct ISpeechRecoResultVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpeechRecoResult *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpeechRecoResult *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpeechRecoResult *This);

    /*** IDispatch methods ***/
    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
        ISpeechRecoResult *This,
        UINT *pctinfo);

    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
        ISpeechRecoResult *This,
        UINT iTInfo,
        LCID lcid,
        ITypeInfo **ppTInfo);

    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
        ISpeechRecoResult *This,
        REFIID riid,
        LPOLESTR *rgszNames,
        UINT cNames,
        LCID lcid,
        DISPID *rgDispId);

    HRESULT (STDMETHODCALLTYPE *Invoke)(
        ISpeechRecoResult *This,
        DISPID dispIdMember,
        REFIID riid,
        LCID lcid,
        WORD wFlags,
        DISPPARAMS *pDispParams,
        VARIANT *pVarResult,
        EXCEPINFO *pExcepInfo,
        UINT *puArgErr);

    /*** ISpeechRecoResult methods ***/
    HRESULT (STDMETHODCALLTYPE *get_RecoContext)(
        ISpeechRecoResult *This,
        ISpeechRecoContext **RecoContext);

    HRESULT (STDMETHODCALLTYPE *get_Times)(
        ISpeechRecoResult *This,
        ISpeechRecoResultTimes **Times);

    HRESULT (STDMETHODCALLTYPE *putref_AudioFormat)(
        ISpeechRecoResult *This,
        ISpeechAudioFormat *Format);

    HRESULT (STDMETHODCALLTYPE *get_AudioFormat)(
        ISpeechRecoResult *This,
        ISpeechAudioFormat **Format);

    HRESULT (STDMETHODCALLTYPE *get_PhraseInfo)(
        ISpeechRecoResult *This,
        ISpeechPhraseInfo **PhraseInfo);

    HRESULT (STDMETHODCALLTYPE *Alternates)(
        ISpeechRecoResult *This,
        LONG RequestCount,
        LONG StartElement,
        LONG Elements,
        ISpeechPhraseAlternates **Alternates);

    HRESULT (STDMETHODCALLTYPE *Audio)(
        ISpeechRecoResult *This,
        LONG StartElement,
        LONG Elements,
        ISpeechMemoryStream **Stream);

    HRESULT (STDMETHODCALLTYPE *SpeakAudio)(
        ISpeechRecoResult *This,
        LONG StartElement,
        LONG Elements,
        SpeechVoiceSpeakFlags Flags,
        LONG *StreamNumber);

    HRESULT (STDMETHODCALLTYPE *SaveToMemory)(
        ISpeechRecoResult *This,
        VARIANT *ResultBlock);

    HRESULT (STDMETHODCALLTYPE *DiscardResultInfo)(
        ISpeechRecoResult *This,
        SpeechDiscardType ValueTypes);

    END_INTERFACE
} ISpeechRecoResultVtbl;

interface ISpeechRecoResult {
    CONST_VTBL ISpeechRecoResultVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpeechRecoResult_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpeechRecoResult_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpeechRecoResult_Release(This) (This)->lpVtbl->Release(This)
/*** IDispatch methods ***/
#define ISpeechRecoResult_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
#define ISpeechRecoResult_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
#define ISpeechRecoResult_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
#define ISpeechRecoResult_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
/*** ISpeechRecoResult methods ***/
#define ISpeechRecoResult_get_RecoContext(This,RecoContext) (This)->lpVtbl->get_RecoContext(This,RecoContext)
#define ISpeechRecoResult_get_Times(This,Times) (This)->lpVtbl->get_Times(This,Times)
#define ISpeechRecoResult_putref_AudioFormat(This,Format) (This)->lpVtbl->putref_AudioFormat(This,Format)
#define ISpeechRecoResult_get_AudioFormat(This,Format) (This)->lpVtbl->get_AudioFormat(This,Format)
#define ISpeechRecoResult_get_PhraseInfo(This,PhraseInfo) (This)->lpVtbl->get_PhraseInfo(This,PhraseInfo)
#define ISpeechRecoResult_Alternates(This,RequestCount,StartElement,Elements,Alternates) (This)->lpVtbl->Alternates(This,RequestCount,StartElement,Elements,Alternates)
#define ISpeechRecoResult_Audio(This,StartElement,Elements,Stream) (This)->lpVtbl->Audio(This,StartElement,Elements,Stream)
#define ISpeechRecoResult_SpeakAudio(This,StartElement,Elements,Flags,StreamNumber) (This)->lpVtbl->SpeakAudio(This,StartElement,Elements,Flags,StreamNumber)
#define ISpeechRecoResult_SaveToMemory(This,ResultBlock) (This)->lpVtbl->SaveToMemory(This,ResultBlock)
#define ISpeechRecoResult_DiscardResultInfo(This,ValueTypes) (This)->lpVtbl->DiscardResultInfo(This,ValueTypes)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpeechRecoResult_QueryInterface(ISpeechRecoResult* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpeechRecoResult_AddRef(ISpeechRecoResult* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpeechRecoResult_Release(ISpeechRecoResult* This) {
    return This->lpVtbl->Release(This);
}
/*** IDispatch methods ***/
static FORCEINLINE HRESULT ISpeechRecoResult_GetTypeInfoCount(ISpeechRecoResult* This,UINT *pctinfo) {
    return This->lpVtbl->GetTypeInfoCount(This,pctinfo);
}
static FORCEINLINE HRESULT ISpeechRecoResult_GetTypeInfo(ISpeechRecoResult* This,UINT iTInfo,LCID lcid,ITypeInfo **ppTInfo) {
    return This->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo);
}
static FORCEINLINE HRESULT ISpeechRecoResult_GetIDsOfNames(ISpeechRecoResult* This,REFIID riid,LPOLESTR *rgszNames,UINT cNames,LCID lcid,DISPID *rgDispId) {
    return This->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId);
}
static FORCEINLINE HRESULT ISpeechRecoResult_Invoke(ISpeechRecoResult* This,DISPID dispIdMember,REFIID riid,LCID lcid,WORD wFlags,DISPPARAMS *pDispParams,VARIANT *pVarResult,EXCEPINFO *pExcepInfo,UINT *puArgErr) {
    return This->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr);
}
/*** ISpeechRecoResult methods ***/
static FORCEINLINE HRESULT ISpeechRecoResult_get_RecoContext(ISpeechRecoResult* This,ISpeechRecoContext **RecoContext) {
    return This->lpVtbl->get_RecoContext(This,RecoContext);
}
static FORCEINLINE HRESULT ISpeechRecoResult_get_Times(ISpeechRecoResult* This,ISpeechRecoResultTimes **Times) {
    return This->lpVtbl->get_Times(This,Times);
}
static FORCEINLINE HRESULT ISpeechRecoResult_putref_AudioFormat(ISpeechRecoResult* This,ISpeechAudioFormat *Format) {
    return This->lpVtbl->putref_AudioFormat(This,Format);
}
static FORCEINLINE HRESULT ISpeechRecoResult_get_AudioFormat(ISpeechRecoResult* This,ISpeechAudioFormat **Format) {
    return This->lpVtbl->get_AudioFormat(This,Format);
}
static FORCEINLINE HRESULT ISpeechRecoResult_get_PhraseInfo(ISpeechRecoResult* This,ISpeechPhraseInfo **PhraseInfo) {
    return This->lpVtbl->get_PhraseInfo(This,PhraseInfo);
}
static FORCEINLINE HRESULT ISpeechRecoResult_Alternates(ISpeechRecoResult* This,LONG RequestCount,LONG StartElement,LONG Elements,ISpeechPhraseAlternates **Alternates) {
    return This->lpVtbl->Alternates(This,RequestCount,StartElement,Elements,Alternates);
}
static FORCEINLINE HRESULT ISpeechRecoResult_Audio(ISpeechRecoResult* This,LONG StartElement,LONG Elements,ISpeechMemoryStream **Stream) {
    return This->lpVtbl->Audio(This,StartElement,Elements,Stream);
}
static FORCEINLINE HRESULT ISpeechRecoResult_SpeakAudio(ISpeechRecoResult* This,LONG StartElement,LONG Elements,SpeechVoiceSpeakFlags Flags,LONG *StreamNumber) {
    return This->lpVtbl->SpeakAudio(This,StartElement,Elements,Flags,StreamNumber);
}
static FORCEINLINE HRESULT ISpeechRecoResult_SaveToMemory(ISpeechRecoResult* This,VARIANT *ResultBlock) {
    return This->lpVtbl->SaveToMemory(This,ResultBlock);
}
static FORCEINLINE HRESULT ISpeechRecoResult_DiscardResultInfo(ISpeechRecoResult* This,SpeechDiscardType ValueTypes) {
    return This->lpVtbl->DiscardResultInfo(This,ValueTypes);
}
#endif
#endif

#endif


#endif  /* __ISpeechRecoResult_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpeechXMLRecoResult interface
 */
#ifndef __ISpeechXMLRecoResult_INTERFACE_DEFINED__
#define __ISpeechXMLRecoResult_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpeechXMLRecoResult, 0xaaec54af, 0x8f85, 0x4924, 0x94,0x4d, 0xb7,0x9d,0x39,0xd7,0x2e,0x19);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("aaec54af-8f85-4924-944d-b79d39d72e19")
ISpeechXMLRecoResult : public ISpeechRecoResult
{
    virtual HRESULT STDMETHODCALLTYPE GetXMLResult(
        SPXMLRESULTOPTIONS Options,
        BSTR *pResult) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetXMLErrorInfo(
        LONG *LineNumber,
        BSTR *ScriptLine,
        BSTR *Source,
        BSTR *Description,
        LONG *ResultCode,
        VARIANT_BOOL *IsError) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpeechXMLRecoResult, 0xaaec54af, 0x8f85, 0x4924, 0x94,0x4d, 0xb7,0x9d,0x39,0xd7,0x2e,0x19)
#endif
#else
typedef struct ISpeechXMLRecoResultVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpeechXMLRecoResult *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpeechXMLRecoResult *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpeechXMLRecoResult *This);

    /*** IDispatch methods ***/
    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
        ISpeechXMLRecoResult *This,
        UINT *pctinfo);

    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
        ISpeechXMLRecoResult *This,
        UINT iTInfo,
        LCID lcid,
        ITypeInfo **ppTInfo);

    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
        ISpeechXMLRecoResult *This,
        REFIID riid,
        LPOLESTR *rgszNames,
        UINT cNames,
        LCID lcid,
        DISPID *rgDispId);

    HRESULT (STDMETHODCALLTYPE *Invoke)(
        ISpeechXMLRecoResult *This,
        DISPID dispIdMember,
        REFIID riid,
        LCID lcid,
        WORD wFlags,
        DISPPARAMS *pDispParams,
        VARIANT *pVarResult,
        EXCEPINFO *pExcepInfo,
        UINT *puArgErr);

    /*** ISpeechRecoResult methods ***/
    HRESULT (STDMETHODCALLTYPE *get_RecoContext)(
        ISpeechXMLRecoResult *This,
        ISpeechRecoContext **RecoContext);

    HRESULT (STDMETHODCALLTYPE *get_Times)(
        ISpeechXMLRecoResult *This,
        ISpeechRecoResultTimes **Times);

    HRESULT (STDMETHODCALLTYPE *putref_AudioFormat)(
        ISpeechXMLRecoResult *This,
        ISpeechAudioFormat *Format);

    HRESULT (STDMETHODCALLTYPE *get_AudioFormat)(
        ISpeechXMLRecoResult *This,
        ISpeechAudioFormat **Format);

    HRESULT (STDMETHODCALLTYPE *get_PhraseInfo)(
        ISpeechXMLRecoResult *This,
        ISpeechPhraseInfo **PhraseInfo);

    HRESULT (STDMETHODCALLTYPE *Alternates)(
        ISpeechXMLRecoResult *This,
        LONG RequestCount,
        LONG StartElement,
        LONG Elements,
        ISpeechPhraseAlternates **Alternates);

    HRESULT (STDMETHODCALLTYPE *Audio)(
        ISpeechXMLRecoResult *This,
        LONG StartElement,
        LONG Elements,
        ISpeechMemoryStream **Stream);

    HRESULT (STDMETHODCALLTYPE *SpeakAudio)(
        ISpeechXMLRecoResult *This,
        LONG StartElement,
        LONG Elements,
        SpeechVoiceSpeakFlags Flags,
        LONG *StreamNumber);

    HRESULT (STDMETHODCALLTYPE *SaveToMemory)(
        ISpeechXMLRecoResult *This,
        VARIANT *ResultBlock);

    HRESULT (STDMETHODCALLTYPE *DiscardResultInfo)(
        ISpeechXMLRecoResult *This,
        SpeechDiscardType ValueTypes);

    /*** ISpeechXMLRecoResult methods ***/
    HRESULT (STDMETHODCALLTYPE *GetXMLResult)(
        ISpeechXMLRecoResult *This,
        SPXMLRESULTOPTIONS Options,
        BSTR *pResult);

    HRESULT (STDMETHODCALLTYPE *GetXMLErrorInfo)(
        ISpeechXMLRecoResult *This,
        LONG *LineNumber,
        BSTR *ScriptLine,
        BSTR *Source,
        BSTR *Description,
        LONG *ResultCode,
        VARIANT_BOOL *IsError);

    END_INTERFACE
} ISpeechXMLRecoResultVtbl;

interface ISpeechXMLRecoResult {
    CONST_VTBL ISpeechXMLRecoResultVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpeechXMLRecoResult_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpeechXMLRecoResult_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpeechXMLRecoResult_Release(This) (This)->lpVtbl->Release(This)
/*** IDispatch methods ***/
#define ISpeechXMLRecoResult_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
#define ISpeechXMLRecoResult_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
#define ISpeechXMLRecoResult_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
#define ISpeechXMLRecoResult_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
/*** ISpeechRecoResult methods ***/
#define ISpeechXMLRecoResult_get_RecoContext(This,RecoContext) (This)->lpVtbl->get_RecoContext(This,RecoContext)
#define ISpeechXMLRecoResult_get_Times(This,Times) (This)->lpVtbl->get_Times(This,Times)
#define ISpeechXMLRecoResult_putref_AudioFormat(This,Format) (This)->lpVtbl->putref_AudioFormat(This,Format)
#define ISpeechXMLRecoResult_get_AudioFormat(This,Format) (This)->lpVtbl->get_AudioFormat(This,Format)
#define ISpeechXMLRecoResult_get_PhraseInfo(This,PhraseInfo) (This)->lpVtbl->get_PhraseInfo(This,PhraseInfo)
#define ISpeechXMLRecoResult_Alternates(This,RequestCount,StartElement,Elements,Alternates) (This)->lpVtbl->Alternates(This,RequestCount,StartElement,Elements,Alternates)
#define ISpeechXMLRecoResult_Audio(This,StartElement,Elements,Stream) (This)->lpVtbl->Audio(This,StartElement,Elements,Stream)
#define ISpeechXMLRecoResult_SpeakAudio(This,StartElement,Elements,Flags,StreamNumber) (This)->lpVtbl->SpeakAudio(This,StartElement,Elements,Flags,StreamNumber)
#define ISpeechXMLRecoResult_SaveToMemory(This,ResultBlock) (This)->lpVtbl->SaveToMemory(This,ResultBlock)
#define ISpeechXMLRecoResult_DiscardResultInfo(This,ValueTypes) (This)->lpVtbl->DiscardResultInfo(This,ValueTypes)
/*** ISpeechXMLRecoResult methods ***/
#define ISpeechXMLRecoResult_GetXMLResult(This,Options,pResult) (This)->lpVtbl->GetXMLResult(This,Options,pResult)
#define ISpeechXMLRecoResult_GetXMLErrorInfo(This,LineNumber,ScriptLine,Source,Description,ResultCode,IsError) (This)->lpVtbl->GetXMLErrorInfo(This,LineNumber,ScriptLine,Source,Description,ResultCode,IsError)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpeechXMLRecoResult_QueryInterface(ISpeechXMLRecoResult* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpeechXMLRecoResult_AddRef(ISpeechXMLRecoResult* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpeechXMLRecoResult_Release(ISpeechXMLRecoResult* This) {
    return This->lpVtbl->Release(This);
}
/*** IDispatch methods ***/
static FORCEINLINE HRESULT ISpeechXMLRecoResult_GetTypeInfoCount(ISpeechXMLRecoResult* This,UINT *pctinfo) {
    return This->lpVtbl->GetTypeInfoCount(This,pctinfo);
}
static FORCEINLINE HRESULT ISpeechXMLRecoResult_GetTypeInfo(ISpeechXMLRecoResult* This,UINT iTInfo,LCID lcid,ITypeInfo **ppTInfo) {
    return This->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo);
}
static FORCEINLINE HRESULT ISpeechXMLRecoResult_GetIDsOfNames(ISpeechXMLRecoResult* This,REFIID riid,LPOLESTR *rgszNames,UINT cNames,LCID lcid,DISPID *rgDispId) {
    return This->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId);
}
static FORCEINLINE HRESULT ISpeechXMLRecoResult_Invoke(ISpeechXMLRecoResult* This,DISPID dispIdMember,REFIID riid,LCID lcid,WORD wFlags,DISPPARAMS *pDispParams,VARIANT *pVarResult,EXCEPINFO *pExcepInfo,UINT *puArgErr) {
    return This->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr);
}
/*** ISpeechRecoResult methods ***/
static FORCEINLINE HRESULT ISpeechXMLRecoResult_get_RecoContext(ISpeechXMLRecoResult* This,ISpeechRecoContext **RecoContext) {
    return This->lpVtbl->get_RecoContext(This,RecoContext);
}
static FORCEINLINE HRESULT ISpeechXMLRecoResult_get_Times(ISpeechXMLRecoResult* This,ISpeechRecoResultTimes **Times) {
    return This->lpVtbl->get_Times(This,Times);
}
static FORCEINLINE HRESULT ISpeechXMLRecoResult_putref_AudioFormat(ISpeechXMLRecoResult* This,ISpeechAudioFormat *Format) {
    return This->lpVtbl->putref_AudioFormat(This,Format);
}
static FORCEINLINE HRESULT ISpeechXMLRecoResult_get_AudioFormat(ISpeechXMLRecoResult* This,ISpeechAudioFormat **Format) {
    return This->lpVtbl->get_AudioFormat(This,Format);
}
static FORCEINLINE HRESULT ISpeechXMLRecoResult_get_PhraseInfo(ISpeechXMLRecoResult* This,ISpeechPhraseInfo **PhraseInfo) {
    return This->lpVtbl->get_PhraseInfo(This,PhraseInfo);
}
static FORCEINLINE HRESULT ISpeechXMLRecoResult_Alternates(ISpeechXMLRecoResult* This,LONG RequestCount,LONG StartElement,LONG Elements,ISpeechPhraseAlternates **Alternates) {
    return This->lpVtbl->Alternates(This,RequestCount,StartElement,Elements,Alternates);
}
static FORCEINLINE HRESULT ISpeechXMLRecoResult_Audio(ISpeechXMLRecoResult* This,LONG StartElement,LONG Elements,ISpeechMemoryStream **Stream) {
    return This->lpVtbl->Audio(This,StartElement,Elements,Stream);
}
static FORCEINLINE HRESULT ISpeechXMLRecoResult_SpeakAudio(ISpeechXMLRecoResult* This,LONG StartElement,LONG Elements,SpeechVoiceSpeakFlags Flags,LONG *StreamNumber) {
    return This->lpVtbl->SpeakAudio(This,StartElement,Elements,Flags,StreamNumber);
}
static FORCEINLINE HRESULT ISpeechXMLRecoResult_SaveToMemory(ISpeechXMLRecoResult* This,VARIANT *ResultBlock) {
    return This->lpVtbl->SaveToMemory(This,ResultBlock);
}
static FORCEINLINE HRESULT ISpeechXMLRecoResult_DiscardResultInfo(ISpeechXMLRecoResult* This,SpeechDiscardType ValueTypes) {
    return This->lpVtbl->DiscardResultInfo(This,ValueTypes);
}
/*** ISpeechXMLRecoResult methods ***/
static FORCEINLINE HRESULT ISpeechXMLRecoResult_GetXMLResult(ISpeechXMLRecoResult* This,SPXMLRESULTOPTIONS Options,BSTR *pResult) {
    return This->lpVtbl->GetXMLResult(This,Options,pResult);
}
static FORCEINLINE HRESULT ISpeechXMLRecoResult_GetXMLErrorInfo(ISpeechXMLRecoResult* This,LONG *LineNumber,BSTR *ScriptLine,BSTR *Source,BSTR *Description,LONG *ResultCode,VARIANT_BOOL *IsError) {
    return This->lpVtbl->GetXMLErrorInfo(This,LineNumber,ScriptLine,Source,Description,ResultCode,IsError);
}
#endif
#endif

#endif


#endif  /* __ISpeechXMLRecoResult_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpeechRecoResult2 interface
 */
#ifndef __ISpeechRecoResult2_INTERFACE_DEFINED__
#define __ISpeechRecoResult2_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpeechRecoResult2, 0x8e0a246d, 0xd3c8, 0x45de, 0x86,0x57, 0x04,0x29,0x0c,0x45,0x8c,0x3c);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("8e0a246d-d3c8-45de-8657-04290c458c3c")
ISpeechRecoResult2 : public ISpeechRecoResult
{
    virtual HRESULT STDMETHODCALLTYPE SetTextFeedback(
        BSTR Feedback,
        VARIANT_BOOL WasSuccessful) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpeechRecoResult2, 0x8e0a246d, 0xd3c8, 0x45de, 0x86,0x57, 0x04,0x29,0x0c,0x45,0x8c,0x3c)
#endif
#else
typedef struct ISpeechRecoResult2Vtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpeechRecoResult2 *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpeechRecoResult2 *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpeechRecoResult2 *This);

    /*** IDispatch methods ***/
    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
        ISpeechRecoResult2 *This,
        UINT *pctinfo);

    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
        ISpeechRecoResult2 *This,
        UINT iTInfo,
        LCID lcid,
        ITypeInfo **ppTInfo);

    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
        ISpeechRecoResult2 *This,
        REFIID riid,
        LPOLESTR *rgszNames,
        UINT cNames,
        LCID lcid,
        DISPID *rgDispId);

    HRESULT (STDMETHODCALLTYPE *Invoke)(
        ISpeechRecoResult2 *This,
        DISPID dispIdMember,
        REFIID riid,
        LCID lcid,
        WORD wFlags,
        DISPPARAMS *pDispParams,
        VARIANT *pVarResult,
        EXCEPINFO *pExcepInfo,
        UINT *puArgErr);

    /*** ISpeechRecoResult methods ***/
    HRESULT (STDMETHODCALLTYPE *get_RecoContext)(
        ISpeechRecoResult2 *This,
        ISpeechRecoContext **RecoContext);

    HRESULT (STDMETHODCALLTYPE *get_Times)(
        ISpeechRecoResult2 *This,
        ISpeechRecoResultTimes **Times);

    HRESULT (STDMETHODCALLTYPE *putref_AudioFormat)(
        ISpeechRecoResult2 *This,
        ISpeechAudioFormat *Format);

    HRESULT (STDMETHODCALLTYPE *get_AudioFormat)(
        ISpeechRecoResult2 *This,
        ISpeechAudioFormat **Format);

    HRESULT (STDMETHODCALLTYPE *get_PhraseInfo)(
        ISpeechRecoResult2 *This,
        ISpeechPhraseInfo **PhraseInfo);

    HRESULT (STDMETHODCALLTYPE *Alternates)(
        ISpeechRecoResult2 *This,
        LONG RequestCount,
        LONG StartElement,
        LONG Elements,
        ISpeechPhraseAlternates **Alternates);

    HRESULT (STDMETHODCALLTYPE *Audio)(
        ISpeechRecoResult2 *This,
        LONG StartElement,
        LONG Elements,
        ISpeechMemoryStream **Stream);

    HRESULT (STDMETHODCALLTYPE *SpeakAudio)(
        ISpeechRecoResult2 *This,
        LONG StartElement,
        LONG Elements,
        SpeechVoiceSpeakFlags Flags,
        LONG *StreamNumber);

    HRESULT (STDMETHODCALLTYPE *SaveToMemory)(
        ISpeechRecoResult2 *This,
        VARIANT *ResultBlock);

    HRESULT (STDMETHODCALLTYPE *DiscardResultInfo)(
        ISpeechRecoResult2 *This,
        SpeechDiscardType ValueTypes);

    /*** ISpeechRecoResult2 methods ***/
    HRESULT (STDMETHODCALLTYPE *SetTextFeedback)(
        ISpeechRecoResult2 *This,
        BSTR Feedback,
        VARIANT_BOOL WasSuccessful);

    END_INTERFACE
} ISpeechRecoResult2Vtbl;

interface ISpeechRecoResult2 {
    CONST_VTBL ISpeechRecoResult2Vtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpeechRecoResult2_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpeechRecoResult2_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpeechRecoResult2_Release(This) (This)->lpVtbl->Release(This)
/*** IDispatch methods ***/
#define ISpeechRecoResult2_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
#define ISpeechRecoResult2_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
#define ISpeechRecoResult2_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
#define ISpeechRecoResult2_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
/*** ISpeechRecoResult methods ***/
#define ISpeechRecoResult2_get_RecoContext(This,RecoContext) (This)->lpVtbl->get_RecoContext(This,RecoContext)
#define ISpeechRecoResult2_get_Times(This,Times) (This)->lpVtbl->get_Times(This,Times)
#define ISpeechRecoResult2_putref_AudioFormat(This,Format) (This)->lpVtbl->putref_AudioFormat(This,Format)
#define ISpeechRecoResult2_get_AudioFormat(This,Format) (This)->lpVtbl->get_AudioFormat(This,Format)
#define ISpeechRecoResult2_get_PhraseInfo(This,PhraseInfo) (This)->lpVtbl->get_PhraseInfo(This,PhraseInfo)
#define ISpeechRecoResult2_Alternates(This,RequestCount,StartElement,Elements,Alternates) (This)->lpVtbl->Alternates(This,RequestCount,StartElement,Elements,Alternates)
#define ISpeechRecoResult2_Audio(This,StartElement,Elements,Stream) (This)->lpVtbl->Audio(This,StartElement,Elements,Stream)
#define ISpeechRecoResult2_SpeakAudio(This,StartElement,Elements,Flags,StreamNumber) (This)->lpVtbl->SpeakAudio(This,StartElement,Elements,Flags,StreamNumber)
#define ISpeechRecoResult2_SaveToMemory(This,ResultBlock) (This)->lpVtbl->SaveToMemory(This,ResultBlock)
#define ISpeechRecoResult2_DiscardResultInfo(This,ValueTypes) (This)->lpVtbl->DiscardResultInfo(This,ValueTypes)
/*** ISpeechRecoResult2 methods ***/
#define ISpeechRecoResult2_SetTextFeedback(This,Feedback,WasSuccessful) (This)->lpVtbl->SetTextFeedback(This,Feedback,WasSuccessful)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpeechRecoResult2_QueryInterface(ISpeechRecoResult2* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpeechRecoResult2_AddRef(ISpeechRecoResult2* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpeechRecoResult2_Release(ISpeechRecoResult2* This) {
    return This->lpVtbl->Release(This);
}
/*** IDispatch methods ***/
static FORCEINLINE HRESULT ISpeechRecoResult2_GetTypeInfoCount(ISpeechRecoResult2* This,UINT *pctinfo) {
    return This->lpVtbl->GetTypeInfoCount(This,pctinfo);
}
static FORCEINLINE HRESULT ISpeechRecoResult2_GetTypeInfo(ISpeechRecoResult2* This,UINT iTInfo,LCID lcid,ITypeInfo **ppTInfo) {
    return This->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo);
}
static FORCEINLINE HRESULT ISpeechRecoResult2_GetIDsOfNames(ISpeechRecoResult2* This,REFIID riid,LPOLESTR *rgszNames,UINT cNames,LCID lcid,DISPID *rgDispId) {
    return This->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId);
}
static FORCEINLINE HRESULT ISpeechRecoResult2_Invoke(ISpeechRecoResult2* This,DISPID dispIdMember,REFIID riid,LCID lcid,WORD wFlags,DISPPARAMS *pDispParams,VARIANT *pVarResult,EXCEPINFO *pExcepInfo,UINT *puArgErr) {
    return This->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr);
}
/*** ISpeechRecoResult methods ***/
static FORCEINLINE HRESULT ISpeechRecoResult2_get_RecoContext(ISpeechRecoResult2* This,ISpeechRecoContext **RecoContext) {
    return This->lpVtbl->get_RecoContext(This,RecoContext);
}
static FORCEINLINE HRESULT ISpeechRecoResult2_get_Times(ISpeechRecoResult2* This,ISpeechRecoResultTimes **Times) {
    return This->lpVtbl->get_Times(This,Times);
}
static FORCEINLINE HRESULT ISpeechRecoResult2_putref_AudioFormat(ISpeechRecoResult2* This,ISpeechAudioFormat *Format) {
    return This->lpVtbl->putref_AudioFormat(This,Format);
}
static FORCEINLINE HRESULT ISpeechRecoResult2_get_AudioFormat(ISpeechRecoResult2* This,ISpeechAudioFormat **Format) {
    return This->lpVtbl->get_AudioFormat(This,Format);
}
static FORCEINLINE HRESULT ISpeechRecoResult2_get_PhraseInfo(ISpeechRecoResult2* This,ISpeechPhraseInfo **PhraseInfo) {
    return This->lpVtbl->get_PhraseInfo(This,PhraseInfo);
}
static FORCEINLINE HRESULT ISpeechRecoResult2_Alternates(ISpeechRecoResult2* This,LONG RequestCount,LONG StartElement,LONG Elements,ISpeechPhraseAlternates **Alternates) {
    return This->lpVtbl->Alternates(This,RequestCount,StartElement,Elements,Alternates);
}
static FORCEINLINE HRESULT ISpeechRecoResult2_Audio(ISpeechRecoResult2* This,LONG StartElement,LONG Elements,ISpeechMemoryStream **Stream) {
    return This->lpVtbl->Audio(This,StartElement,Elements,Stream);
}
static FORCEINLINE HRESULT ISpeechRecoResult2_SpeakAudio(ISpeechRecoResult2* This,LONG StartElement,LONG Elements,SpeechVoiceSpeakFlags Flags,LONG *StreamNumber) {
    return This->lpVtbl->SpeakAudio(This,StartElement,Elements,Flags,StreamNumber);
}
static FORCEINLINE HRESULT ISpeechRecoResult2_SaveToMemory(ISpeechRecoResult2* This,VARIANT *ResultBlock) {
    return This->lpVtbl->SaveToMemory(This,ResultBlock);
}
static FORCEINLINE HRESULT ISpeechRecoResult2_DiscardResultInfo(ISpeechRecoResult2* This,SpeechDiscardType ValueTypes) {
    return This->lpVtbl->DiscardResultInfo(This,ValueTypes);
}
/*** ISpeechRecoResult2 methods ***/
static FORCEINLINE HRESULT ISpeechRecoResult2_SetTextFeedback(ISpeechRecoResult2* This,BSTR Feedback,VARIANT_BOOL WasSuccessful) {
    return This->lpVtbl->SetTextFeedback(This,Feedback,WasSuccessful);
}
#endif
#endif

#endif


#endif  /* __ISpeechRecoResult2_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpeechRecoResultDispatch interface
 */
#ifndef __ISpeechRecoResultDispatch_INTERFACE_DEFINED__
#define __ISpeechRecoResultDispatch_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpeechRecoResultDispatch, 0x6d60eb64, 0xaced, 0x40a6, 0xbb,0xf3, 0x4e,0x55,0x7f,0x71,0xde,0xe2);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("6d60eb64-aced-40a6-bbf3-4e557f71dee2")
ISpeechRecoResultDispatch : public IDispatch
{
    virtual HRESULT STDMETHODCALLTYPE get_RecoContext(
        ISpeechRecoContext **RecoContext) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_Times(
        ISpeechRecoResultTimes **Times) = 0;

    virtual HRESULT STDMETHODCALLTYPE putref_AudioFormat(
        ISpeechAudioFormat *Format) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_AudioFormat(
        ISpeechAudioFormat **Format) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_PhraseInfo(
        ISpeechPhraseInfo **PhraseInfo) = 0;

    virtual HRESULT STDMETHODCALLTYPE Alternates(
        LONG RequestCount,
        LONG StartElement,
        LONG Elements,
        ISpeechPhraseAlternates **Alternates) = 0;

    virtual HRESULT STDMETHODCALLTYPE Audio(
        LONG StartElement,
        LONG Elements,
        ISpeechMemoryStream **Stream) = 0;

    virtual HRESULT STDMETHODCALLTYPE SpeakAudio(
        LONG StartElement,
        LONG Elements,
        SpeechVoiceSpeakFlags Flags,
        LONG *StreamNumber) = 0;

    virtual HRESULT STDMETHODCALLTYPE SaveToMemory(
        VARIANT *ResultBlock) = 0;

    virtual HRESULT STDMETHODCALLTYPE DiscardResultInfo(
        SpeechDiscardType ValueTypes) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetXMLResult(
        SPXMLRESULTOPTIONS Options,
        BSTR *pResult) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetXMLErrorInfo(
        LONG *LineNumber,
        BSTR *ScriptLine,
        BSTR *Source,
        BSTR *Description,
        HRESULT *ResultCode,
        VARIANT_BOOL *IsError) = 0;

    virtual HRESULT STDMETHODCALLTYPE SetTextFeedback(
        BSTR Feedback,
        VARIANT_BOOL WasSuccessful) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpeechRecoResultDispatch, 0x6d60eb64, 0xaced, 0x40a6, 0xbb,0xf3, 0x4e,0x55,0x7f,0x71,0xde,0xe2)
#endif
#else
typedef struct ISpeechRecoResultDispatchVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpeechRecoResultDispatch *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpeechRecoResultDispatch *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpeechRecoResultDispatch *This);

    /*** IDispatch methods ***/
    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
        ISpeechRecoResultDispatch *This,
        UINT *pctinfo);

    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
        ISpeechRecoResultDispatch *This,
        UINT iTInfo,
        LCID lcid,
        ITypeInfo **ppTInfo);

    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
        ISpeechRecoResultDispatch *This,
        REFIID riid,
        LPOLESTR *rgszNames,
        UINT cNames,
        LCID lcid,
        DISPID *rgDispId);

    HRESULT (STDMETHODCALLTYPE *Invoke)(
        ISpeechRecoResultDispatch *This,
        DISPID dispIdMember,
        REFIID riid,
        LCID lcid,
        WORD wFlags,
        DISPPARAMS *pDispParams,
        VARIANT *pVarResult,
        EXCEPINFO *pExcepInfo,
        UINT *puArgErr);

    /*** ISpeechRecoResultDispatch methods ***/
    HRESULT (STDMETHODCALLTYPE *get_RecoContext)(
        ISpeechRecoResultDispatch *This,
        ISpeechRecoContext **RecoContext);

    HRESULT (STDMETHODCALLTYPE *get_Times)(
        ISpeechRecoResultDispatch *This,
        ISpeechRecoResultTimes **Times);

    HRESULT (STDMETHODCALLTYPE *putref_AudioFormat)(
        ISpeechRecoResultDispatch *This,
        ISpeechAudioFormat *Format);

    HRESULT (STDMETHODCALLTYPE *get_AudioFormat)(
        ISpeechRecoResultDispatch *This,
        ISpeechAudioFormat **Format);

    HRESULT (STDMETHODCALLTYPE *get_PhraseInfo)(
        ISpeechRecoResultDispatch *This,
        ISpeechPhraseInfo **PhraseInfo);

    HRESULT (STDMETHODCALLTYPE *Alternates)(
        ISpeechRecoResultDispatch *This,
        LONG RequestCount,
        LONG StartElement,
        LONG Elements,
        ISpeechPhraseAlternates **Alternates);

    HRESULT (STDMETHODCALLTYPE *Audio)(
        ISpeechRecoResultDispatch *This,
        LONG StartElement,
        LONG Elements,
        ISpeechMemoryStream **Stream);

    HRESULT (STDMETHODCALLTYPE *SpeakAudio)(
        ISpeechRecoResultDispatch *This,
        LONG StartElement,
        LONG Elements,
        SpeechVoiceSpeakFlags Flags,
        LONG *StreamNumber);

    HRESULT (STDMETHODCALLTYPE *SaveToMemory)(
        ISpeechRecoResultDispatch *This,
        VARIANT *ResultBlock);

    HRESULT (STDMETHODCALLTYPE *DiscardResultInfo)(
        ISpeechRecoResultDispatch *This,
        SpeechDiscardType ValueTypes);

    HRESULT (STDMETHODCALLTYPE *GetXMLResult)(
        ISpeechRecoResultDispatch *This,
        SPXMLRESULTOPTIONS Options,
        BSTR *pResult);

    HRESULT (STDMETHODCALLTYPE *GetXMLErrorInfo)(
        ISpeechRecoResultDispatch *This,
        LONG *LineNumber,
        BSTR *ScriptLine,
        BSTR *Source,
        BSTR *Description,
        HRESULT *ResultCode,
        VARIANT_BOOL *IsError);

    HRESULT (STDMETHODCALLTYPE *SetTextFeedback)(
        ISpeechRecoResultDispatch *This,
        BSTR Feedback,
        VARIANT_BOOL WasSuccessful);

    END_INTERFACE
} ISpeechRecoResultDispatchVtbl;

interface ISpeechRecoResultDispatch {
    CONST_VTBL ISpeechRecoResultDispatchVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpeechRecoResultDispatch_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpeechRecoResultDispatch_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpeechRecoResultDispatch_Release(This) (This)->lpVtbl->Release(This)
/*** IDispatch methods ***/
#define ISpeechRecoResultDispatch_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
#define ISpeechRecoResultDispatch_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
#define ISpeechRecoResultDispatch_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
#define ISpeechRecoResultDispatch_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
/*** ISpeechRecoResultDispatch methods ***/
#define ISpeechRecoResultDispatch_get_RecoContext(This,RecoContext) (This)->lpVtbl->get_RecoContext(This,RecoContext)
#define ISpeechRecoResultDispatch_get_Times(This,Times) (This)->lpVtbl->get_Times(This,Times)
#define ISpeechRecoResultDispatch_putref_AudioFormat(This,Format) (This)->lpVtbl->putref_AudioFormat(This,Format)
#define ISpeechRecoResultDispatch_get_AudioFormat(This,Format) (This)->lpVtbl->get_AudioFormat(This,Format)
#define ISpeechRecoResultDispatch_get_PhraseInfo(This,PhraseInfo) (This)->lpVtbl->get_PhraseInfo(This,PhraseInfo)
#define ISpeechRecoResultDispatch_Alternates(This,RequestCount,StartElement,Elements,Alternates) (This)->lpVtbl->Alternates(This,RequestCount,StartElement,Elements,Alternates)
#define ISpeechRecoResultDispatch_Audio(This,StartElement,Elements,Stream) (This)->lpVtbl->Audio(This,StartElement,Elements,Stream)
#define ISpeechRecoResultDispatch_SpeakAudio(This,StartElement,Elements,Flags,StreamNumber) (This)->lpVtbl->SpeakAudio(This,StartElement,Elements,Flags,StreamNumber)
#define ISpeechRecoResultDispatch_SaveToMemory(This,ResultBlock) (This)->lpVtbl->SaveToMemory(This,ResultBlock)
#define ISpeechRecoResultDispatch_DiscardResultInfo(This,ValueTypes) (This)->lpVtbl->DiscardResultInfo(This,ValueTypes)
#define ISpeechRecoResultDispatch_GetXMLResult(This,Options,pResult) (This)->lpVtbl->GetXMLResult(This,Options,pResult)
#define ISpeechRecoResultDispatch_GetXMLErrorInfo(This,LineNumber,ScriptLine,Source,Description,ResultCode,IsError) (This)->lpVtbl->GetXMLErrorInfo(This,LineNumber,ScriptLine,Source,Description,ResultCode,IsError)
#define ISpeechRecoResultDispatch_SetTextFeedback(This,Feedback,WasSuccessful) (This)->lpVtbl->SetTextFeedback(This,Feedback,WasSuccessful)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpeechRecoResultDispatch_QueryInterface(ISpeechRecoResultDispatch* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpeechRecoResultDispatch_AddRef(ISpeechRecoResultDispatch* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpeechRecoResultDispatch_Release(ISpeechRecoResultDispatch* This) {
    return This->lpVtbl->Release(This);
}
/*** IDispatch methods ***/
static FORCEINLINE HRESULT ISpeechRecoResultDispatch_GetTypeInfoCount(ISpeechRecoResultDispatch* This,UINT *pctinfo) {
    return This->lpVtbl->GetTypeInfoCount(This,pctinfo);
}
static FORCEINLINE HRESULT ISpeechRecoResultDispatch_GetTypeInfo(ISpeechRecoResultDispatch* This,UINT iTInfo,LCID lcid,ITypeInfo **ppTInfo) {
    return This->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo);
}
static FORCEINLINE HRESULT ISpeechRecoResultDispatch_GetIDsOfNames(ISpeechRecoResultDispatch* This,REFIID riid,LPOLESTR *rgszNames,UINT cNames,LCID lcid,DISPID *rgDispId) {
    return This->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId);
}
static FORCEINLINE HRESULT ISpeechRecoResultDispatch_Invoke(ISpeechRecoResultDispatch* This,DISPID dispIdMember,REFIID riid,LCID lcid,WORD wFlags,DISPPARAMS *pDispParams,VARIANT *pVarResult,EXCEPINFO *pExcepInfo,UINT *puArgErr) {
    return This->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr);
}
/*** ISpeechRecoResultDispatch methods ***/
static FORCEINLINE HRESULT ISpeechRecoResultDispatch_get_RecoContext(ISpeechRecoResultDispatch* This,ISpeechRecoContext **RecoContext) {
    return This->lpVtbl->get_RecoContext(This,RecoContext);
}
static FORCEINLINE HRESULT ISpeechRecoResultDispatch_get_Times(ISpeechRecoResultDispatch* This,ISpeechRecoResultTimes **Times) {
    return This->lpVtbl->get_Times(This,Times);
}
static FORCEINLINE HRESULT ISpeechRecoResultDispatch_putref_AudioFormat(ISpeechRecoResultDispatch* This,ISpeechAudioFormat *Format) {
    return This->lpVtbl->putref_AudioFormat(This,Format);
}
static FORCEINLINE HRESULT ISpeechRecoResultDispatch_get_AudioFormat(ISpeechRecoResultDispatch* This,ISpeechAudioFormat **Format) {
    return This->lpVtbl->get_AudioFormat(This,Format);
}
static FORCEINLINE HRESULT ISpeechRecoResultDispatch_get_PhraseInfo(ISpeechRecoResultDispatch* This,ISpeechPhraseInfo **PhraseInfo) {
    return This->lpVtbl->get_PhraseInfo(This,PhraseInfo);
}
static FORCEINLINE HRESULT ISpeechRecoResultDispatch_Alternates(ISpeechRecoResultDispatch* This,LONG RequestCount,LONG StartElement,LONG Elements,ISpeechPhraseAlternates **Alternates) {
    return This->lpVtbl->Alternates(This,RequestCount,StartElement,Elements,Alternates);
}
static FORCEINLINE HRESULT ISpeechRecoResultDispatch_Audio(ISpeechRecoResultDispatch* This,LONG StartElement,LONG Elements,ISpeechMemoryStream **Stream) {
    return This->lpVtbl->Audio(This,StartElement,Elements,Stream);
}
static FORCEINLINE HRESULT ISpeechRecoResultDispatch_SpeakAudio(ISpeechRecoResultDispatch* This,LONG StartElement,LONG Elements,SpeechVoiceSpeakFlags Flags,LONG *StreamNumber) {
    return This->lpVtbl->SpeakAudio(This,StartElement,Elements,Flags,StreamNumber);
}
static FORCEINLINE HRESULT ISpeechRecoResultDispatch_SaveToMemory(ISpeechRecoResultDispatch* This,VARIANT *ResultBlock) {
    return This->lpVtbl->SaveToMemory(This,ResultBlock);
}
static FORCEINLINE HRESULT ISpeechRecoResultDispatch_DiscardResultInfo(ISpeechRecoResultDispatch* This,SpeechDiscardType ValueTypes) {
    return This->lpVtbl->DiscardResultInfo(This,ValueTypes);
}
static FORCEINLINE HRESULT ISpeechRecoResultDispatch_GetXMLResult(ISpeechRecoResultDispatch* This,SPXMLRESULTOPTIONS Options,BSTR *pResult) {
    return This->lpVtbl->GetXMLResult(This,Options,pResult);
}
static FORCEINLINE HRESULT ISpeechRecoResultDispatch_GetXMLErrorInfo(ISpeechRecoResultDispatch* This,LONG *LineNumber,BSTR *ScriptLine,BSTR *Source,BSTR *Description,HRESULT *ResultCode,VARIANT_BOOL *IsError) {
    return This->lpVtbl->GetXMLErrorInfo(This,LineNumber,ScriptLine,Source,Description,ResultCode,IsError);
}
static FORCEINLINE HRESULT ISpeechRecoResultDispatch_SetTextFeedback(ISpeechRecoResultDispatch* This,BSTR Feedback,VARIANT_BOOL WasSuccessful) {
    return This->lpVtbl->SetTextFeedback(This,Feedback,WasSuccessful);
}
#endif
#endif

#endif


#endif  /* __ISpeechRecoResultDispatch_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpeechPhraseInfoBuilder interface
 */
#ifndef __ISpeechPhraseInfoBuilder_INTERFACE_DEFINED__
#define __ISpeechPhraseInfoBuilder_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpeechPhraseInfoBuilder, 0x3b151836, 0xdf3a, 0x4e0a, 0x84,0x6c, 0xd2,0xad,0xc9,0x33,0x43,0x33);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("3b151836-df3a-4e0a-846c-d2adc9334333")
ISpeechPhraseInfoBuilder : public IDispatch
{
    virtual HRESULT STDMETHODCALLTYPE RestorePhraseFromMemory(
        VARIANT *PhraseInMemory,
        ISpeechPhraseInfo **PhraseInfo) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpeechPhraseInfoBuilder, 0x3b151836, 0xdf3a, 0x4e0a, 0x84,0x6c, 0xd2,0xad,0xc9,0x33,0x43,0x33)
#endif
#else
typedef struct ISpeechPhraseInfoBuilderVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpeechPhraseInfoBuilder *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpeechPhraseInfoBuilder *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpeechPhraseInfoBuilder *This);

    /*** IDispatch methods ***/
    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
        ISpeechPhraseInfoBuilder *This,
        UINT *pctinfo);

    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
        ISpeechPhraseInfoBuilder *This,
        UINT iTInfo,
        LCID lcid,
        ITypeInfo **ppTInfo);

    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
        ISpeechPhraseInfoBuilder *This,
        REFIID riid,
        LPOLESTR *rgszNames,
        UINT cNames,
        LCID lcid,
        DISPID *rgDispId);

    HRESULT (STDMETHODCALLTYPE *Invoke)(
        ISpeechPhraseInfoBuilder *This,
        DISPID dispIdMember,
        REFIID riid,
        LCID lcid,
        WORD wFlags,
        DISPPARAMS *pDispParams,
        VARIANT *pVarResult,
        EXCEPINFO *pExcepInfo,
        UINT *puArgErr);

    /*** ISpeechPhraseInfoBuilder methods ***/
    HRESULT (STDMETHODCALLTYPE *RestorePhraseFromMemory)(
        ISpeechPhraseInfoBuilder *This,
        VARIANT *PhraseInMemory,
        ISpeechPhraseInfo **PhraseInfo);

    END_INTERFACE
} ISpeechPhraseInfoBuilderVtbl;

interface ISpeechPhraseInfoBuilder {
    CONST_VTBL ISpeechPhraseInfoBuilderVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpeechPhraseInfoBuilder_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpeechPhraseInfoBuilder_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpeechPhraseInfoBuilder_Release(This) (This)->lpVtbl->Release(This)
/*** IDispatch methods ***/
#define ISpeechPhraseInfoBuilder_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
#define ISpeechPhraseInfoBuilder_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
#define ISpeechPhraseInfoBuilder_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
#define ISpeechPhraseInfoBuilder_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
/*** ISpeechPhraseInfoBuilder methods ***/
#define ISpeechPhraseInfoBuilder_RestorePhraseFromMemory(This,PhraseInMemory,PhraseInfo) (This)->lpVtbl->RestorePhraseFromMemory(This,PhraseInMemory,PhraseInfo)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpeechPhraseInfoBuilder_QueryInterface(ISpeechPhraseInfoBuilder* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpeechPhraseInfoBuilder_AddRef(ISpeechPhraseInfoBuilder* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpeechPhraseInfoBuilder_Release(ISpeechPhraseInfoBuilder* This) {
    return This->lpVtbl->Release(This);
}
/*** IDispatch methods ***/
static FORCEINLINE HRESULT ISpeechPhraseInfoBuilder_GetTypeInfoCount(ISpeechPhraseInfoBuilder* This,UINT *pctinfo) {
    return This->lpVtbl->GetTypeInfoCount(This,pctinfo);
}
static FORCEINLINE HRESULT ISpeechPhraseInfoBuilder_GetTypeInfo(ISpeechPhraseInfoBuilder* This,UINT iTInfo,LCID lcid,ITypeInfo **ppTInfo) {
    return This->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo);
}
static FORCEINLINE HRESULT ISpeechPhraseInfoBuilder_GetIDsOfNames(ISpeechPhraseInfoBuilder* This,REFIID riid,LPOLESTR *rgszNames,UINT cNames,LCID lcid,DISPID *rgDispId) {
    return This->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId);
}
static FORCEINLINE HRESULT ISpeechPhraseInfoBuilder_Invoke(ISpeechPhraseInfoBuilder* This,DISPID dispIdMember,REFIID riid,LCID lcid,WORD wFlags,DISPPARAMS *pDispParams,VARIANT *pVarResult,EXCEPINFO *pExcepInfo,UINT *puArgErr) {
    return This->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr);
}
/*** ISpeechPhraseInfoBuilder methods ***/
static FORCEINLINE HRESULT ISpeechPhraseInfoBuilder_RestorePhraseFromMemory(ISpeechPhraseInfoBuilder* This,VARIANT *PhraseInMemory,ISpeechPhraseInfo **PhraseInfo) {
    return This->lpVtbl->RestorePhraseFromMemory(This,PhraseInMemory,PhraseInfo);
}
#endif
#endif

#endif


#endif  /* __ISpeechPhraseInfoBuilder_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpeechRecoResultTimes interface
 */
#ifndef __ISpeechRecoResultTimes_INTERFACE_DEFINED__
#define __ISpeechRecoResultTimes_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpeechRecoResultTimes, 0x62b3b8fb, 0xf6e7, 0x41be, 0xbd,0xcb, 0x05,0x6b,0x1c,0x29,0xef,0xc0);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("62b3b8fb-f6e7-41be-bdcb-056b1c29efc0")
ISpeechRecoResultTimes : public IDispatch
{
    virtual HRESULT STDMETHODCALLTYPE get_StreamTime(
        VARIANT *Time) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_Length(
        VARIANT *Length) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_TickCount(
        LONG *TickCount) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_OffsetFromStart(
        VARIANT *OffsetFromStart) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpeechRecoResultTimes, 0x62b3b8fb, 0xf6e7, 0x41be, 0xbd,0xcb, 0x05,0x6b,0x1c,0x29,0xef,0xc0)
#endif
#else
typedef struct ISpeechRecoResultTimesVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpeechRecoResultTimes *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpeechRecoResultTimes *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpeechRecoResultTimes *This);

    /*** IDispatch methods ***/
    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
        ISpeechRecoResultTimes *This,
        UINT *pctinfo);

    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
        ISpeechRecoResultTimes *This,
        UINT iTInfo,
        LCID lcid,
        ITypeInfo **ppTInfo);

    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
        ISpeechRecoResultTimes *This,
        REFIID riid,
        LPOLESTR *rgszNames,
        UINT cNames,
        LCID lcid,
        DISPID *rgDispId);

    HRESULT (STDMETHODCALLTYPE *Invoke)(
        ISpeechRecoResultTimes *This,
        DISPID dispIdMember,
        REFIID riid,
        LCID lcid,
        WORD wFlags,
        DISPPARAMS *pDispParams,
        VARIANT *pVarResult,
        EXCEPINFO *pExcepInfo,
        UINT *puArgErr);

    /*** ISpeechRecoResultTimes methods ***/
    HRESULT (STDMETHODCALLTYPE *get_StreamTime)(
        ISpeechRecoResultTimes *This,
        VARIANT *Time);

    HRESULT (STDMETHODCALLTYPE *get_Length)(
        ISpeechRecoResultTimes *This,
        VARIANT *Length);

    HRESULT (STDMETHODCALLTYPE *get_TickCount)(
        ISpeechRecoResultTimes *This,
        LONG *TickCount);

    HRESULT (STDMETHODCALLTYPE *get_OffsetFromStart)(
        ISpeechRecoResultTimes *This,
        VARIANT *OffsetFromStart);

    END_INTERFACE
} ISpeechRecoResultTimesVtbl;

interface ISpeechRecoResultTimes {
    CONST_VTBL ISpeechRecoResultTimesVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpeechRecoResultTimes_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpeechRecoResultTimes_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpeechRecoResultTimes_Release(This) (This)->lpVtbl->Release(This)
/*** IDispatch methods ***/
#define ISpeechRecoResultTimes_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
#define ISpeechRecoResultTimes_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
#define ISpeechRecoResultTimes_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
#define ISpeechRecoResultTimes_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
/*** ISpeechRecoResultTimes methods ***/
#define ISpeechRecoResultTimes_get_StreamTime(This,Time) (This)->lpVtbl->get_StreamTime(This,Time)
#define ISpeechRecoResultTimes_get_Length(This,Length) (This)->lpVtbl->get_Length(This,Length)
#define ISpeechRecoResultTimes_get_TickCount(This,TickCount) (This)->lpVtbl->get_TickCount(This,TickCount)
#define ISpeechRecoResultTimes_get_OffsetFromStart(This,OffsetFromStart) (This)->lpVtbl->get_OffsetFromStart(This,OffsetFromStart)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpeechRecoResultTimes_QueryInterface(ISpeechRecoResultTimes* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpeechRecoResultTimes_AddRef(ISpeechRecoResultTimes* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpeechRecoResultTimes_Release(ISpeechRecoResultTimes* This) {
    return This->lpVtbl->Release(This);
}
/*** IDispatch methods ***/
static FORCEINLINE HRESULT ISpeechRecoResultTimes_GetTypeInfoCount(ISpeechRecoResultTimes* This,UINT *pctinfo) {
    return This->lpVtbl->GetTypeInfoCount(This,pctinfo);
}
static FORCEINLINE HRESULT ISpeechRecoResultTimes_GetTypeInfo(ISpeechRecoResultTimes* This,UINT iTInfo,LCID lcid,ITypeInfo **ppTInfo) {
    return This->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo);
}
static FORCEINLINE HRESULT ISpeechRecoResultTimes_GetIDsOfNames(ISpeechRecoResultTimes* This,REFIID riid,LPOLESTR *rgszNames,UINT cNames,LCID lcid,DISPID *rgDispId) {
    return This->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId);
}
static FORCEINLINE HRESULT ISpeechRecoResultTimes_Invoke(ISpeechRecoResultTimes* This,DISPID dispIdMember,REFIID riid,LCID lcid,WORD wFlags,DISPPARAMS *pDispParams,VARIANT *pVarResult,EXCEPINFO *pExcepInfo,UINT *puArgErr) {
    return This->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr);
}
/*** ISpeechRecoResultTimes methods ***/
static FORCEINLINE HRESULT ISpeechRecoResultTimes_get_StreamTime(ISpeechRecoResultTimes* This,VARIANT *Time) {
    return This->lpVtbl->get_StreamTime(This,Time);
}
static FORCEINLINE HRESULT ISpeechRecoResultTimes_get_Length(ISpeechRecoResultTimes* This,VARIANT *Length) {
    return This->lpVtbl->get_Length(This,Length);
}
static FORCEINLINE HRESULT ISpeechRecoResultTimes_get_TickCount(ISpeechRecoResultTimes* This,LONG *TickCount) {
    return This->lpVtbl->get_TickCount(This,TickCount);
}
static FORCEINLINE HRESULT ISpeechRecoResultTimes_get_OffsetFromStart(ISpeechRecoResultTimes* This,VARIANT *OffsetFromStart) {
    return This->lpVtbl->get_OffsetFromStart(This,OffsetFromStart);
}
#endif
#endif

#endif


#endif  /* __ISpeechRecoResultTimes_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpeechPhraseAlternate interface
 */
#ifndef __ISpeechPhraseAlternate_INTERFACE_DEFINED__
#define __ISpeechPhraseAlternate_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpeechPhraseAlternate, 0x27864a2a, 0x2b9f, 0x4cb8, 0x92,0xd3, 0x0d,0x27,0x22,0xfd,0x1e,0x73);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("27864a2a-2b9f-4cb8-92d3-0d2722fd1e73")
ISpeechPhraseAlternate : public IDispatch
{
    virtual HRESULT STDMETHODCALLTYPE get_RecoResult(
        ISpeechRecoResult **RecoResult) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_StartElementInResult(
        LONG *StartElement) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_NumberOfElementsInResult(
        LONG *NumberOfElements) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_PhraseInfo(
        ISpeechPhraseInfo **PhraseInfo) = 0;

    virtual HRESULT STDMETHODCALLTYPE Commit(
        ) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpeechPhraseAlternate, 0x27864a2a, 0x2b9f, 0x4cb8, 0x92,0xd3, 0x0d,0x27,0x22,0xfd,0x1e,0x73)
#endif
#else
typedef struct ISpeechPhraseAlternateVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpeechPhraseAlternate *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpeechPhraseAlternate *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpeechPhraseAlternate *This);

    /*** IDispatch methods ***/
    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
        ISpeechPhraseAlternate *This,
        UINT *pctinfo);

    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
        ISpeechPhraseAlternate *This,
        UINT iTInfo,
        LCID lcid,
        ITypeInfo **ppTInfo);

    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
        ISpeechPhraseAlternate *This,
        REFIID riid,
        LPOLESTR *rgszNames,
        UINT cNames,
        LCID lcid,
        DISPID *rgDispId);

    HRESULT (STDMETHODCALLTYPE *Invoke)(
        ISpeechPhraseAlternate *This,
        DISPID dispIdMember,
        REFIID riid,
        LCID lcid,
        WORD wFlags,
        DISPPARAMS *pDispParams,
        VARIANT *pVarResult,
        EXCEPINFO *pExcepInfo,
        UINT *puArgErr);

    /*** ISpeechPhraseAlternate methods ***/
    HRESULT (STDMETHODCALLTYPE *get_RecoResult)(
        ISpeechPhraseAlternate *This,
        ISpeechRecoResult **RecoResult);

    HRESULT (STDMETHODCALLTYPE *get_StartElementInResult)(
        ISpeechPhraseAlternate *This,
        LONG *StartElement);

    HRESULT (STDMETHODCALLTYPE *get_NumberOfElementsInResult)(
        ISpeechPhraseAlternate *This,
        LONG *NumberOfElements);

    HRESULT (STDMETHODCALLTYPE *get_PhraseInfo)(
        ISpeechPhraseAlternate *This,
        ISpeechPhraseInfo **PhraseInfo);

    HRESULT (STDMETHODCALLTYPE *Commit)(
        ISpeechPhraseAlternate *This);

    END_INTERFACE
} ISpeechPhraseAlternateVtbl;

interface ISpeechPhraseAlternate {
    CONST_VTBL ISpeechPhraseAlternateVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpeechPhraseAlternate_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpeechPhraseAlternate_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpeechPhraseAlternate_Release(This) (This)->lpVtbl->Release(This)
/*** IDispatch methods ***/
#define ISpeechPhraseAlternate_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
#define ISpeechPhraseAlternate_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
#define ISpeechPhraseAlternate_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
#define ISpeechPhraseAlternate_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
/*** ISpeechPhraseAlternate methods ***/
#define ISpeechPhraseAlternate_get_RecoResult(This,RecoResult) (This)->lpVtbl->get_RecoResult(This,RecoResult)
#define ISpeechPhraseAlternate_get_StartElementInResult(This,StartElement) (This)->lpVtbl->get_StartElementInResult(This,StartElement)
#define ISpeechPhraseAlternate_get_NumberOfElementsInResult(This,NumberOfElements) (This)->lpVtbl->get_NumberOfElementsInResult(This,NumberOfElements)
#define ISpeechPhraseAlternate_get_PhraseInfo(This,PhraseInfo) (This)->lpVtbl->get_PhraseInfo(This,PhraseInfo)
#define ISpeechPhraseAlternate_Commit(This) (This)->lpVtbl->Commit(This)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpeechPhraseAlternate_QueryInterface(ISpeechPhraseAlternate* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpeechPhraseAlternate_AddRef(ISpeechPhraseAlternate* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpeechPhraseAlternate_Release(ISpeechPhraseAlternate* This) {
    return This->lpVtbl->Release(This);
}
/*** IDispatch methods ***/
static FORCEINLINE HRESULT ISpeechPhraseAlternate_GetTypeInfoCount(ISpeechPhraseAlternate* This,UINT *pctinfo) {
    return This->lpVtbl->GetTypeInfoCount(This,pctinfo);
}
static FORCEINLINE HRESULT ISpeechPhraseAlternate_GetTypeInfo(ISpeechPhraseAlternate* This,UINT iTInfo,LCID lcid,ITypeInfo **ppTInfo) {
    return This->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo);
}
static FORCEINLINE HRESULT ISpeechPhraseAlternate_GetIDsOfNames(ISpeechPhraseAlternate* This,REFIID riid,LPOLESTR *rgszNames,UINT cNames,LCID lcid,DISPID *rgDispId) {
    return This->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId);
}
static FORCEINLINE HRESULT ISpeechPhraseAlternate_Invoke(ISpeechPhraseAlternate* This,DISPID dispIdMember,REFIID riid,LCID lcid,WORD wFlags,DISPPARAMS *pDispParams,VARIANT *pVarResult,EXCEPINFO *pExcepInfo,UINT *puArgErr) {
    return This->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr);
}
/*** ISpeechPhraseAlternate methods ***/
static FORCEINLINE HRESULT ISpeechPhraseAlternate_get_RecoResult(ISpeechPhraseAlternate* This,ISpeechRecoResult **RecoResult) {
    return This->lpVtbl->get_RecoResult(This,RecoResult);
}
static FORCEINLINE HRESULT ISpeechPhraseAlternate_get_StartElementInResult(ISpeechPhraseAlternate* This,LONG *StartElement) {
    return This->lpVtbl->get_StartElementInResult(This,StartElement);
}
static FORCEINLINE HRESULT ISpeechPhraseAlternate_get_NumberOfElementsInResult(ISpeechPhraseAlternate* This,LONG *NumberOfElements) {
    return This->lpVtbl->get_NumberOfElementsInResult(This,NumberOfElements);
}
static FORCEINLINE HRESULT ISpeechPhraseAlternate_get_PhraseInfo(ISpeechPhraseAlternate* This,ISpeechPhraseInfo **PhraseInfo) {
    return This->lpVtbl->get_PhraseInfo(This,PhraseInfo);
}
static FORCEINLINE HRESULT ISpeechPhraseAlternate_Commit(ISpeechPhraseAlternate* This) {
    return This->lpVtbl->Commit(This);
}
#endif
#endif

#endif


#endif  /* __ISpeechPhraseAlternate_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpeechPhraseAlternates interface
 */
#ifndef __ISpeechPhraseAlternates_INTERFACE_DEFINED__
#define __ISpeechPhraseAlternates_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpeechPhraseAlternates, 0xb238b6d5, 0xf276, 0x4c3d, 0xa6,0xc1, 0x29,0x74,0x80,0x1c,0x3c,0xc2);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("b238b6d5-f276-4c3d-a6c1-2974801c3cc2")
ISpeechPhraseAlternates : public IDispatch
{
    virtual HRESULT STDMETHODCALLTYPE get_Count(
        LONG *Count) = 0;

    virtual HRESULT STDMETHODCALLTYPE Item(
        LONG Index,
        ISpeechPhraseAlternate **PhraseAlternate) = 0;

    virtual HRESULT STDMETHODCALLTYPE get__NewEnum(
        IUnknown **EnumVARIANT) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpeechPhraseAlternates, 0xb238b6d5, 0xf276, 0x4c3d, 0xa6,0xc1, 0x29,0x74,0x80,0x1c,0x3c,0xc2)
#endif
#else
typedef struct ISpeechPhraseAlternatesVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpeechPhraseAlternates *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpeechPhraseAlternates *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpeechPhraseAlternates *This);

    /*** IDispatch methods ***/
    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
        ISpeechPhraseAlternates *This,
        UINT *pctinfo);

    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
        ISpeechPhraseAlternates *This,
        UINT iTInfo,
        LCID lcid,
        ITypeInfo **ppTInfo);

    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
        ISpeechPhraseAlternates *This,
        REFIID riid,
        LPOLESTR *rgszNames,
        UINT cNames,
        LCID lcid,
        DISPID *rgDispId);

    HRESULT (STDMETHODCALLTYPE *Invoke)(
        ISpeechPhraseAlternates *This,
        DISPID dispIdMember,
        REFIID riid,
        LCID lcid,
        WORD wFlags,
        DISPPARAMS *pDispParams,
        VARIANT *pVarResult,
        EXCEPINFO *pExcepInfo,
        UINT *puArgErr);

    /*** ISpeechPhraseAlternates methods ***/
    HRESULT (STDMETHODCALLTYPE *get_Count)(
        ISpeechPhraseAlternates *This,
        LONG *Count);

    HRESULT (STDMETHODCALLTYPE *Item)(
        ISpeechPhraseAlternates *This,
        LONG Index,
        ISpeechPhraseAlternate **PhraseAlternate);

    HRESULT (STDMETHODCALLTYPE *get__NewEnum)(
        ISpeechPhraseAlternates *This,
        IUnknown **EnumVARIANT);

    END_INTERFACE
} ISpeechPhraseAlternatesVtbl;

interface ISpeechPhraseAlternates {
    CONST_VTBL ISpeechPhraseAlternatesVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpeechPhraseAlternates_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpeechPhraseAlternates_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpeechPhraseAlternates_Release(This) (This)->lpVtbl->Release(This)
/*** IDispatch methods ***/
#define ISpeechPhraseAlternates_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
#define ISpeechPhraseAlternates_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
#define ISpeechPhraseAlternates_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
#define ISpeechPhraseAlternates_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
/*** ISpeechPhraseAlternates methods ***/
#define ISpeechPhraseAlternates_get_Count(This,Count) (This)->lpVtbl->get_Count(This,Count)
#define ISpeechPhraseAlternates_Item(This,Index,PhraseAlternate) (This)->lpVtbl->Item(This,Index,PhraseAlternate)
#define ISpeechPhraseAlternates_get__NewEnum(This,EnumVARIANT) (This)->lpVtbl->get__NewEnum(This,EnumVARIANT)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpeechPhraseAlternates_QueryInterface(ISpeechPhraseAlternates* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpeechPhraseAlternates_AddRef(ISpeechPhraseAlternates* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpeechPhraseAlternates_Release(ISpeechPhraseAlternates* This) {
    return This->lpVtbl->Release(This);
}
/*** IDispatch methods ***/
static FORCEINLINE HRESULT ISpeechPhraseAlternates_GetTypeInfoCount(ISpeechPhraseAlternates* This,UINT *pctinfo) {
    return This->lpVtbl->GetTypeInfoCount(This,pctinfo);
}
static FORCEINLINE HRESULT ISpeechPhraseAlternates_GetTypeInfo(ISpeechPhraseAlternates* This,UINT iTInfo,LCID lcid,ITypeInfo **ppTInfo) {
    return This->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo);
}
static FORCEINLINE HRESULT ISpeechPhraseAlternates_GetIDsOfNames(ISpeechPhraseAlternates* This,REFIID riid,LPOLESTR *rgszNames,UINT cNames,LCID lcid,DISPID *rgDispId) {
    return This->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId);
}
static FORCEINLINE HRESULT ISpeechPhraseAlternates_Invoke(ISpeechPhraseAlternates* This,DISPID dispIdMember,REFIID riid,LCID lcid,WORD wFlags,DISPPARAMS *pDispParams,VARIANT *pVarResult,EXCEPINFO *pExcepInfo,UINT *puArgErr) {
    return This->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr);
}
/*** ISpeechPhraseAlternates methods ***/
static FORCEINLINE HRESULT ISpeechPhraseAlternates_get_Count(ISpeechPhraseAlternates* This,LONG *Count) {
    return This->lpVtbl->get_Count(This,Count);
}
static FORCEINLINE HRESULT ISpeechPhraseAlternates_Item(ISpeechPhraseAlternates* This,LONG Index,ISpeechPhraseAlternate **PhraseAlternate) {
    return This->lpVtbl->Item(This,Index,PhraseAlternate);
}
static FORCEINLINE HRESULT ISpeechPhraseAlternates_get__NewEnum(ISpeechPhraseAlternates* This,IUnknown **EnumVARIANT) {
    return This->lpVtbl->get__NewEnum(This,EnumVARIANT);
}
#endif
#endif

#endif


#endif  /* __ISpeechPhraseAlternates_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpeechPhraseInfo interface
 */
#ifndef __ISpeechPhraseInfo_INTERFACE_DEFINED__
#define __ISpeechPhraseInfo_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpeechPhraseInfo, 0x961559cf, 0x4e67, 0x4662, 0x8b,0xf0, 0xd9,0x3f,0x1f,0xcd,0x61,0xb3);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("961559cf-4e67-4662-8bf0-d93f1fcd61b3")
ISpeechPhraseInfo : public IDispatch
{
    virtual HRESULT STDMETHODCALLTYPE get_LanguageId(
        LONG *LanguageId) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_GrammarId(
        VARIANT *GrammarId) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_StartTime(
        VARIANT *StartTime) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_AudioStreamPosition(
        VARIANT *AudioStreamPosition) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_AudioSizeBytes(
        LONG *pAudioSizeBytes) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_RetainedSizeBytes(
        LONG *RetainedSizeBytes) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_AudioSizeTime(
        LONG *AudioSizeTime) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_Rule(
        ISpeechPhraseRule **Rule) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_Properties(
        ISpeechPhraseProperties **Properties) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_Elements(
        ISpeechPhraseElements **Elements) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_Replacements(
        ISpeechPhraseReplacements **Replacements) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_EngineId(
        BSTR *EngineIdGuid) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_EnginePrivateData(
        VARIANT *PrivateData) = 0;

    virtual HRESULT STDMETHODCALLTYPE SaveToMemory(
        VARIANT *PhraseBlock) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetText(
        LONG StartElement,
        LONG Elements,
        VARIANT_BOOL UseReplacements,
        BSTR *Text) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetDisplayAttributes(
        LONG StartElement,
        LONG Elements,
        VARIANT_BOOL UseReplacements,
        SpeechDisplayAttributes *DisplayAttributes) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpeechPhraseInfo, 0x961559cf, 0x4e67, 0x4662, 0x8b,0xf0, 0xd9,0x3f,0x1f,0xcd,0x61,0xb3)
#endif
#else
typedef struct ISpeechPhraseInfoVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpeechPhraseInfo *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpeechPhraseInfo *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpeechPhraseInfo *This);

    /*** IDispatch methods ***/
    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
        ISpeechPhraseInfo *This,
        UINT *pctinfo);

    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
        ISpeechPhraseInfo *This,
        UINT iTInfo,
        LCID lcid,
        ITypeInfo **ppTInfo);

    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
        ISpeechPhraseInfo *This,
        REFIID riid,
        LPOLESTR *rgszNames,
        UINT cNames,
        LCID lcid,
        DISPID *rgDispId);

    HRESULT (STDMETHODCALLTYPE *Invoke)(
        ISpeechPhraseInfo *This,
        DISPID dispIdMember,
        REFIID riid,
        LCID lcid,
        WORD wFlags,
        DISPPARAMS *pDispParams,
        VARIANT *pVarResult,
        EXCEPINFO *pExcepInfo,
        UINT *puArgErr);

    /*** ISpeechPhraseInfo methods ***/
    HRESULT (STDMETHODCALLTYPE *get_LanguageId)(
        ISpeechPhraseInfo *This,
        LONG *LanguageId);

    HRESULT (STDMETHODCALLTYPE *get_GrammarId)(
        ISpeechPhraseInfo *This,
        VARIANT *GrammarId);

    HRESULT (STDMETHODCALLTYPE *get_StartTime)(
        ISpeechPhraseInfo *This,
        VARIANT *StartTime);

    HRESULT (STDMETHODCALLTYPE *get_AudioStreamPosition)(
        ISpeechPhraseInfo *This,
        VARIANT *AudioStreamPosition);

    HRESULT (STDMETHODCALLTYPE *get_AudioSizeBytes)(
        ISpeechPhraseInfo *This,
        LONG *pAudioSizeBytes);

    HRESULT (STDMETHODCALLTYPE *get_RetainedSizeBytes)(
        ISpeechPhraseInfo *This,
        LONG *RetainedSizeBytes);

    HRESULT (STDMETHODCALLTYPE *get_AudioSizeTime)(
        ISpeechPhraseInfo *This,
        LONG *AudioSizeTime);

    HRESULT (STDMETHODCALLTYPE *get_Rule)(
        ISpeechPhraseInfo *This,
        ISpeechPhraseRule **Rule);

    HRESULT (STDMETHODCALLTYPE *get_Properties)(
        ISpeechPhraseInfo *This,
        ISpeechPhraseProperties **Properties);

    HRESULT (STDMETHODCALLTYPE *get_Elements)(
        ISpeechPhraseInfo *This,
        ISpeechPhraseElements **Elements);

    HRESULT (STDMETHODCALLTYPE *get_Replacements)(
        ISpeechPhraseInfo *This,
        ISpeechPhraseReplacements **Replacements);

    HRESULT (STDMETHODCALLTYPE *get_EngineId)(
        ISpeechPhraseInfo *This,
        BSTR *EngineIdGuid);

    HRESULT (STDMETHODCALLTYPE *get_EnginePrivateData)(
        ISpeechPhraseInfo *This,
        VARIANT *PrivateData);

    HRESULT (STDMETHODCALLTYPE *SaveToMemory)(
        ISpeechPhraseInfo *This,
        VARIANT *PhraseBlock);

    HRESULT (STDMETHODCALLTYPE *GetText)(
        ISpeechPhraseInfo *This,
        LONG StartElement,
        LONG Elements,
        VARIANT_BOOL UseReplacements,
        BSTR *Text);

    HRESULT (STDMETHODCALLTYPE *GetDisplayAttributes)(
        ISpeechPhraseInfo *This,
        LONG StartElement,
        LONG Elements,
        VARIANT_BOOL UseReplacements,
        SpeechDisplayAttributes *DisplayAttributes);

    END_INTERFACE
} ISpeechPhraseInfoVtbl;

interface ISpeechPhraseInfo {
    CONST_VTBL ISpeechPhraseInfoVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpeechPhraseInfo_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpeechPhraseInfo_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpeechPhraseInfo_Release(This) (This)->lpVtbl->Release(This)
/*** IDispatch methods ***/
#define ISpeechPhraseInfo_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
#define ISpeechPhraseInfo_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
#define ISpeechPhraseInfo_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
#define ISpeechPhraseInfo_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
/*** ISpeechPhraseInfo methods ***/
#define ISpeechPhraseInfo_get_LanguageId(This,LanguageId) (This)->lpVtbl->get_LanguageId(This,LanguageId)
#define ISpeechPhraseInfo_get_GrammarId(This,GrammarId) (This)->lpVtbl->get_GrammarId(This,GrammarId)
#define ISpeechPhraseInfo_get_StartTime(This,StartTime) (This)->lpVtbl->get_StartTime(This,StartTime)
#define ISpeechPhraseInfo_get_AudioStreamPosition(This,AudioStreamPosition) (This)->lpVtbl->get_AudioStreamPosition(This,AudioStreamPosition)
#define ISpeechPhraseInfo_get_AudioSizeBytes(This,pAudioSizeBytes) (This)->lpVtbl->get_AudioSizeBytes(This,pAudioSizeBytes)
#define ISpeechPhraseInfo_get_RetainedSizeBytes(This,RetainedSizeBytes) (This)->lpVtbl->get_RetainedSizeBytes(This,RetainedSizeBytes)
#define ISpeechPhraseInfo_get_AudioSizeTime(This,AudioSizeTime) (This)->lpVtbl->get_AudioSizeTime(This,AudioSizeTime)
#define ISpeechPhraseInfo_get_Rule(This,Rule) (This)->lpVtbl->get_Rule(This,Rule)
#define ISpeechPhraseInfo_get_Properties(This,Properties) (This)->lpVtbl->get_Properties(This,Properties)
#define ISpeechPhraseInfo_get_Elements(This,Elements) (This)->lpVtbl->get_Elements(This,Elements)
#define ISpeechPhraseInfo_get_Replacements(This,Replacements) (This)->lpVtbl->get_Replacements(This,Replacements)
#define ISpeechPhraseInfo_get_EngineId(This,EngineIdGuid) (This)->lpVtbl->get_EngineId(This,EngineIdGuid)
#define ISpeechPhraseInfo_get_EnginePrivateData(This,PrivateData) (This)->lpVtbl->get_EnginePrivateData(This,PrivateData)
#define ISpeechPhraseInfo_SaveToMemory(This,PhraseBlock) (This)->lpVtbl->SaveToMemory(This,PhraseBlock)
#define ISpeechPhraseInfo_GetText(This,StartElement,Elements,UseReplacements,Text) (This)->lpVtbl->GetText(This,StartElement,Elements,UseReplacements,Text)
#define ISpeechPhraseInfo_GetDisplayAttributes(This,StartElement,Elements,UseReplacements,DisplayAttributes) (This)->lpVtbl->GetDisplayAttributes(This,StartElement,Elements,UseReplacements,DisplayAttributes)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpeechPhraseInfo_QueryInterface(ISpeechPhraseInfo* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpeechPhraseInfo_AddRef(ISpeechPhraseInfo* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpeechPhraseInfo_Release(ISpeechPhraseInfo* This) {
    return This->lpVtbl->Release(This);
}
/*** IDispatch methods ***/
static FORCEINLINE HRESULT ISpeechPhraseInfo_GetTypeInfoCount(ISpeechPhraseInfo* This,UINT *pctinfo) {
    return This->lpVtbl->GetTypeInfoCount(This,pctinfo);
}
static FORCEINLINE HRESULT ISpeechPhraseInfo_GetTypeInfo(ISpeechPhraseInfo* This,UINT iTInfo,LCID lcid,ITypeInfo **ppTInfo) {
    return This->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo);
}
static FORCEINLINE HRESULT ISpeechPhraseInfo_GetIDsOfNames(ISpeechPhraseInfo* This,REFIID riid,LPOLESTR *rgszNames,UINT cNames,LCID lcid,DISPID *rgDispId) {
    return This->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId);
}
static FORCEINLINE HRESULT ISpeechPhraseInfo_Invoke(ISpeechPhraseInfo* This,DISPID dispIdMember,REFIID riid,LCID lcid,WORD wFlags,DISPPARAMS *pDispParams,VARIANT *pVarResult,EXCEPINFO *pExcepInfo,UINT *puArgErr) {
    return This->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr);
}
/*** ISpeechPhraseInfo methods ***/
static FORCEINLINE HRESULT ISpeechPhraseInfo_get_LanguageId(ISpeechPhraseInfo* This,LONG *LanguageId) {
    return This->lpVtbl->get_LanguageId(This,LanguageId);
}
static FORCEINLINE HRESULT ISpeechPhraseInfo_get_GrammarId(ISpeechPhraseInfo* This,VARIANT *GrammarId) {
    return This->lpVtbl->get_GrammarId(This,GrammarId);
}
static FORCEINLINE HRESULT ISpeechPhraseInfo_get_StartTime(ISpeechPhraseInfo* This,VARIANT *StartTime) {
    return This->lpVtbl->get_StartTime(This,StartTime);
}
static FORCEINLINE HRESULT ISpeechPhraseInfo_get_AudioStreamPosition(ISpeechPhraseInfo* This,VARIANT *AudioStreamPosition) {
    return This->lpVtbl->get_AudioStreamPosition(This,AudioStreamPosition);
}
static FORCEINLINE HRESULT ISpeechPhraseInfo_get_AudioSizeBytes(ISpeechPhraseInfo* This,LONG *pAudioSizeBytes) {
    return This->lpVtbl->get_AudioSizeBytes(This,pAudioSizeBytes);
}
static FORCEINLINE HRESULT ISpeechPhraseInfo_get_RetainedSizeBytes(ISpeechPhraseInfo* This,LONG *RetainedSizeBytes) {
    return This->lpVtbl->get_RetainedSizeBytes(This,RetainedSizeBytes);
}
static FORCEINLINE HRESULT ISpeechPhraseInfo_get_AudioSizeTime(ISpeechPhraseInfo* This,LONG *AudioSizeTime) {
    return This->lpVtbl->get_AudioSizeTime(This,AudioSizeTime);
}
static FORCEINLINE HRESULT ISpeechPhraseInfo_get_Rule(ISpeechPhraseInfo* This,ISpeechPhraseRule **Rule) {
    return This->lpVtbl->get_Rule(This,Rule);
}
static FORCEINLINE HRESULT ISpeechPhraseInfo_get_Properties(ISpeechPhraseInfo* This,ISpeechPhraseProperties **Properties) {
    return This->lpVtbl->get_Properties(This,Properties);
}
static FORCEINLINE HRESULT ISpeechPhraseInfo_get_Elements(ISpeechPhraseInfo* This,ISpeechPhraseElements **Elements) {
    return This->lpVtbl->get_Elements(This,Elements);
}
static FORCEINLINE HRESULT ISpeechPhraseInfo_get_Replacements(ISpeechPhraseInfo* This,ISpeechPhraseReplacements **Replacements) {
    return This->lpVtbl->get_Replacements(This,Replacements);
}
static FORCEINLINE HRESULT ISpeechPhraseInfo_get_EngineId(ISpeechPhraseInfo* This,BSTR *EngineIdGuid) {
    return This->lpVtbl->get_EngineId(This,EngineIdGuid);
}
static FORCEINLINE HRESULT ISpeechPhraseInfo_get_EnginePrivateData(ISpeechPhraseInfo* This,VARIANT *PrivateData) {
    return This->lpVtbl->get_EnginePrivateData(This,PrivateData);
}
static FORCEINLINE HRESULT ISpeechPhraseInfo_SaveToMemory(ISpeechPhraseInfo* This,VARIANT *PhraseBlock) {
    return This->lpVtbl->SaveToMemory(This,PhraseBlock);
}
static FORCEINLINE HRESULT ISpeechPhraseInfo_GetText(ISpeechPhraseInfo* This,LONG StartElement,LONG Elements,VARIANT_BOOL UseReplacements,BSTR *Text) {
    return This->lpVtbl->GetText(This,StartElement,Elements,UseReplacements,Text);
}
static FORCEINLINE HRESULT ISpeechPhraseInfo_GetDisplayAttributes(ISpeechPhraseInfo* This,LONG StartElement,LONG Elements,VARIANT_BOOL UseReplacements,SpeechDisplayAttributes *DisplayAttributes) {
    return This->lpVtbl->GetDisplayAttributes(This,StartElement,Elements,UseReplacements,DisplayAttributes);
}
#endif
#endif

#endif


#endif  /* __ISpeechPhraseInfo_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpeechPhraseElement interface
 */
#ifndef __ISpeechPhraseElement_INTERFACE_DEFINED__
#define __ISpeechPhraseElement_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpeechPhraseElement, 0xe6176f96, 0xe373, 0x4801, 0xb2,0x23, 0x3b,0x62,0xc0,0x68,0xc0,0xb4);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("e6176f96-e373-4801-b223-3b62c068c0b4")
ISpeechPhraseElement : public IDispatch
{
    virtual HRESULT STDMETHODCALLTYPE get_AudioTimeOffset(
        LONG *AudioTimeOffset) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_AudioSizeTime(
        LONG *AudioSizeTime) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_AudioStreamOffset(
        LONG *AudioStreamOffset) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_AudioSizeBytes(
        LONG *AudioSizeBytes) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_RetainedStreamOffset(
        LONG *RetainedStreamOffset) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_RetainedSizeBytes(
        LONG *RetainedSizeBytes) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_DisplayText(
        BSTR *DisplayText) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_LexicalForm(
        BSTR *LexicalForm) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_Pronunciation(
        VARIANT *Pronunciation) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_DisplayAttributes(
        SpeechDisplayAttributes *DisplayAttributes) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_RequiredConfidence(
        SpeechEngineConfidence *RequiredConfidence) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_ActualConfidence(
        SpeechEngineConfidence *ActualConfidence) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_EngineConfidence(
        float *EngineConfidence) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpeechPhraseElement, 0xe6176f96, 0xe373, 0x4801, 0xb2,0x23, 0x3b,0x62,0xc0,0x68,0xc0,0xb4)
#endif
#else
typedef struct ISpeechPhraseElementVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpeechPhraseElement *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpeechPhraseElement *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpeechPhraseElement *This);

    /*** IDispatch methods ***/
    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
        ISpeechPhraseElement *This,
        UINT *pctinfo);

    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
        ISpeechPhraseElement *This,
        UINT iTInfo,
        LCID lcid,
        ITypeInfo **ppTInfo);

    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
        ISpeechPhraseElement *This,
        REFIID riid,
        LPOLESTR *rgszNames,
        UINT cNames,
        LCID lcid,
        DISPID *rgDispId);

    HRESULT (STDMETHODCALLTYPE *Invoke)(
        ISpeechPhraseElement *This,
        DISPID dispIdMember,
        REFIID riid,
        LCID lcid,
        WORD wFlags,
        DISPPARAMS *pDispParams,
        VARIANT *pVarResult,
        EXCEPINFO *pExcepInfo,
        UINT *puArgErr);

    /*** ISpeechPhraseElement methods ***/
    HRESULT (STDMETHODCALLTYPE *get_AudioTimeOffset)(
        ISpeechPhraseElement *This,
        LONG *AudioTimeOffset);

    HRESULT (STDMETHODCALLTYPE *get_AudioSizeTime)(
        ISpeechPhraseElement *This,
        LONG *AudioSizeTime);

    HRESULT (STDMETHODCALLTYPE *get_AudioStreamOffset)(
        ISpeechPhraseElement *This,
        LONG *AudioStreamOffset);

    HRESULT (STDMETHODCALLTYPE *get_AudioSizeBytes)(
        ISpeechPhraseElement *This,
        LONG *AudioSizeBytes);

    HRESULT (STDMETHODCALLTYPE *get_RetainedStreamOffset)(
        ISpeechPhraseElement *This,
        LONG *RetainedStreamOffset);

    HRESULT (STDMETHODCALLTYPE *get_RetainedSizeBytes)(
        ISpeechPhraseElement *This,
        LONG *RetainedSizeBytes);

    HRESULT (STDMETHODCALLTYPE *get_DisplayText)(
        ISpeechPhraseElement *This,
        BSTR *DisplayText);

    HRESULT (STDMETHODCALLTYPE *get_LexicalForm)(
        ISpeechPhraseElement *This,
        BSTR *LexicalForm);

    HRESULT (STDMETHODCALLTYPE *get_Pronunciation)(
        ISpeechPhraseElement *This,
        VARIANT *Pronunciation);

    HRESULT (STDMETHODCALLTYPE *get_DisplayAttributes)(
        ISpeechPhraseElement *This,
        SpeechDisplayAttributes *DisplayAttributes);

    HRESULT (STDMETHODCALLTYPE *get_RequiredConfidence)(
        ISpeechPhraseElement *This,
        SpeechEngineConfidence *RequiredConfidence);

    HRESULT (STDMETHODCALLTYPE *get_ActualConfidence)(
        ISpeechPhraseElement *This,
        SpeechEngineConfidence *ActualConfidence);

    HRESULT (STDMETHODCALLTYPE *get_EngineConfidence)(
        ISpeechPhraseElement *This,
        float *EngineConfidence);

    END_INTERFACE
} ISpeechPhraseElementVtbl;

interface ISpeechPhraseElement {
    CONST_VTBL ISpeechPhraseElementVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpeechPhraseElement_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpeechPhraseElement_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpeechPhraseElement_Release(This) (This)->lpVtbl->Release(This)
/*** IDispatch methods ***/
#define ISpeechPhraseElement_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
#define ISpeechPhraseElement_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
#define ISpeechPhraseElement_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
#define ISpeechPhraseElement_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
/*** ISpeechPhraseElement methods ***/
#define ISpeechPhraseElement_get_AudioTimeOffset(This,AudioTimeOffset) (This)->lpVtbl->get_AudioTimeOffset(This,AudioTimeOffset)
#define ISpeechPhraseElement_get_AudioSizeTime(This,AudioSizeTime) (This)->lpVtbl->get_AudioSizeTime(This,AudioSizeTime)
#define ISpeechPhraseElement_get_AudioStreamOffset(This,AudioStreamOffset) (This)->lpVtbl->get_AudioStreamOffset(This,AudioStreamOffset)
#define ISpeechPhraseElement_get_AudioSizeBytes(This,AudioSizeBytes) (This)->lpVtbl->get_AudioSizeBytes(This,AudioSizeBytes)
#define ISpeechPhraseElement_get_RetainedStreamOffset(This,RetainedStreamOffset) (This)->lpVtbl->get_RetainedStreamOffset(This,RetainedStreamOffset)
#define ISpeechPhraseElement_get_RetainedSizeBytes(This,RetainedSizeBytes) (This)->lpVtbl->get_RetainedSizeBytes(This,RetainedSizeBytes)
#define ISpeechPhraseElement_get_DisplayText(This,DisplayText) (This)->lpVtbl->get_DisplayText(This,DisplayText)
#define ISpeechPhraseElement_get_LexicalForm(This,LexicalForm) (This)->lpVtbl->get_LexicalForm(This,LexicalForm)
#define ISpeechPhraseElement_get_Pronunciation(This,Pronunciation) (This)->lpVtbl->get_Pronunciation(This,Pronunciation)
#define ISpeechPhraseElement_get_DisplayAttributes(This,DisplayAttributes) (This)->lpVtbl->get_DisplayAttributes(This,DisplayAttributes)
#define ISpeechPhraseElement_get_RequiredConfidence(This,RequiredConfidence) (This)->lpVtbl->get_RequiredConfidence(This,RequiredConfidence)
#define ISpeechPhraseElement_get_ActualConfidence(This,ActualConfidence) (This)->lpVtbl->get_ActualConfidence(This,ActualConfidence)
#define ISpeechPhraseElement_get_EngineConfidence(This,EngineConfidence) (This)->lpVtbl->get_EngineConfidence(This,EngineConfidence)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpeechPhraseElement_QueryInterface(ISpeechPhraseElement* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpeechPhraseElement_AddRef(ISpeechPhraseElement* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpeechPhraseElement_Release(ISpeechPhraseElement* This) {
    return This->lpVtbl->Release(This);
}
/*** IDispatch methods ***/
static FORCEINLINE HRESULT ISpeechPhraseElement_GetTypeInfoCount(ISpeechPhraseElement* This,UINT *pctinfo) {
    return This->lpVtbl->GetTypeInfoCount(This,pctinfo);
}
static FORCEINLINE HRESULT ISpeechPhraseElement_GetTypeInfo(ISpeechPhraseElement* This,UINT iTInfo,LCID lcid,ITypeInfo **ppTInfo) {
    return This->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo);
}
static FORCEINLINE HRESULT ISpeechPhraseElement_GetIDsOfNames(ISpeechPhraseElement* This,REFIID riid,LPOLESTR *rgszNames,UINT cNames,LCID lcid,DISPID *rgDispId) {
    return This->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId);
}
static FORCEINLINE HRESULT ISpeechPhraseElement_Invoke(ISpeechPhraseElement* This,DISPID dispIdMember,REFIID riid,LCID lcid,WORD wFlags,DISPPARAMS *pDispParams,VARIANT *pVarResult,EXCEPINFO *pExcepInfo,UINT *puArgErr) {
    return This->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr);
}
/*** ISpeechPhraseElement methods ***/
static FORCEINLINE HRESULT ISpeechPhraseElement_get_AudioTimeOffset(ISpeechPhraseElement* This,LONG *AudioTimeOffset) {
    return This->lpVtbl->get_AudioTimeOffset(This,AudioTimeOffset);
}
static FORCEINLINE HRESULT ISpeechPhraseElement_get_AudioSizeTime(ISpeechPhraseElement* This,LONG *AudioSizeTime) {
    return This->lpVtbl->get_AudioSizeTime(This,AudioSizeTime);
}
static FORCEINLINE HRESULT ISpeechPhraseElement_get_AudioStreamOffset(ISpeechPhraseElement* This,LONG *AudioStreamOffset) {
    return This->lpVtbl->get_AudioStreamOffset(This,AudioStreamOffset);
}
static FORCEINLINE HRESULT ISpeechPhraseElement_get_AudioSizeBytes(ISpeechPhraseElement* This,LONG *AudioSizeBytes) {
    return This->lpVtbl->get_AudioSizeBytes(This,AudioSizeBytes);
}
static FORCEINLINE HRESULT ISpeechPhraseElement_get_RetainedStreamOffset(ISpeechPhraseElement* This,LONG *RetainedStreamOffset) {
    return This->lpVtbl->get_RetainedStreamOffset(This,RetainedStreamOffset);
}
static FORCEINLINE HRESULT ISpeechPhraseElement_get_RetainedSizeBytes(ISpeechPhraseElement* This,LONG *RetainedSizeBytes) {
    return This->lpVtbl->get_RetainedSizeBytes(This,RetainedSizeBytes);
}
static FORCEINLINE HRESULT ISpeechPhraseElement_get_DisplayText(ISpeechPhraseElement* This,BSTR *DisplayText) {
    return This->lpVtbl->get_DisplayText(This,DisplayText);
}
static FORCEINLINE HRESULT ISpeechPhraseElement_get_LexicalForm(ISpeechPhraseElement* This,BSTR *LexicalForm) {
    return This->lpVtbl->get_LexicalForm(This,LexicalForm);
}
static FORCEINLINE HRESULT ISpeechPhraseElement_get_Pronunciation(ISpeechPhraseElement* This,VARIANT *Pronunciation) {
    return This->lpVtbl->get_Pronunciation(This,Pronunciation);
}
static FORCEINLINE HRESULT ISpeechPhraseElement_get_DisplayAttributes(ISpeechPhraseElement* This,SpeechDisplayAttributes *DisplayAttributes) {
    return This->lpVtbl->get_DisplayAttributes(This,DisplayAttributes);
}
static FORCEINLINE HRESULT ISpeechPhraseElement_get_RequiredConfidence(ISpeechPhraseElement* This,SpeechEngineConfidence *RequiredConfidence) {
    return This->lpVtbl->get_RequiredConfidence(This,RequiredConfidence);
}
static FORCEINLINE HRESULT ISpeechPhraseElement_get_ActualConfidence(ISpeechPhraseElement* This,SpeechEngineConfidence *ActualConfidence) {
    return This->lpVtbl->get_ActualConfidence(This,ActualConfidence);
}
static FORCEINLINE HRESULT ISpeechPhraseElement_get_EngineConfidence(ISpeechPhraseElement* This,float *EngineConfidence) {
    return This->lpVtbl->get_EngineConfidence(This,EngineConfidence);
}
#endif
#endif

#endif


#endif  /* __ISpeechPhraseElement_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpeechPhraseElements interface
 */
#ifndef __ISpeechPhraseElements_INTERFACE_DEFINED__
#define __ISpeechPhraseElements_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpeechPhraseElements, 0x0626b328, 0x3478, 0x467d, 0xa0,0xb3, 0xd0,0x85,0x3b,0x93,0xdd,0xa3);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("0626b328-3478-467d-a0b3-d0853b93dda3")
ISpeechPhraseElements : public IDispatch
{
    virtual HRESULT STDMETHODCALLTYPE get_Count(
        LONG *Count) = 0;

    virtual HRESULT STDMETHODCALLTYPE Item(
        LONG Index,
        ISpeechPhraseElement **Element) = 0;

    virtual HRESULT STDMETHODCALLTYPE get__NewEnum(
        IUnknown **EnumVARIANT) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpeechPhraseElements, 0x0626b328, 0x3478, 0x467d, 0xa0,0xb3, 0xd0,0x85,0x3b,0x93,0xdd,0xa3)
#endif
#else
typedef struct ISpeechPhraseElementsVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpeechPhraseElements *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpeechPhraseElements *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpeechPhraseElements *This);

    /*** IDispatch methods ***/
    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
        ISpeechPhraseElements *This,
        UINT *pctinfo);

    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
        ISpeechPhraseElements *This,
        UINT iTInfo,
        LCID lcid,
        ITypeInfo **ppTInfo);

    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
        ISpeechPhraseElements *This,
        REFIID riid,
        LPOLESTR *rgszNames,
        UINT cNames,
        LCID lcid,
        DISPID *rgDispId);

    HRESULT (STDMETHODCALLTYPE *Invoke)(
        ISpeechPhraseElements *This,
        DISPID dispIdMember,
        REFIID riid,
        LCID lcid,
        WORD wFlags,
        DISPPARAMS *pDispParams,
        VARIANT *pVarResult,
        EXCEPINFO *pExcepInfo,
        UINT *puArgErr);

    /*** ISpeechPhraseElements methods ***/
    HRESULT (STDMETHODCALLTYPE *get_Count)(
        ISpeechPhraseElements *This,
        LONG *Count);

    HRESULT (STDMETHODCALLTYPE *Item)(
        ISpeechPhraseElements *This,
        LONG Index,
        ISpeechPhraseElement **Element);

    HRESULT (STDMETHODCALLTYPE *get__NewEnum)(
        ISpeechPhraseElements *This,
        IUnknown **EnumVARIANT);

    END_INTERFACE
} ISpeechPhraseElementsVtbl;

interface ISpeechPhraseElements {
    CONST_VTBL ISpeechPhraseElementsVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpeechPhraseElements_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpeechPhraseElements_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpeechPhraseElements_Release(This) (This)->lpVtbl->Release(This)
/*** IDispatch methods ***/
#define ISpeechPhraseElements_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
#define ISpeechPhraseElements_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
#define ISpeechPhraseElements_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
#define ISpeechPhraseElements_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
/*** ISpeechPhraseElements methods ***/
#define ISpeechPhraseElements_get_Count(This,Count) (This)->lpVtbl->get_Count(This,Count)
#define ISpeechPhraseElements_Item(This,Index,Element) (This)->lpVtbl->Item(This,Index,Element)
#define ISpeechPhraseElements_get__NewEnum(This,EnumVARIANT) (This)->lpVtbl->get__NewEnum(This,EnumVARIANT)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpeechPhraseElements_QueryInterface(ISpeechPhraseElements* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpeechPhraseElements_AddRef(ISpeechPhraseElements* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpeechPhraseElements_Release(ISpeechPhraseElements* This) {
    return This->lpVtbl->Release(This);
}
/*** IDispatch methods ***/
static FORCEINLINE HRESULT ISpeechPhraseElements_GetTypeInfoCount(ISpeechPhraseElements* This,UINT *pctinfo) {
    return This->lpVtbl->GetTypeInfoCount(This,pctinfo);
}
static FORCEINLINE HRESULT ISpeechPhraseElements_GetTypeInfo(ISpeechPhraseElements* This,UINT iTInfo,LCID lcid,ITypeInfo **ppTInfo) {
    return This->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo);
}
static FORCEINLINE HRESULT ISpeechPhraseElements_GetIDsOfNames(ISpeechPhraseElements* This,REFIID riid,LPOLESTR *rgszNames,UINT cNames,LCID lcid,DISPID *rgDispId) {
    return This->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId);
}
static FORCEINLINE HRESULT ISpeechPhraseElements_Invoke(ISpeechPhraseElements* This,DISPID dispIdMember,REFIID riid,LCID lcid,WORD wFlags,DISPPARAMS *pDispParams,VARIANT *pVarResult,EXCEPINFO *pExcepInfo,UINT *puArgErr) {
    return This->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr);
}
/*** ISpeechPhraseElements methods ***/
static FORCEINLINE HRESULT ISpeechPhraseElements_get_Count(ISpeechPhraseElements* This,LONG *Count) {
    return This->lpVtbl->get_Count(This,Count);
}
static FORCEINLINE HRESULT ISpeechPhraseElements_Item(ISpeechPhraseElements* This,LONG Index,ISpeechPhraseElement **Element) {
    return This->lpVtbl->Item(This,Index,Element);
}
static FORCEINLINE HRESULT ISpeechPhraseElements_get__NewEnum(ISpeechPhraseElements* This,IUnknown **EnumVARIANT) {
    return This->lpVtbl->get__NewEnum(This,EnumVARIANT);
}
#endif
#endif

#endif


#endif  /* __ISpeechPhraseElements_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpeechPhraseReplacement interface
 */
#ifndef __ISpeechPhraseReplacement_INTERFACE_DEFINED__
#define __ISpeechPhraseReplacement_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpeechPhraseReplacement, 0x2890a410, 0x53a7, 0x4fb5, 0x94,0xec, 0x06,0xd4,0x99,0x8e,0x3d,0x02);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("2890a410-53a7-4fb5-94ec-06d4998e3d02")
ISpeechPhraseReplacement : public IDispatch
{
    virtual HRESULT STDMETHODCALLTYPE get_DisplayAttributes(
        SpeechDisplayAttributes *DisplayAttributes) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_Text(
        BSTR *Text) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_FirstElement(
        LONG *FirstElement) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_NumberOfElements(
        LONG *NumberOfElements) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpeechPhraseReplacement, 0x2890a410, 0x53a7, 0x4fb5, 0x94,0xec, 0x06,0xd4,0x99,0x8e,0x3d,0x02)
#endif
#else
typedef struct ISpeechPhraseReplacementVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpeechPhraseReplacement *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpeechPhraseReplacement *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpeechPhraseReplacement *This);

    /*** IDispatch methods ***/
    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
        ISpeechPhraseReplacement *This,
        UINT *pctinfo);

    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
        ISpeechPhraseReplacement *This,
        UINT iTInfo,
        LCID lcid,
        ITypeInfo **ppTInfo);

    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
        ISpeechPhraseReplacement *This,
        REFIID riid,
        LPOLESTR *rgszNames,
        UINT cNames,
        LCID lcid,
        DISPID *rgDispId);

    HRESULT (STDMETHODCALLTYPE *Invoke)(
        ISpeechPhraseReplacement *This,
        DISPID dispIdMember,
        REFIID riid,
        LCID lcid,
        WORD wFlags,
        DISPPARAMS *pDispParams,
        VARIANT *pVarResult,
        EXCEPINFO *pExcepInfo,
        UINT *puArgErr);

    /*** ISpeechPhraseReplacement methods ***/
    HRESULT (STDMETHODCALLTYPE *get_DisplayAttributes)(
        ISpeechPhraseReplacement *This,
        SpeechDisplayAttributes *DisplayAttributes);

    HRESULT (STDMETHODCALLTYPE *get_Text)(
        ISpeechPhraseReplacement *This,
        BSTR *Text);

    HRESULT (STDMETHODCALLTYPE *get_FirstElement)(
        ISpeechPhraseReplacement *This,
        LONG *FirstElement);

    HRESULT (STDMETHODCALLTYPE *get_NumberOfElements)(
        ISpeechPhraseReplacement *This,
        LONG *NumberOfElements);

    END_INTERFACE
} ISpeechPhraseReplacementVtbl;

interface ISpeechPhraseReplacement {
    CONST_VTBL ISpeechPhraseReplacementVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpeechPhraseReplacement_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpeechPhraseReplacement_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpeechPhraseReplacement_Release(This) (This)->lpVtbl->Release(This)
/*** IDispatch methods ***/
#define ISpeechPhraseReplacement_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
#define ISpeechPhraseReplacement_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
#define ISpeechPhraseReplacement_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
#define ISpeechPhraseReplacement_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
/*** ISpeechPhraseReplacement methods ***/
#define ISpeechPhraseReplacement_get_DisplayAttributes(This,DisplayAttributes) (This)->lpVtbl->get_DisplayAttributes(This,DisplayAttributes)
#define ISpeechPhraseReplacement_get_Text(This,Text) (This)->lpVtbl->get_Text(This,Text)
#define ISpeechPhraseReplacement_get_FirstElement(This,FirstElement) (This)->lpVtbl->get_FirstElement(This,FirstElement)
#define ISpeechPhraseReplacement_get_NumberOfElements(This,NumberOfElements) (This)->lpVtbl->get_NumberOfElements(This,NumberOfElements)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpeechPhraseReplacement_QueryInterface(ISpeechPhraseReplacement* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpeechPhraseReplacement_AddRef(ISpeechPhraseReplacement* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpeechPhraseReplacement_Release(ISpeechPhraseReplacement* This) {
    return This->lpVtbl->Release(This);
}
/*** IDispatch methods ***/
static FORCEINLINE HRESULT ISpeechPhraseReplacement_GetTypeInfoCount(ISpeechPhraseReplacement* This,UINT *pctinfo) {
    return This->lpVtbl->GetTypeInfoCount(This,pctinfo);
}
static FORCEINLINE HRESULT ISpeechPhraseReplacement_GetTypeInfo(ISpeechPhraseReplacement* This,UINT iTInfo,LCID lcid,ITypeInfo **ppTInfo) {
    return This->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo);
}
static FORCEINLINE HRESULT ISpeechPhraseReplacement_GetIDsOfNames(ISpeechPhraseReplacement* This,REFIID riid,LPOLESTR *rgszNames,UINT cNames,LCID lcid,DISPID *rgDispId) {
    return This->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId);
}
static FORCEINLINE HRESULT ISpeechPhraseReplacement_Invoke(ISpeechPhraseReplacement* This,DISPID dispIdMember,REFIID riid,LCID lcid,WORD wFlags,DISPPARAMS *pDispParams,VARIANT *pVarResult,EXCEPINFO *pExcepInfo,UINT *puArgErr) {
    return This->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr);
}
/*** ISpeechPhraseReplacement methods ***/
static FORCEINLINE HRESULT ISpeechPhraseReplacement_get_DisplayAttributes(ISpeechPhraseReplacement* This,SpeechDisplayAttributes *DisplayAttributes) {
    return This->lpVtbl->get_DisplayAttributes(This,DisplayAttributes);
}
static FORCEINLINE HRESULT ISpeechPhraseReplacement_get_Text(ISpeechPhraseReplacement* This,BSTR *Text) {
    return This->lpVtbl->get_Text(This,Text);
}
static FORCEINLINE HRESULT ISpeechPhraseReplacement_get_FirstElement(ISpeechPhraseReplacement* This,LONG *FirstElement) {
    return This->lpVtbl->get_FirstElement(This,FirstElement);
}
static FORCEINLINE HRESULT ISpeechPhraseReplacement_get_NumberOfElements(ISpeechPhraseReplacement* This,LONG *NumberOfElements) {
    return This->lpVtbl->get_NumberOfElements(This,NumberOfElements);
}
#endif
#endif

#endif


#endif  /* __ISpeechPhraseReplacement_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpeechPhraseReplacements interface
 */
#ifndef __ISpeechPhraseReplacements_INTERFACE_DEFINED__
#define __ISpeechPhraseReplacements_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpeechPhraseReplacements, 0x38bc662f, 0x2257, 0x4525, 0x95,0x9e, 0x20,0x69,0xd2,0x59,0x6c,0x05);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("38bc662f-2257-4525-959e-2069d2596c05")
ISpeechPhraseReplacements : public IDispatch
{
    virtual HRESULT STDMETHODCALLTYPE get_Count(
        LONG *Count) = 0;

    virtual HRESULT STDMETHODCALLTYPE Item(
        LONG Index,
        ISpeechPhraseReplacement **Reps) = 0;

    virtual HRESULT STDMETHODCALLTYPE get__NewEnum(
        IUnknown **EnumVARIANT) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpeechPhraseReplacements, 0x38bc662f, 0x2257, 0x4525, 0x95,0x9e, 0x20,0x69,0xd2,0x59,0x6c,0x05)
#endif
#else
typedef struct ISpeechPhraseReplacementsVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpeechPhraseReplacements *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpeechPhraseReplacements *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpeechPhraseReplacements *This);

    /*** IDispatch methods ***/
    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
        ISpeechPhraseReplacements *This,
        UINT *pctinfo);

    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
        ISpeechPhraseReplacements *This,
        UINT iTInfo,
        LCID lcid,
        ITypeInfo **ppTInfo);

    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
        ISpeechPhraseReplacements *This,
        REFIID riid,
        LPOLESTR *rgszNames,
        UINT cNames,
        LCID lcid,
        DISPID *rgDispId);

    HRESULT (STDMETHODCALLTYPE *Invoke)(
        ISpeechPhraseReplacements *This,
        DISPID dispIdMember,
        REFIID riid,
        LCID lcid,
        WORD wFlags,
        DISPPARAMS *pDispParams,
        VARIANT *pVarResult,
        EXCEPINFO *pExcepInfo,
        UINT *puArgErr);

    /*** ISpeechPhraseReplacements methods ***/
    HRESULT (STDMETHODCALLTYPE *get_Count)(
        ISpeechPhraseReplacements *This,
        LONG *Count);

    HRESULT (STDMETHODCALLTYPE *Item)(
        ISpeechPhraseReplacements *This,
        LONG Index,
        ISpeechPhraseReplacement **Reps);

    HRESULT (STDMETHODCALLTYPE *get__NewEnum)(
        ISpeechPhraseReplacements *This,
        IUnknown **EnumVARIANT);

    END_INTERFACE
} ISpeechPhraseReplacementsVtbl;

interface ISpeechPhraseReplacements {
    CONST_VTBL ISpeechPhraseReplacementsVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpeechPhraseReplacements_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpeechPhraseReplacements_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpeechPhraseReplacements_Release(This) (This)->lpVtbl->Release(This)
/*** IDispatch methods ***/
#define ISpeechPhraseReplacements_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
#define ISpeechPhraseReplacements_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
#define ISpeechPhraseReplacements_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
#define ISpeechPhraseReplacements_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
/*** ISpeechPhraseReplacements methods ***/
#define ISpeechPhraseReplacements_get_Count(This,Count) (This)->lpVtbl->get_Count(This,Count)
#define ISpeechPhraseReplacements_Item(This,Index,Reps) (This)->lpVtbl->Item(This,Index,Reps)
#define ISpeechPhraseReplacements_get__NewEnum(This,EnumVARIANT) (This)->lpVtbl->get__NewEnum(This,EnumVARIANT)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpeechPhraseReplacements_QueryInterface(ISpeechPhraseReplacements* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpeechPhraseReplacements_AddRef(ISpeechPhraseReplacements* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpeechPhraseReplacements_Release(ISpeechPhraseReplacements* This) {
    return This->lpVtbl->Release(This);
}
/*** IDispatch methods ***/
static FORCEINLINE HRESULT ISpeechPhraseReplacements_GetTypeInfoCount(ISpeechPhraseReplacements* This,UINT *pctinfo) {
    return This->lpVtbl->GetTypeInfoCount(This,pctinfo);
}
static FORCEINLINE HRESULT ISpeechPhraseReplacements_GetTypeInfo(ISpeechPhraseReplacements* This,UINT iTInfo,LCID lcid,ITypeInfo **ppTInfo) {
    return This->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo);
}
static FORCEINLINE HRESULT ISpeechPhraseReplacements_GetIDsOfNames(ISpeechPhraseReplacements* This,REFIID riid,LPOLESTR *rgszNames,UINT cNames,LCID lcid,DISPID *rgDispId) {
    return This->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId);
}
static FORCEINLINE HRESULT ISpeechPhraseReplacements_Invoke(ISpeechPhraseReplacements* This,DISPID dispIdMember,REFIID riid,LCID lcid,WORD wFlags,DISPPARAMS *pDispParams,VARIANT *pVarResult,EXCEPINFO *pExcepInfo,UINT *puArgErr) {
    return This->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr);
}
/*** ISpeechPhraseReplacements methods ***/
static FORCEINLINE HRESULT ISpeechPhraseReplacements_get_Count(ISpeechPhraseReplacements* This,LONG *Count) {
    return This->lpVtbl->get_Count(This,Count);
}
static FORCEINLINE HRESULT ISpeechPhraseReplacements_Item(ISpeechPhraseReplacements* This,LONG Index,ISpeechPhraseReplacement **Reps) {
    return This->lpVtbl->Item(This,Index,Reps);
}
static FORCEINLINE HRESULT ISpeechPhraseReplacements_get__NewEnum(ISpeechPhraseReplacements* This,IUnknown **EnumVARIANT) {
    return This->lpVtbl->get__NewEnum(This,EnumVARIANT);
}
#endif
#endif

#endif


#endif  /* __ISpeechPhraseReplacements_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpeechPhraseProperty interface
 */
#ifndef __ISpeechPhraseProperty_INTERFACE_DEFINED__
#define __ISpeechPhraseProperty_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpeechPhraseProperty, 0xce563d48, 0x961e, 0x4732, 0xa2,0xe1, 0x37,0x8a,0x42,0xb4,0x30,0xbe);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("ce563d48-961e-4732-a2e1-378a42b430be")
ISpeechPhraseProperty : public IDispatch
{
    virtual HRESULT STDMETHODCALLTYPE get_Name(
        BSTR *Name) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_Id(
        LONG *Id) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_Value(
        VARIANT *Value) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_FirstElement(
        LONG *FirstElement) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_NumberOfElements(
        LONG *NumberOfElements) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_EngineConfidence(
        float *Confidence) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_Confidence(
        SpeechEngineConfidence *Confidence) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_Parent(
        ISpeechPhraseProperty **ParentProperty) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_Children(
        ISpeechPhraseProperties **Children) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpeechPhraseProperty, 0xce563d48, 0x961e, 0x4732, 0xa2,0xe1, 0x37,0x8a,0x42,0xb4,0x30,0xbe)
#endif
#else
typedef struct ISpeechPhrasePropertyVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpeechPhraseProperty *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpeechPhraseProperty *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpeechPhraseProperty *This);

    /*** IDispatch methods ***/
    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
        ISpeechPhraseProperty *This,
        UINT *pctinfo);

    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
        ISpeechPhraseProperty *This,
        UINT iTInfo,
        LCID lcid,
        ITypeInfo **ppTInfo);

    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
        ISpeechPhraseProperty *This,
        REFIID riid,
        LPOLESTR *rgszNames,
        UINT cNames,
        LCID lcid,
        DISPID *rgDispId);

    HRESULT (STDMETHODCALLTYPE *Invoke)(
        ISpeechPhraseProperty *This,
        DISPID dispIdMember,
        REFIID riid,
        LCID lcid,
        WORD wFlags,
        DISPPARAMS *pDispParams,
        VARIANT *pVarResult,
        EXCEPINFO *pExcepInfo,
        UINT *puArgErr);

    /*** ISpeechPhraseProperty methods ***/
    HRESULT (STDMETHODCALLTYPE *get_Name)(
        ISpeechPhraseProperty *This,
        BSTR *Name);

    HRESULT (STDMETHODCALLTYPE *get_Id)(
        ISpeechPhraseProperty *This,
        LONG *Id);

    HRESULT (STDMETHODCALLTYPE *get_Value)(
        ISpeechPhraseProperty *This,
        VARIANT *Value);

    HRESULT (STDMETHODCALLTYPE *get_FirstElement)(
        ISpeechPhraseProperty *This,
        LONG *FirstElement);

    HRESULT (STDMETHODCALLTYPE *get_NumberOfElements)(
        ISpeechPhraseProperty *This,
        LONG *NumberOfElements);

    HRESULT (STDMETHODCALLTYPE *get_EngineConfidence)(
        ISpeechPhraseProperty *This,
        float *Confidence);

    HRESULT (STDMETHODCALLTYPE *get_Confidence)(
        ISpeechPhraseProperty *This,
        SpeechEngineConfidence *Confidence);

    HRESULT (STDMETHODCALLTYPE *get_Parent)(
        ISpeechPhraseProperty *This,
        ISpeechPhraseProperty **ParentProperty);

    HRESULT (STDMETHODCALLTYPE *get_Children)(
        ISpeechPhraseProperty *This,
        ISpeechPhraseProperties **Children);

    END_INTERFACE
} ISpeechPhrasePropertyVtbl;

interface ISpeechPhraseProperty {
    CONST_VTBL ISpeechPhrasePropertyVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpeechPhraseProperty_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpeechPhraseProperty_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpeechPhraseProperty_Release(This) (This)->lpVtbl->Release(This)
/*** IDispatch methods ***/
#define ISpeechPhraseProperty_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
#define ISpeechPhraseProperty_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
#define ISpeechPhraseProperty_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
#define ISpeechPhraseProperty_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
/*** ISpeechPhraseProperty methods ***/
#define ISpeechPhraseProperty_get_Name(This,Name) (This)->lpVtbl->get_Name(This,Name)
#define ISpeechPhraseProperty_get_Id(This,Id) (This)->lpVtbl->get_Id(This,Id)
#define ISpeechPhraseProperty_get_Value(This,Value) (This)->lpVtbl->get_Value(This,Value)
#define ISpeechPhraseProperty_get_FirstElement(This,FirstElement) (This)->lpVtbl->get_FirstElement(This,FirstElement)
#define ISpeechPhraseProperty_get_NumberOfElements(This,NumberOfElements) (This)->lpVtbl->get_NumberOfElements(This,NumberOfElements)
#define ISpeechPhraseProperty_get_EngineConfidence(This,Confidence) (This)->lpVtbl->get_EngineConfidence(This,Confidence)
#define ISpeechPhraseProperty_get_Confidence(This,Confidence) (This)->lpVtbl->get_Confidence(This,Confidence)
#define ISpeechPhraseProperty_get_Parent(This,ParentProperty) (This)->lpVtbl->get_Parent(This,ParentProperty)
#define ISpeechPhraseProperty_get_Children(This,Children) (This)->lpVtbl->get_Children(This,Children)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpeechPhraseProperty_QueryInterface(ISpeechPhraseProperty* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpeechPhraseProperty_AddRef(ISpeechPhraseProperty* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpeechPhraseProperty_Release(ISpeechPhraseProperty* This) {
    return This->lpVtbl->Release(This);
}
/*** IDispatch methods ***/
static FORCEINLINE HRESULT ISpeechPhraseProperty_GetTypeInfoCount(ISpeechPhraseProperty* This,UINT *pctinfo) {
    return This->lpVtbl->GetTypeInfoCount(This,pctinfo);
}
static FORCEINLINE HRESULT ISpeechPhraseProperty_GetTypeInfo(ISpeechPhraseProperty* This,UINT iTInfo,LCID lcid,ITypeInfo **ppTInfo) {
    return This->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo);
}
static FORCEINLINE HRESULT ISpeechPhraseProperty_GetIDsOfNames(ISpeechPhraseProperty* This,REFIID riid,LPOLESTR *rgszNames,UINT cNames,LCID lcid,DISPID *rgDispId) {
    return This->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId);
}
static FORCEINLINE HRESULT ISpeechPhraseProperty_Invoke(ISpeechPhraseProperty* This,DISPID dispIdMember,REFIID riid,LCID lcid,WORD wFlags,DISPPARAMS *pDispParams,VARIANT *pVarResult,EXCEPINFO *pExcepInfo,UINT *puArgErr) {
    return This->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr);
}
/*** ISpeechPhraseProperty methods ***/
static FORCEINLINE HRESULT ISpeechPhraseProperty_get_Name(ISpeechPhraseProperty* This,BSTR *Name) {
    return This->lpVtbl->get_Name(This,Name);
}
static FORCEINLINE HRESULT ISpeechPhraseProperty_get_Id(ISpeechPhraseProperty* This,LONG *Id) {
    return This->lpVtbl->get_Id(This,Id);
}
static FORCEINLINE HRESULT ISpeechPhraseProperty_get_Value(ISpeechPhraseProperty* This,VARIANT *Value) {
    return This->lpVtbl->get_Value(This,Value);
}
static FORCEINLINE HRESULT ISpeechPhraseProperty_get_FirstElement(ISpeechPhraseProperty* This,LONG *FirstElement) {
    return This->lpVtbl->get_FirstElement(This,FirstElement);
}
static FORCEINLINE HRESULT ISpeechPhraseProperty_get_NumberOfElements(ISpeechPhraseProperty* This,LONG *NumberOfElements) {
    return This->lpVtbl->get_NumberOfElements(This,NumberOfElements);
}
static FORCEINLINE HRESULT ISpeechPhraseProperty_get_EngineConfidence(ISpeechPhraseProperty* This,float *Confidence) {
    return This->lpVtbl->get_EngineConfidence(This,Confidence);
}
static FORCEINLINE HRESULT ISpeechPhraseProperty_get_Confidence(ISpeechPhraseProperty* This,SpeechEngineConfidence *Confidence) {
    return This->lpVtbl->get_Confidence(This,Confidence);
}
static FORCEINLINE HRESULT ISpeechPhraseProperty_get_Parent(ISpeechPhraseProperty* This,ISpeechPhraseProperty **ParentProperty) {
    return This->lpVtbl->get_Parent(This,ParentProperty);
}
static FORCEINLINE HRESULT ISpeechPhraseProperty_get_Children(ISpeechPhraseProperty* This,ISpeechPhraseProperties **Children) {
    return This->lpVtbl->get_Children(This,Children);
}
#endif
#endif

#endif


#endif  /* __ISpeechPhraseProperty_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpeechPhraseProperties interface
 */
#ifndef __ISpeechPhraseProperties_INTERFACE_DEFINED__
#define __ISpeechPhraseProperties_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpeechPhraseProperties, 0x08166b47, 0x102e, 0x4b23, 0xa5,0x99, 0xbd,0xb9,0x8d,0xbf,0xd1,0xf4);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("08166b47-102e-4b23-a599-bdb98dbfd1f4")
ISpeechPhraseProperties : public IDispatch
{
    virtual HRESULT STDMETHODCALLTYPE get_Count(
        LONG *Count) = 0;

    virtual HRESULT STDMETHODCALLTYPE Item(
        LONG Index,
        ISpeechPhraseProperty **Property) = 0;

    virtual HRESULT STDMETHODCALLTYPE get__NewEnum(
        IUnknown **EnumVARIANT) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpeechPhraseProperties, 0x08166b47, 0x102e, 0x4b23, 0xa5,0x99, 0xbd,0xb9,0x8d,0xbf,0xd1,0xf4)
#endif
#else
typedef struct ISpeechPhrasePropertiesVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpeechPhraseProperties *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpeechPhraseProperties *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpeechPhraseProperties *This);

    /*** IDispatch methods ***/
    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
        ISpeechPhraseProperties *This,
        UINT *pctinfo);

    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
        ISpeechPhraseProperties *This,
        UINT iTInfo,
        LCID lcid,
        ITypeInfo **ppTInfo);

    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
        ISpeechPhraseProperties *This,
        REFIID riid,
        LPOLESTR *rgszNames,
        UINT cNames,
        LCID lcid,
        DISPID *rgDispId);

    HRESULT (STDMETHODCALLTYPE *Invoke)(
        ISpeechPhraseProperties *This,
        DISPID dispIdMember,
        REFIID riid,
        LCID lcid,
        WORD wFlags,
        DISPPARAMS *pDispParams,
        VARIANT *pVarResult,
        EXCEPINFO *pExcepInfo,
        UINT *puArgErr);

    /*** ISpeechPhraseProperties methods ***/
    HRESULT (STDMETHODCALLTYPE *get_Count)(
        ISpeechPhraseProperties *This,
        LONG *Count);

    HRESULT (STDMETHODCALLTYPE *Item)(
        ISpeechPhraseProperties *This,
        LONG Index,
        ISpeechPhraseProperty **Property);

    HRESULT (STDMETHODCALLTYPE *get__NewEnum)(
        ISpeechPhraseProperties *This,
        IUnknown **EnumVARIANT);

    END_INTERFACE
} ISpeechPhrasePropertiesVtbl;

interface ISpeechPhraseProperties {
    CONST_VTBL ISpeechPhrasePropertiesVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpeechPhraseProperties_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpeechPhraseProperties_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpeechPhraseProperties_Release(This) (This)->lpVtbl->Release(This)
/*** IDispatch methods ***/
#define ISpeechPhraseProperties_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
#define ISpeechPhraseProperties_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
#define ISpeechPhraseProperties_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
#define ISpeechPhraseProperties_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
/*** ISpeechPhraseProperties methods ***/
#define ISpeechPhraseProperties_get_Count(This,Count) (This)->lpVtbl->get_Count(This,Count)
#define ISpeechPhraseProperties_Item(This,Index,Property) (This)->lpVtbl->Item(This,Index,Property)
#define ISpeechPhraseProperties_get__NewEnum(This,EnumVARIANT) (This)->lpVtbl->get__NewEnum(This,EnumVARIANT)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpeechPhraseProperties_QueryInterface(ISpeechPhraseProperties* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpeechPhraseProperties_AddRef(ISpeechPhraseProperties* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpeechPhraseProperties_Release(ISpeechPhraseProperties* This) {
    return This->lpVtbl->Release(This);
}
/*** IDispatch methods ***/
static FORCEINLINE HRESULT ISpeechPhraseProperties_GetTypeInfoCount(ISpeechPhraseProperties* This,UINT *pctinfo) {
    return This->lpVtbl->GetTypeInfoCount(This,pctinfo);
}
static FORCEINLINE HRESULT ISpeechPhraseProperties_GetTypeInfo(ISpeechPhraseProperties* This,UINT iTInfo,LCID lcid,ITypeInfo **ppTInfo) {
    return This->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo);
}
static FORCEINLINE HRESULT ISpeechPhraseProperties_GetIDsOfNames(ISpeechPhraseProperties* This,REFIID riid,LPOLESTR *rgszNames,UINT cNames,LCID lcid,DISPID *rgDispId) {
    return This->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId);
}
static FORCEINLINE HRESULT ISpeechPhraseProperties_Invoke(ISpeechPhraseProperties* This,DISPID dispIdMember,REFIID riid,LCID lcid,WORD wFlags,DISPPARAMS *pDispParams,VARIANT *pVarResult,EXCEPINFO *pExcepInfo,UINT *puArgErr) {
    return This->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr);
}
/*** ISpeechPhraseProperties methods ***/
static FORCEINLINE HRESULT ISpeechPhraseProperties_get_Count(ISpeechPhraseProperties* This,LONG *Count) {
    return This->lpVtbl->get_Count(This,Count);
}
static FORCEINLINE HRESULT ISpeechPhraseProperties_Item(ISpeechPhraseProperties* This,LONG Index,ISpeechPhraseProperty **Property) {
    return This->lpVtbl->Item(This,Index,Property);
}
static FORCEINLINE HRESULT ISpeechPhraseProperties_get__NewEnum(ISpeechPhraseProperties* This,IUnknown **EnumVARIANT) {
    return This->lpVtbl->get__NewEnum(This,EnumVARIANT);
}
#endif
#endif

#endif


#endif  /* __ISpeechPhraseProperties_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpeechPhraseRule interface
 */
#ifndef __ISpeechPhraseRule_INTERFACE_DEFINED__
#define __ISpeechPhraseRule_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpeechPhraseRule, 0xa7bfe112, 0xa4a0, 0x48d9, 0xb6,0x02, 0xc3,0x13,0x84,0x3f,0x69,0x64);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("a7bfe112-a4a0-48d9-b602-c313843f6964")
ISpeechPhraseRule : public IDispatch
{
    virtual HRESULT STDMETHODCALLTYPE get_Name(
        BSTR *Name) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_Id(
        LONG *Id) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_FirstElement(
        LONG *FirstElement) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_NumberOfElements(
        LONG *NumberOfElements) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_Parent(
        ISpeechPhraseRule **Parent) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_Children(
        ISpeechPhraseRules **Children) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_Confidence(
        SpeechEngineConfidence *ActualConfidence) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_EngineConfidence(
        float *EngineConfidence) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpeechPhraseRule, 0xa7bfe112, 0xa4a0, 0x48d9, 0xb6,0x02, 0xc3,0x13,0x84,0x3f,0x69,0x64)
#endif
#else
typedef struct ISpeechPhraseRuleVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpeechPhraseRule *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpeechPhraseRule *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpeechPhraseRule *This);

    /*** IDispatch methods ***/
    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
        ISpeechPhraseRule *This,
        UINT *pctinfo);

    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
        ISpeechPhraseRule *This,
        UINT iTInfo,
        LCID lcid,
        ITypeInfo **ppTInfo);

    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
        ISpeechPhraseRule *This,
        REFIID riid,
        LPOLESTR *rgszNames,
        UINT cNames,
        LCID lcid,
        DISPID *rgDispId);

    HRESULT (STDMETHODCALLTYPE *Invoke)(
        ISpeechPhraseRule *This,
        DISPID dispIdMember,
        REFIID riid,
        LCID lcid,
        WORD wFlags,
        DISPPARAMS *pDispParams,
        VARIANT *pVarResult,
        EXCEPINFO *pExcepInfo,
        UINT *puArgErr);

    /*** ISpeechPhraseRule methods ***/
    HRESULT (STDMETHODCALLTYPE *get_Name)(
        ISpeechPhraseRule *This,
        BSTR *Name);

    HRESULT (STDMETHODCALLTYPE *get_Id)(
        ISpeechPhraseRule *This,
        LONG *Id);

    HRESULT (STDMETHODCALLTYPE *get_FirstElement)(
        ISpeechPhraseRule *This,
        LONG *FirstElement);

    HRESULT (STDMETHODCALLTYPE *get_NumberOfElements)(
        ISpeechPhraseRule *This,
        LONG *NumberOfElements);

    HRESULT (STDMETHODCALLTYPE *get_Parent)(
        ISpeechPhraseRule *This,
        ISpeechPhraseRule **Parent);

    HRESULT (STDMETHODCALLTYPE *get_Children)(
        ISpeechPhraseRule *This,
        ISpeechPhraseRules **Children);

    HRESULT (STDMETHODCALLTYPE *get_Confidence)(
        ISpeechPhraseRule *This,
        SpeechEngineConfidence *ActualConfidence);

    HRESULT (STDMETHODCALLTYPE *get_EngineConfidence)(
        ISpeechPhraseRule *This,
        float *EngineConfidence);

    END_INTERFACE
} ISpeechPhraseRuleVtbl;

interface ISpeechPhraseRule {
    CONST_VTBL ISpeechPhraseRuleVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpeechPhraseRule_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpeechPhraseRule_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpeechPhraseRule_Release(This) (This)->lpVtbl->Release(This)
/*** IDispatch methods ***/
#define ISpeechPhraseRule_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
#define ISpeechPhraseRule_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
#define ISpeechPhraseRule_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
#define ISpeechPhraseRule_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
/*** ISpeechPhraseRule methods ***/
#define ISpeechPhraseRule_get_Name(This,Name) (This)->lpVtbl->get_Name(This,Name)
#define ISpeechPhraseRule_get_Id(This,Id) (This)->lpVtbl->get_Id(This,Id)
#define ISpeechPhraseRule_get_FirstElement(This,FirstElement) (This)->lpVtbl->get_FirstElement(This,FirstElement)
#define ISpeechPhraseRule_get_NumberOfElements(This,NumberOfElements) (This)->lpVtbl->get_NumberOfElements(This,NumberOfElements)
#define ISpeechPhraseRule_get_Parent(This,Parent) (This)->lpVtbl->get_Parent(This,Parent)
#define ISpeechPhraseRule_get_Children(This,Children) (This)->lpVtbl->get_Children(This,Children)
#define ISpeechPhraseRule_get_Confidence(This,ActualConfidence) (This)->lpVtbl->get_Confidence(This,ActualConfidence)
#define ISpeechPhraseRule_get_EngineConfidence(This,EngineConfidence) (This)->lpVtbl->get_EngineConfidence(This,EngineConfidence)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpeechPhraseRule_QueryInterface(ISpeechPhraseRule* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpeechPhraseRule_AddRef(ISpeechPhraseRule* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpeechPhraseRule_Release(ISpeechPhraseRule* This) {
    return This->lpVtbl->Release(This);
}
/*** IDispatch methods ***/
static FORCEINLINE HRESULT ISpeechPhraseRule_GetTypeInfoCount(ISpeechPhraseRule* This,UINT *pctinfo) {
    return This->lpVtbl->GetTypeInfoCount(This,pctinfo);
}
static FORCEINLINE HRESULT ISpeechPhraseRule_GetTypeInfo(ISpeechPhraseRule* This,UINT iTInfo,LCID lcid,ITypeInfo **ppTInfo) {
    return This->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo);
}
static FORCEINLINE HRESULT ISpeechPhraseRule_GetIDsOfNames(ISpeechPhraseRule* This,REFIID riid,LPOLESTR *rgszNames,UINT cNames,LCID lcid,DISPID *rgDispId) {
    return This->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId);
}
static FORCEINLINE HRESULT ISpeechPhraseRule_Invoke(ISpeechPhraseRule* This,DISPID dispIdMember,REFIID riid,LCID lcid,WORD wFlags,DISPPARAMS *pDispParams,VARIANT *pVarResult,EXCEPINFO *pExcepInfo,UINT *puArgErr) {
    return This->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr);
}
/*** ISpeechPhraseRule methods ***/
static FORCEINLINE HRESULT ISpeechPhraseRule_get_Name(ISpeechPhraseRule* This,BSTR *Name) {
    return This->lpVtbl->get_Name(This,Name);
}
static FORCEINLINE HRESULT ISpeechPhraseRule_get_Id(ISpeechPhraseRule* This,LONG *Id) {
    return This->lpVtbl->get_Id(This,Id);
}
static FORCEINLINE HRESULT ISpeechPhraseRule_get_FirstElement(ISpeechPhraseRule* This,LONG *FirstElement) {
    return This->lpVtbl->get_FirstElement(This,FirstElement);
}
static FORCEINLINE HRESULT ISpeechPhraseRule_get_NumberOfElements(ISpeechPhraseRule* This,LONG *NumberOfElements) {
    return This->lpVtbl->get_NumberOfElements(This,NumberOfElements);
}
static FORCEINLINE HRESULT ISpeechPhraseRule_get_Parent(ISpeechPhraseRule* This,ISpeechPhraseRule **Parent) {
    return This->lpVtbl->get_Parent(This,Parent);
}
static FORCEINLINE HRESULT ISpeechPhraseRule_get_Children(ISpeechPhraseRule* This,ISpeechPhraseRules **Children) {
    return This->lpVtbl->get_Children(This,Children);
}
static FORCEINLINE HRESULT ISpeechPhraseRule_get_Confidence(ISpeechPhraseRule* This,SpeechEngineConfidence *ActualConfidence) {
    return This->lpVtbl->get_Confidence(This,ActualConfidence);
}
static FORCEINLINE HRESULT ISpeechPhraseRule_get_EngineConfidence(ISpeechPhraseRule* This,float *EngineConfidence) {
    return This->lpVtbl->get_EngineConfidence(This,EngineConfidence);
}
#endif
#endif

#endif


#endif  /* __ISpeechPhraseRule_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpeechPhraseRules interface
 */
#ifndef __ISpeechPhraseRules_INTERFACE_DEFINED__
#define __ISpeechPhraseRules_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpeechPhraseRules, 0x9047d593, 0x01dd, 0x4b72, 0x81,0xa3, 0xe4,0xa0,0xca,0x69,0xf4,0x07);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("9047d593-01dd-4b72-81a3-e4a0ca69f407")
ISpeechPhraseRules : public IDispatch
{
    virtual HRESULT STDMETHODCALLTYPE get_Count(
        LONG *Count) = 0;

    virtual HRESULT STDMETHODCALLTYPE Item(
        LONG Index,
        ISpeechPhraseRule **Rule) = 0;

    virtual HRESULT STDMETHODCALLTYPE get__NewEnum(
        IUnknown **EnumVARIANT) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpeechPhraseRules, 0x9047d593, 0x01dd, 0x4b72, 0x81,0xa3, 0xe4,0xa0,0xca,0x69,0xf4,0x07)
#endif
#else
typedef struct ISpeechPhraseRulesVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpeechPhraseRules *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpeechPhraseRules *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpeechPhraseRules *This);

    /*** IDispatch methods ***/
    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
        ISpeechPhraseRules *This,
        UINT *pctinfo);

    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
        ISpeechPhraseRules *This,
        UINT iTInfo,
        LCID lcid,
        ITypeInfo **ppTInfo);

    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
        ISpeechPhraseRules *This,
        REFIID riid,
        LPOLESTR *rgszNames,
        UINT cNames,
        LCID lcid,
        DISPID *rgDispId);

    HRESULT (STDMETHODCALLTYPE *Invoke)(
        ISpeechPhraseRules *This,
        DISPID dispIdMember,
        REFIID riid,
        LCID lcid,
        WORD wFlags,
        DISPPARAMS *pDispParams,
        VARIANT *pVarResult,
        EXCEPINFO *pExcepInfo,
        UINT *puArgErr);

    /*** ISpeechPhraseRules methods ***/
    HRESULT (STDMETHODCALLTYPE *get_Count)(
        ISpeechPhraseRules *This,
        LONG *Count);

    HRESULT (STDMETHODCALLTYPE *Item)(
        ISpeechPhraseRules *This,
        LONG Index,
        ISpeechPhraseRule **Rule);

    HRESULT (STDMETHODCALLTYPE *get__NewEnum)(
        ISpeechPhraseRules *This,
        IUnknown **EnumVARIANT);

    END_INTERFACE
} ISpeechPhraseRulesVtbl;

interface ISpeechPhraseRules {
    CONST_VTBL ISpeechPhraseRulesVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpeechPhraseRules_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpeechPhraseRules_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpeechPhraseRules_Release(This) (This)->lpVtbl->Release(This)
/*** IDispatch methods ***/
#define ISpeechPhraseRules_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
#define ISpeechPhraseRules_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
#define ISpeechPhraseRules_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
#define ISpeechPhraseRules_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
/*** ISpeechPhraseRules methods ***/
#define ISpeechPhraseRules_get_Count(This,Count) (This)->lpVtbl->get_Count(This,Count)
#define ISpeechPhraseRules_Item(This,Index,Rule) (This)->lpVtbl->Item(This,Index,Rule)
#define ISpeechPhraseRules_get__NewEnum(This,EnumVARIANT) (This)->lpVtbl->get__NewEnum(This,EnumVARIANT)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpeechPhraseRules_QueryInterface(ISpeechPhraseRules* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpeechPhraseRules_AddRef(ISpeechPhraseRules* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpeechPhraseRules_Release(ISpeechPhraseRules* This) {
    return This->lpVtbl->Release(This);
}
/*** IDispatch methods ***/
static FORCEINLINE HRESULT ISpeechPhraseRules_GetTypeInfoCount(ISpeechPhraseRules* This,UINT *pctinfo) {
    return This->lpVtbl->GetTypeInfoCount(This,pctinfo);
}
static FORCEINLINE HRESULT ISpeechPhraseRules_GetTypeInfo(ISpeechPhraseRules* This,UINT iTInfo,LCID lcid,ITypeInfo **ppTInfo) {
    return This->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo);
}
static FORCEINLINE HRESULT ISpeechPhraseRules_GetIDsOfNames(ISpeechPhraseRules* This,REFIID riid,LPOLESTR *rgszNames,UINT cNames,LCID lcid,DISPID *rgDispId) {
    return This->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId);
}
static FORCEINLINE HRESULT ISpeechPhraseRules_Invoke(ISpeechPhraseRules* This,DISPID dispIdMember,REFIID riid,LCID lcid,WORD wFlags,DISPPARAMS *pDispParams,VARIANT *pVarResult,EXCEPINFO *pExcepInfo,UINT *puArgErr) {
    return This->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr);
}
/*** ISpeechPhraseRules methods ***/
static FORCEINLINE HRESULT ISpeechPhraseRules_get_Count(ISpeechPhraseRules* This,LONG *Count) {
    return This->lpVtbl->get_Count(This,Count);
}
static FORCEINLINE HRESULT ISpeechPhraseRules_Item(ISpeechPhraseRules* This,LONG Index,ISpeechPhraseRule **Rule) {
    return This->lpVtbl->Item(This,Index,Rule);
}
static FORCEINLINE HRESULT ISpeechPhraseRules_get__NewEnum(ISpeechPhraseRules* This,IUnknown **EnumVARIANT) {
    return This->lpVtbl->get__NewEnum(This,EnumVARIANT);
}
#endif
#endif

#endif


#endif  /* __ISpeechPhraseRules_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpeechLexiconWords interface
 */
#ifndef __ISpeechLexiconWords_INTERFACE_DEFINED__
#define __ISpeechLexiconWords_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpeechLexiconWords, 0x8d199862, 0x415e, 0x47d5, 0xac,0x4f, 0xfa,0xa6,0x08,0xb4,0x24,0xe6);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("8d199862-415e-47d5-ac4f-faa608b424e6")
ISpeechLexiconWords : public IDispatch
{
    virtual HRESULT STDMETHODCALLTYPE get_Count(
        LONG *Count) = 0;

    virtual HRESULT STDMETHODCALLTYPE Item(
        LONG Index,
        ISpeechLexiconWord **Word) = 0;

    virtual HRESULT STDMETHODCALLTYPE get__NewEnum(
        IUnknown **EnumVARIANT) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpeechLexiconWords, 0x8d199862, 0x415e, 0x47d5, 0xac,0x4f, 0xfa,0xa6,0x08,0xb4,0x24,0xe6)
#endif
#else
typedef struct ISpeechLexiconWordsVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpeechLexiconWords *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpeechLexiconWords *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpeechLexiconWords *This);

    /*** IDispatch methods ***/
    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
        ISpeechLexiconWords *This,
        UINT *pctinfo);

    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
        ISpeechLexiconWords *This,
        UINT iTInfo,
        LCID lcid,
        ITypeInfo **ppTInfo);

    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
        ISpeechLexiconWords *This,
        REFIID riid,
        LPOLESTR *rgszNames,
        UINT cNames,
        LCID lcid,
        DISPID *rgDispId);

    HRESULT (STDMETHODCALLTYPE *Invoke)(
        ISpeechLexiconWords *This,
        DISPID dispIdMember,
        REFIID riid,
        LCID lcid,
        WORD wFlags,
        DISPPARAMS *pDispParams,
        VARIANT *pVarResult,
        EXCEPINFO *pExcepInfo,
        UINT *puArgErr);

    /*** ISpeechLexiconWords methods ***/
    HRESULT (STDMETHODCALLTYPE *get_Count)(
        ISpeechLexiconWords *This,
        LONG *Count);

    HRESULT (STDMETHODCALLTYPE *Item)(
        ISpeechLexiconWords *This,
        LONG Index,
        ISpeechLexiconWord **Word);

    HRESULT (STDMETHODCALLTYPE *get__NewEnum)(
        ISpeechLexiconWords *This,
        IUnknown **EnumVARIANT);

    END_INTERFACE
} ISpeechLexiconWordsVtbl;

interface ISpeechLexiconWords {
    CONST_VTBL ISpeechLexiconWordsVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpeechLexiconWords_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpeechLexiconWords_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpeechLexiconWords_Release(This) (This)->lpVtbl->Release(This)
/*** IDispatch methods ***/
#define ISpeechLexiconWords_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
#define ISpeechLexiconWords_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
#define ISpeechLexiconWords_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
#define ISpeechLexiconWords_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
/*** ISpeechLexiconWords methods ***/
#define ISpeechLexiconWords_get_Count(This,Count) (This)->lpVtbl->get_Count(This,Count)
#define ISpeechLexiconWords_Item(This,Index,Word) (This)->lpVtbl->Item(This,Index,Word)
#define ISpeechLexiconWords_get__NewEnum(This,EnumVARIANT) (This)->lpVtbl->get__NewEnum(This,EnumVARIANT)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpeechLexiconWords_QueryInterface(ISpeechLexiconWords* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpeechLexiconWords_AddRef(ISpeechLexiconWords* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpeechLexiconWords_Release(ISpeechLexiconWords* This) {
    return This->lpVtbl->Release(This);
}
/*** IDispatch methods ***/
static FORCEINLINE HRESULT ISpeechLexiconWords_GetTypeInfoCount(ISpeechLexiconWords* This,UINT *pctinfo) {
    return This->lpVtbl->GetTypeInfoCount(This,pctinfo);
}
static FORCEINLINE HRESULT ISpeechLexiconWords_GetTypeInfo(ISpeechLexiconWords* This,UINT iTInfo,LCID lcid,ITypeInfo **ppTInfo) {
    return This->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo);
}
static FORCEINLINE HRESULT ISpeechLexiconWords_GetIDsOfNames(ISpeechLexiconWords* This,REFIID riid,LPOLESTR *rgszNames,UINT cNames,LCID lcid,DISPID *rgDispId) {
    return This->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId);
}
static FORCEINLINE HRESULT ISpeechLexiconWords_Invoke(ISpeechLexiconWords* This,DISPID dispIdMember,REFIID riid,LCID lcid,WORD wFlags,DISPPARAMS *pDispParams,VARIANT *pVarResult,EXCEPINFO *pExcepInfo,UINT *puArgErr) {
    return This->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr);
}
/*** ISpeechLexiconWords methods ***/
static FORCEINLINE HRESULT ISpeechLexiconWords_get_Count(ISpeechLexiconWords* This,LONG *Count) {
    return This->lpVtbl->get_Count(This,Count);
}
static FORCEINLINE HRESULT ISpeechLexiconWords_Item(ISpeechLexiconWords* This,LONG Index,ISpeechLexiconWord **Word) {
    return This->lpVtbl->Item(This,Index,Word);
}
static FORCEINLINE HRESULT ISpeechLexiconWords_get__NewEnum(ISpeechLexiconWords* This,IUnknown **EnumVARIANT) {
    return This->lpVtbl->get__NewEnum(This,EnumVARIANT);
}
#endif
#endif

#endif


#endif  /* __ISpeechLexiconWords_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpeechLexicon interface
 */
#ifndef __ISpeechLexicon_INTERFACE_DEFINED__
#define __ISpeechLexicon_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpeechLexicon, 0x3da7627a, 0xc7ae, 0x4b23, 0x87,0x08, 0x63,0x8c,0x50,0x36,0x2c,0x25);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("3da7627a-c7ae-4b23-8708-638c50362c25")
ISpeechLexicon : public IDispatch
{
    virtual HRESULT STDMETHODCALLTYPE get_GenerationId(
        LONG *GenerationId) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetWords(
        SpeechLexiconType Flags,
        LONG *GenerationID,
        ISpeechLexiconWords **Words) = 0;

    virtual HRESULT STDMETHODCALLTYPE AddPronunciation(
        BSTR bstrWord,
        SpeechLanguageId LangId,
        SpeechPartOfSpeech PartOfSpeech = SPSUnknown,
        BSTR bstrPronunciation = L"") = 0;

    virtual HRESULT STDMETHODCALLTYPE AddPronunciationByPhoneIds(
        BSTR bstrWord,
        SpeechLanguageId LangId,
        SpeechPartOfSpeech PartOfSpeech = SPSUnknown,
        VARIANT *PhoneIds = 0) = 0;

    virtual HRESULT STDMETHODCALLTYPE RemovePronunciation(
        BSTR bstrWord,
        SpeechLanguageId LangId,
        SpeechPartOfSpeech PartOfSpeech = SPSUnknown,
        BSTR bstrPronunciation = L"") = 0;

    virtual HRESULT STDMETHODCALLTYPE RemovePronunciationByPhoneIds(
        BSTR bstrWord,
        SpeechLanguageId LangId,
        SpeechPartOfSpeech PartOfSpeech = SPSUnknown,
        VARIANT *PhoneIds = 0) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetPronunciations(
        BSTR bstrWord,
        SpeechLanguageId LangId,
        SpeechLexiconType TypeFlags,
        ISpeechLexiconPronunciations **ppPronunciations) = 0;

    virtual HRESULT STDMETHODCALLTYPE GetGenerationChange(
        LONG *GenerationID,
        ISpeechLexiconWords **ppWords) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpeechLexicon, 0x3da7627a, 0xc7ae, 0x4b23, 0x87,0x08, 0x63,0x8c,0x50,0x36,0x2c,0x25)
#endif
#else
typedef struct ISpeechLexiconVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpeechLexicon *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpeechLexicon *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpeechLexicon *This);

    /*** IDispatch methods ***/
    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
        ISpeechLexicon *This,
        UINT *pctinfo);

    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
        ISpeechLexicon *This,
        UINT iTInfo,
        LCID lcid,
        ITypeInfo **ppTInfo);

    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
        ISpeechLexicon *This,
        REFIID riid,
        LPOLESTR *rgszNames,
        UINT cNames,
        LCID lcid,
        DISPID *rgDispId);

    HRESULT (STDMETHODCALLTYPE *Invoke)(
        ISpeechLexicon *This,
        DISPID dispIdMember,
        REFIID riid,
        LCID lcid,
        WORD wFlags,
        DISPPARAMS *pDispParams,
        VARIANT *pVarResult,
        EXCEPINFO *pExcepInfo,
        UINT *puArgErr);

    /*** ISpeechLexicon methods ***/
    HRESULT (STDMETHODCALLTYPE *get_GenerationId)(
        ISpeechLexicon *This,
        LONG *GenerationId);

    HRESULT (STDMETHODCALLTYPE *GetWords)(
        ISpeechLexicon *This,
        SpeechLexiconType Flags,
        LONG *GenerationID,
        ISpeechLexiconWords **Words);

    HRESULT (STDMETHODCALLTYPE *AddPronunciation)(
        ISpeechLexicon *This,
        BSTR bstrWord,
        SpeechLanguageId LangId,
        SpeechPartOfSpeech PartOfSpeech,
        BSTR bstrPronunciation);

    HRESULT (STDMETHODCALLTYPE *AddPronunciationByPhoneIds)(
        ISpeechLexicon *This,
        BSTR bstrWord,
        SpeechLanguageId LangId,
        SpeechPartOfSpeech PartOfSpeech,
        VARIANT *PhoneIds);

    HRESULT (STDMETHODCALLTYPE *RemovePronunciation)(
        ISpeechLexicon *This,
        BSTR bstrWord,
        SpeechLanguageId LangId,
        SpeechPartOfSpeech PartOfSpeech,
        BSTR bstrPronunciation);

    HRESULT (STDMETHODCALLTYPE *RemovePronunciationByPhoneIds)(
        ISpeechLexicon *This,
        BSTR bstrWord,
        SpeechLanguageId LangId,
        SpeechPartOfSpeech PartOfSpeech,
        VARIANT *PhoneIds);

    HRESULT (STDMETHODCALLTYPE *GetPronunciations)(
        ISpeechLexicon *This,
        BSTR bstrWord,
        SpeechLanguageId LangId,
        SpeechLexiconType TypeFlags,
        ISpeechLexiconPronunciations **ppPronunciations);

    HRESULT (STDMETHODCALLTYPE *GetGenerationChange)(
        ISpeechLexicon *This,
        LONG *GenerationID,
        ISpeechLexiconWords **ppWords);

    END_INTERFACE
} ISpeechLexiconVtbl;

interface ISpeechLexicon {
    CONST_VTBL ISpeechLexiconVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpeechLexicon_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpeechLexicon_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpeechLexicon_Release(This) (This)->lpVtbl->Release(This)
/*** IDispatch methods ***/
#define ISpeechLexicon_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
#define ISpeechLexicon_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
#define ISpeechLexicon_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
#define ISpeechLexicon_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
/*** ISpeechLexicon methods ***/
#define ISpeechLexicon_get_GenerationId(This,GenerationId) (This)->lpVtbl->get_GenerationId(This,GenerationId)
#define ISpeechLexicon_GetWords(This,Flags,GenerationID,Words) (This)->lpVtbl->GetWords(This,Flags,GenerationID,Words)
#define ISpeechLexicon_AddPronunciation(This,bstrWord,LangId,PartOfSpeech,bstrPronunciation) (This)->lpVtbl->AddPronunciation(This,bstrWord,LangId,PartOfSpeech,bstrPronunciation)
#define ISpeechLexicon_AddPronunciationByPhoneIds(This,bstrWord,LangId,PartOfSpeech,PhoneIds) (This)->lpVtbl->AddPronunciationByPhoneIds(This,bstrWord,LangId,PartOfSpeech,PhoneIds)
#define ISpeechLexicon_RemovePronunciation(This,bstrWord,LangId,PartOfSpeech,bstrPronunciation) (This)->lpVtbl->RemovePronunciation(This,bstrWord,LangId,PartOfSpeech,bstrPronunciation)
#define ISpeechLexicon_RemovePronunciationByPhoneIds(This,bstrWord,LangId,PartOfSpeech,PhoneIds) (This)->lpVtbl->RemovePronunciationByPhoneIds(This,bstrWord,LangId,PartOfSpeech,PhoneIds)
#define ISpeechLexicon_GetPronunciations(This,bstrWord,LangId,TypeFlags,ppPronunciations) (This)->lpVtbl->GetPronunciations(This,bstrWord,LangId,TypeFlags,ppPronunciations)
#define ISpeechLexicon_GetGenerationChange(This,GenerationID,ppWords) (This)->lpVtbl->GetGenerationChange(This,GenerationID,ppWords)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpeechLexicon_QueryInterface(ISpeechLexicon* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpeechLexicon_AddRef(ISpeechLexicon* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpeechLexicon_Release(ISpeechLexicon* This) {
    return This->lpVtbl->Release(This);
}
/*** IDispatch methods ***/
static FORCEINLINE HRESULT ISpeechLexicon_GetTypeInfoCount(ISpeechLexicon* This,UINT *pctinfo) {
    return This->lpVtbl->GetTypeInfoCount(This,pctinfo);
}
static FORCEINLINE HRESULT ISpeechLexicon_GetTypeInfo(ISpeechLexicon* This,UINT iTInfo,LCID lcid,ITypeInfo **ppTInfo) {
    return This->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo);
}
static FORCEINLINE HRESULT ISpeechLexicon_GetIDsOfNames(ISpeechLexicon* This,REFIID riid,LPOLESTR *rgszNames,UINT cNames,LCID lcid,DISPID *rgDispId) {
    return This->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId);
}
static FORCEINLINE HRESULT ISpeechLexicon_Invoke(ISpeechLexicon* This,DISPID dispIdMember,REFIID riid,LCID lcid,WORD wFlags,DISPPARAMS *pDispParams,VARIANT *pVarResult,EXCEPINFO *pExcepInfo,UINT *puArgErr) {
    return This->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr);
}
/*** ISpeechLexicon methods ***/
static FORCEINLINE HRESULT ISpeechLexicon_get_GenerationId(ISpeechLexicon* This,LONG *GenerationId) {
    return This->lpVtbl->get_GenerationId(This,GenerationId);
}
static FORCEINLINE HRESULT ISpeechLexicon_GetWords(ISpeechLexicon* This,SpeechLexiconType Flags,LONG *GenerationID,ISpeechLexiconWords **Words) {
    return This->lpVtbl->GetWords(This,Flags,GenerationID,Words);
}
static FORCEINLINE HRESULT ISpeechLexicon_AddPronunciation(ISpeechLexicon* This,BSTR bstrWord,SpeechLanguageId LangId,SpeechPartOfSpeech PartOfSpeech,BSTR bstrPronunciation) {
    return This->lpVtbl->AddPronunciation(This,bstrWord,LangId,PartOfSpeech,bstrPronunciation);
}
static FORCEINLINE HRESULT ISpeechLexicon_AddPronunciationByPhoneIds(ISpeechLexicon* This,BSTR bstrWord,SpeechLanguageId LangId,SpeechPartOfSpeech PartOfSpeech,VARIANT *PhoneIds) {
    return This->lpVtbl->AddPronunciationByPhoneIds(This,bstrWord,LangId,PartOfSpeech,PhoneIds);
}
static FORCEINLINE HRESULT ISpeechLexicon_RemovePronunciation(ISpeechLexicon* This,BSTR bstrWord,SpeechLanguageId LangId,SpeechPartOfSpeech PartOfSpeech,BSTR bstrPronunciation) {
    return This->lpVtbl->RemovePronunciation(This,bstrWord,LangId,PartOfSpeech,bstrPronunciation);
}
static FORCEINLINE HRESULT ISpeechLexicon_RemovePronunciationByPhoneIds(ISpeechLexicon* This,BSTR bstrWord,SpeechLanguageId LangId,SpeechPartOfSpeech PartOfSpeech,VARIANT *PhoneIds) {
    return This->lpVtbl->RemovePronunciationByPhoneIds(This,bstrWord,LangId,PartOfSpeech,PhoneIds);
}
static FORCEINLINE HRESULT ISpeechLexicon_GetPronunciations(ISpeechLexicon* This,BSTR bstrWord,SpeechLanguageId LangId,SpeechLexiconType TypeFlags,ISpeechLexiconPronunciations **ppPronunciations) {
    return This->lpVtbl->GetPronunciations(This,bstrWord,LangId,TypeFlags,ppPronunciations);
}
static FORCEINLINE HRESULT ISpeechLexicon_GetGenerationChange(ISpeechLexicon* This,LONG *GenerationID,ISpeechLexiconWords **ppWords) {
    return This->lpVtbl->GetGenerationChange(This,GenerationID,ppWords);
}
#endif
#endif

#endif


#endif  /* __ISpeechLexicon_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpeechLexiconWord interface
 */
#ifndef __ISpeechLexiconWord_INTERFACE_DEFINED__
#define __ISpeechLexiconWord_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpeechLexiconWord, 0x4e5b933c, 0xc9be, 0x48ed, 0x88,0x42, 0x1e,0xe5,0x1b,0xb1,0xd4,0xff);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("4e5b933c-c9be-48ed-8842-1ee51bb1d4ff")
ISpeechLexiconWord : public IDispatch
{
    virtual HRESULT STDMETHODCALLTYPE get_LangId(
        SpeechLanguageId *LangId) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_Type(
        SpeechWordType *WordType) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_Word(
        BSTR *Word) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_Pronunciations(
        ISpeechLexiconPronunciations **Pronunciations) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpeechLexiconWord, 0x4e5b933c, 0xc9be, 0x48ed, 0x88,0x42, 0x1e,0xe5,0x1b,0xb1,0xd4,0xff)
#endif
#else
typedef struct ISpeechLexiconWordVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpeechLexiconWord *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpeechLexiconWord *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpeechLexiconWord *This);

    /*** IDispatch methods ***/
    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
        ISpeechLexiconWord *This,
        UINT *pctinfo);

    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
        ISpeechLexiconWord *This,
        UINT iTInfo,
        LCID lcid,
        ITypeInfo **ppTInfo);

    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
        ISpeechLexiconWord *This,
        REFIID riid,
        LPOLESTR *rgszNames,
        UINT cNames,
        LCID lcid,
        DISPID *rgDispId);

    HRESULT (STDMETHODCALLTYPE *Invoke)(
        ISpeechLexiconWord *This,
        DISPID dispIdMember,
        REFIID riid,
        LCID lcid,
        WORD wFlags,
        DISPPARAMS *pDispParams,
        VARIANT *pVarResult,
        EXCEPINFO *pExcepInfo,
        UINT *puArgErr);

    /*** ISpeechLexiconWord methods ***/
    HRESULT (STDMETHODCALLTYPE *get_LangId)(
        ISpeechLexiconWord *This,
        SpeechLanguageId *LangId);

    HRESULT (STDMETHODCALLTYPE *get_Type)(
        ISpeechLexiconWord *This,
        SpeechWordType *WordType);

    HRESULT (STDMETHODCALLTYPE *get_Word)(
        ISpeechLexiconWord *This,
        BSTR *Word);

    HRESULT (STDMETHODCALLTYPE *get_Pronunciations)(
        ISpeechLexiconWord *This,
        ISpeechLexiconPronunciations **Pronunciations);

    END_INTERFACE
} ISpeechLexiconWordVtbl;

interface ISpeechLexiconWord {
    CONST_VTBL ISpeechLexiconWordVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpeechLexiconWord_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpeechLexiconWord_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpeechLexiconWord_Release(This) (This)->lpVtbl->Release(This)
/*** IDispatch methods ***/
#define ISpeechLexiconWord_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
#define ISpeechLexiconWord_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
#define ISpeechLexiconWord_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
#define ISpeechLexiconWord_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
/*** ISpeechLexiconWord methods ***/
#define ISpeechLexiconWord_get_LangId(This,LangId) (This)->lpVtbl->get_LangId(This,LangId)
#define ISpeechLexiconWord_get_Type(This,WordType) (This)->lpVtbl->get_Type(This,WordType)
#define ISpeechLexiconWord_get_Word(This,Word) (This)->lpVtbl->get_Word(This,Word)
#define ISpeechLexiconWord_get_Pronunciations(This,Pronunciations) (This)->lpVtbl->get_Pronunciations(This,Pronunciations)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpeechLexiconWord_QueryInterface(ISpeechLexiconWord* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpeechLexiconWord_AddRef(ISpeechLexiconWord* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpeechLexiconWord_Release(ISpeechLexiconWord* This) {
    return This->lpVtbl->Release(This);
}
/*** IDispatch methods ***/
static FORCEINLINE HRESULT ISpeechLexiconWord_GetTypeInfoCount(ISpeechLexiconWord* This,UINT *pctinfo) {
    return This->lpVtbl->GetTypeInfoCount(This,pctinfo);
}
static FORCEINLINE HRESULT ISpeechLexiconWord_GetTypeInfo(ISpeechLexiconWord* This,UINT iTInfo,LCID lcid,ITypeInfo **ppTInfo) {
    return This->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo);
}
static FORCEINLINE HRESULT ISpeechLexiconWord_GetIDsOfNames(ISpeechLexiconWord* This,REFIID riid,LPOLESTR *rgszNames,UINT cNames,LCID lcid,DISPID *rgDispId) {
    return This->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId);
}
static FORCEINLINE HRESULT ISpeechLexiconWord_Invoke(ISpeechLexiconWord* This,DISPID dispIdMember,REFIID riid,LCID lcid,WORD wFlags,DISPPARAMS *pDispParams,VARIANT *pVarResult,EXCEPINFO *pExcepInfo,UINT *puArgErr) {
    return This->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr);
}
/*** ISpeechLexiconWord methods ***/
static FORCEINLINE HRESULT ISpeechLexiconWord_get_LangId(ISpeechLexiconWord* This,SpeechLanguageId *LangId) {
    return This->lpVtbl->get_LangId(This,LangId);
}
static FORCEINLINE HRESULT ISpeechLexiconWord_get_Type(ISpeechLexiconWord* This,SpeechWordType *WordType) {
    return This->lpVtbl->get_Type(This,WordType);
}
static FORCEINLINE HRESULT ISpeechLexiconWord_get_Word(ISpeechLexiconWord* This,BSTR *Word) {
    return This->lpVtbl->get_Word(This,Word);
}
static FORCEINLINE HRESULT ISpeechLexiconWord_get_Pronunciations(ISpeechLexiconWord* This,ISpeechLexiconPronunciations **Pronunciations) {
    return This->lpVtbl->get_Pronunciations(This,Pronunciations);
}
#endif
#endif

#endif


#endif  /* __ISpeechLexiconWord_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpeechLexiconPronunciations interface
 */
#ifndef __ISpeechLexiconPronunciations_INTERFACE_DEFINED__
#define __ISpeechLexiconPronunciations_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpeechLexiconPronunciations, 0x72829128, 0x5682, 0x4704, 0xa0,0xd4, 0x3e,0x2b,0xb6,0xf2,0xea,0xd3);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("72829128-5682-4704-a0d4-3e2bb6f2ead3")
ISpeechLexiconPronunciations : public IDispatch
{
    virtual HRESULT STDMETHODCALLTYPE get_Count(
        LONG *Count) = 0;

    virtual HRESULT STDMETHODCALLTYPE Item(
        LONG Index,
        ISpeechLexiconPronunciation **Pronunciation) = 0;

    virtual HRESULT STDMETHODCALLTYPE get__NewEnum(
        IUnknown **EnumVARIANT) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpeechLexiconPronunciations, 0x72829128, 0x5682, 0x4704, 0xa0,0xd4, 0x3e,0x2b,0xb6,0xf2,0xea,0xd3)
#endif
#else
typedef struct ISpeechLexiconPronunciationsVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpeechLexiconPronunciations *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpeechLexiconPronunciations *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpeechLexiconPronunciations *This);

    /*** IDispatch methods ***/
    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
        ISpeechLexiconPronunciations *This,
        UINT *pctinfo);

    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
        ISpeechLexiconPronunciations *This,
        UINT iTInfo,
        LCID lcid,
        ITypeInfo **ppTInfo);

    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
        ISpeechLexiconPronunciations *This,
        REFIID riid,
        LPOLESTR *rgszNames,
        UINT cNames,
        LCID lcid,
        DISPID *rgDispId);

    HRESULT (STDMETHODCALLTYPE *Invoke)(
        ISpeechLexiconPronunciations *This,
        DISPID dispIdMember,
        REFIID riid,
        LCID lcid,
        WORD wFlags,
        DISPPARAMS *pDispParams,
        VARIANT *pVarResult,
        EXCEPINFO *pExcepInfo,
        UINT *puArgErr);

    /*** ISpeechLexiconPronunciations methods ***/
    HRESULT (STDMETHODCALLTYPE *get_Count)(
        ISpeechLexiconPronunciations *This,
        LONG *Count);

    HRESULT (STDMETHODCALLTYPE *Item)(
        ISpeechLexiconPronunciations *This,
        LONG Index,
        ISpeechLexiconPronunciation **Pronunciation);

    HRESULT (STDMETHODCALLTYPE *get__NewEnum)(
        ISpeechLexiconPronunciations *This,
        IUnknown **EnumVARIANT);

    END_INTERFACE
} ISpeechLexiconPronunciationsVtbl;

interface ISpeechLexiconPronunciations {
    CONST_VTBL ISpeechLexiconPronunciationsVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpeechLexiconPronunciations_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpeechLexiconPronunciations_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpeechLexiconPronunciations_Release(This) (This)->lpVtbl->Release(This)
/*** IDispatch methods ***/
#define ISpeechLexiconPronunciations_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
#define ISpeechLexiconPronunciations_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
#define ISpeechLexiconPronunciations_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
#define ISpeechLexiconPronunciations_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
/*** ISpeechLexiconPronunciations methods ***/
#define ISpeechLexiconPronunciations_get_Count(This,Count) (This)->lpVtbl->get_Count(This,Count)
#define ISpeechLexiconPronunciations_Item(This,Index,Pronunciation) (This)->lpVtbl->Item(This,Index,Pronunciation)
#define ISpeechLexiconPronunciations_get__NewEnum(This,EnumVARIANT) (This)->lpVtbl->get__NewEnum(This,EnumVARIANT)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpeechLexiconPronunciations_QueryInterface(ISpeechLexiconPronunciations* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpeechLexiconPronunciations_AddRef(ISpeechLexiconPronunciations* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpeechLexiconPronunciations_Release(ISpeechLexiconPronunciations* This) {
    return This->lpVtbl->Release(This);
}
/*** IDispatch methods ***/
static FORCEINLINE HRESULT ISpeechLexiconPronunciations_GetTypeInfoCount(ISpeechLexiconPronunciations* This,UINT *pctinfo) {
    return This->lpVtbl->GetTypeInfoCount(This,pctinfo);
}
static FORCEINLINE HRESULT ISpeechLexiconPronunciations_GetTypeInfo(ISpeechLexiconPronunciations* This,UINT iTInfo,LCID lcid,ITypeInfo **ppTInfo) {
    return This->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo);
}
static FORCEINLINE HRESULT ISpeechLexiconPronunciations_GetIDsOfNames(ISpeechLexiconPronunciations* This,REFIID riid,LPOLESTR *rgszNames,UINT cNames,LCID lcid,DISPID *rgDispId) {
    return This->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId);
}
static FORCEINLINE HRESULT ISpeechLexiconPronunciations_Invoke(ISpeechLexiconPronunciations* This,DISPID dispIdMember,REFIID riid,LCID lcid,WORD wFlags,DISPPARAMS *pDispParams,VARIANT *pVarResult,EXCEPINFO *pExcepInfo,UINT *puArgErr) {
    return This->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr);
}
/*** ISpeechLexiconPronunciations methods ***/
static FORCEINLINE HRESULT ISpeechLexiconPronunciations_get_Count(ISpeechLexiconPronunciations* This,LONG *Count) {
    return This->lpVtbl->get_Count(This,Count);
}
static FORCEINLINE HRESULT ISpeechLexiconPronunciations_Item(ISpeechLexiconPronunciations* This,LONG Index,ISpeechLexiconPronunciation **Pronunciation) {
    return This->lpVtbl->Item(This,Index,Pronunciation);
}
static FORCEINLINE HRESULT ISpeechLexiconPronunciations_get__NewEnum(ISpeechLexiconPronunciations* This,IUnknown **EnumVARIANT) {
    return This->lpVtbl->get__NewEnum(This,EnumVARIANT);
}
#endif
#endif

#endif


#endif  /* __ISpeechLexiconPronunciations_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpeechLexiconPronunciation interface
 */
#ifndef __ISpeechLexiconPronunciation_INTERFACE_DEFINED__
#define __ISpeechLexiconPronunciation_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpeechLexiconPronunciation, 0x95252c5d, 0x9e43, 0x4f4a, 0x98,0x99, 0x48,0xee,0x73,0x35,0x2f,0x9f);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("95252c5d-9e43-4f4a-9899-48ee73352f9f")
ISpeechLexiconPronunciation : public IDispatch
{
    virtual HRESULT STDMETHODCALLTYPE get_Type(
        SpeechLexiconType *LexiconType) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_LangId(
        SpeechLanguageId *LangId) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_PartOfSpeech(
        SpeechPartOfSpeech *PartOfSpeech) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_PhoneIds(
        VARIANT *PhoneIds) = 0;

    virtual HRESULT STDMETHODCALLTYPE get_Symbolic(
        BSTR *Symbolic) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpeechLexiconPronunciation, 0x95252c5d, 0x9e43, 0x4f4a, 0x98,0x99, 0x48,0xee,0x73,0x35,0x2f,0x9f)
#endif
#else
typedef struct ISpeechLexiconPronunciationVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpeechLexiconPronunciation *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpeechLexiconPronunciation *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpeechLexiconPronunciation *This);

    /*** IDispatch methods ***/
    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
        ISpeechLexiconPronunciation *This,
        UINT *pctinfo);

    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
        ISpeechLexiconPronunciation *This,
        UINT iTInfo,
        LCID lcid,
        ITypeInfo **ppTInfo);

    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
        ISpeechLexiconPronunciation *This,
        REFIID riid,
        LPOLESTR *rgszNames,
        UINT cNames,
        LCID lcid,
        DISPID *rgDispId);

    HRESULT (STDMETHODCALLTYPE *Invoke)(
        ISpeechLexiconPronunciation *This,
        DISPID dispIdMember,
        REFIID riid,
        LCID lcid,
        WORD wFlags,
        DISPPARAMS *pDispParams,
        VARIANT *pVarResult,
        EXCEPINFO *pExcepInfo,
        UINT *puArgErr);

    /*** ISpeechLexiconPronunciation methods ***/
    HRESULT (STDMETHODCALLTYPE *get_Type)(
        ISpeechLexiconPronunciation *This,
        SpeechLexiconType *LexiconType);

    HRESULT (STDMETHODCALLTYPE *get_LangId)(
        ISpeechLexiconPronunciation *This,
        SpeechLanguageId *LangId);

    HRESULT (STDMETHODCALLTYPE *get_PartOfSpeech)(
        ISpeechLexiconPronunciation *This,
        SpeechPartOfSpeech *PartOfSpeech);

    HRESULT (STDMETHODCALLTYPE *get_PhoneIds)(
        ISpeechLexiconPronunciation *This,
        VARIANT *PhoneIds);

    HRESULT (STDMETHODCALLTYPE *get_Symbolic)(
        ISpeechLexiconPronunciation *This,
        BSTR *Symbolic);

    END_INTERFACE
} ISpeechLexiconPronunciationVtbl;

interface ISpeechLexiconPronunciation {
    CONST_VTBL ISpeechLexiconPronunciationVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpeechLexiconPronunciation_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpeechLexiconPronunciation_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpeechLexiconPronunciation_Release(This) (This)->lpVtbl->Release(This)
/*** IDispatch methods ***/
#define ISpeechLexiconPronunciation_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
#define ISpeechLexiconPronunciation_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
#define ISpeechLexiconPronunciation_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
#define ISpeechLexiconPronunciation_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
/*** ISpeechLexiconPronunciation methods ***/
#define ISpeechLexiconPronunciation_get_Type(This,LexiconType) (This)->lpVtbl->get_Type(This,LexiconType)
#define ISpeechLexiconPronunciation_get_LangId(This,LangId) (This)->lpVtbl->get_LangId(This,LangId)
#define ISpeechLexiconPronunciation_get_PartOfSpeech(This,PartOfSpeech) (This)->lpVtbl->get_PartOfSpeech(This,PartOfSpeech)
#define ISpeechLexiconPronunciation_get_PhoneIds(This,PhoneIds) (This)->lpVtbl->get_PhoneIds(This,PhoneIds)
#define ISpeechLexiconPronunciation_get_Symbolic(This,Symbolic) (This)->lpVtbl->get_Symbolic(This,Symbolic)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpeechLexiconPronunciation_QueryInterface(ISpeechLexiconPronunciation* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpeechLexiconPronunciation_AddRef(ISpeechLexiconPronunciation* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpeechLexiconPronunciation_Release(ISpeechLexiconPronunciation* This) {
    return This->lpVtbl->Release(This);
}
/*** IDispatch methods ***/
static FORCEINLINE HRESULT ISpeechLexiconPronunciation_GetTypeInfoCount(ISpeechLexiconPronunciation* This,UINT *pctinfo) {
    return This->lpVtbl->GetTypeInfoCount(This,pctinfo);
}
static FORCEINLINE HRESULT ISpeechLexiconPronunciation_GetTypeInfo(ISpeechLexiconPronunciation* This,UINT iTInfo,LCID lcid,ITypeInfo **ppTInfo) {
    return This->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo);
}
static FORCEINLINE HRESULT ISpeechLexiconPronunciation_GetIDsOfNames(ISpeechLexiconPronunciation* This,REFIID riid,LPOLESTR *rgszNames,UINT cNames,LCID lcid,DISPID *rgDispId) {
    return This->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId);
}
static FORCEINLINE HRESULT ISpeechLexiconPronunciation_Invoke(ISpeechLexiconPronunciation* This,DISPID dispIdMember,REFIID riid,LCID lcid,WORD wFlags,DISPPARAMS *pDispParams,VARIANT *pVarResult,EXCEPINFO *pExcepInfo,UINT *puArgErr) {
    return This->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr);
}
/*** ISpeechLexiconPronunciation methods ***/
static FORCEINLINE HRESULT ISpeechLexiconPronunciation_get_Type(ISpeechLexiconPronunciation* This,SpeechLexiconType *LexiconType) {
    return This->lpVtbl->get_Type(This,LexiconType);
}
static FORCEINLINE HRESULT ISpeechLexiconPronunciation_get_LangId(ISpeechLexiconPronunciation* This,SpeechLanguageId *LangId) {
    return This->lpVtbl->get_LangId(This,LangId);
}
static FORCEINLINE HRESULT ISpeechLexiconPronunciation_get_PartOfSpeech(ISpeechLexiconPronunciation* This,SpeechPartOfSpeech *PartOfSpeech) {
    return This->lpVtbl->get_PartOfSpeech(This,PartOfSpeech);
}
static FORCEINLINE HRESULT ISpeechLexiconPronunciation_get_PhoneIds(ISpeechLexiconPronunciation* This,VARIANT *PhoneIds) {
    return This->lpVtbl->get_PhoneIds(This,PhoneIds);
}
static FORCEINLINE HRESULT ISpeechLexiconPronunciation_get_Symbolic(ISpeechLexiconPronunciation* This,BSTR *Symbolic) {
    return This->lpVtbl->get_Symbolic(This,Symbolic);
}
#endif
#endif

#endif


#endif  /* __ISpeechLexiconPronunciation_INTERFACE_DEFINED__ */

/*****************************************************************************
 * ISpeechPhoneConverter interface
 */
#ifndef __ISpeechPhoneConverter_INTERFACE_DEFINED__
#define __ISpeechPhoneConverter_INTERFACE_DEFINED__

DEFINE_GUID(IID_ISpeechPhoneConverter, 0xc3e4f353, 0x433f, 0x43d6, 0x89,0xa1, 0x6a,0x62,0xa7,0x05,0x4c,0x3d);
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("c3e4f353-433f-43d6-89a1-6a62a7054c3d")
ISpeechPhoneConverter : public IDispatch
{
    virtual HRESULT STDMETHODCALLTYPE get_LanguageId(
        SpeechLanguageId *LanguageId) = 0;

    virtual HRESULT STDMETHODCALLTYPE put_LanguageId(
        SpeechLanguageId LanguageId) = 0;

    virtual HRESULT STDMETHODCALLTYPE PhoneToId(
        const BSTR Phonemes,
        VARIANT *IdArray) = 0;

    virtual HRESULT STDMETHODCALLTYPE IdToPhone(
        const VARIANT IdArray,
        BSTR *Phonemes) = 0;

};
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(ISpeechPhoneConverter, 0xc3e4f353, 0x433f, 0x43d6, 0x89,0xa1, 0x6a,0x62,0xa7,0x05,0x4c,0x3d)
#endif
#else
typedef struct ISpeechPhoneConverterVtbl {
    BEGIN_INTERFACE

    /*** IUnknown methods ***/
    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
        ISpeechPhoneConverter *This,
        REFIID riid,
        void **ppvObject);

    ULONG (STDMETHODCALLTYPE *AddRef)(
        ISpeechPhoneConverter *This);

    ULONG (STDMETHODCALLTYPE *Release)(
        ISpeechPhoneConverter *This);

    /*** IDispatch methods ***/
    HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
        ISpeechPhoneConverter *This,
        UINT *pctinfo);

    HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
        ISpeechPhoneConverter *This,
        UINT iTInfo,
        LCID lcid,
        ITypeInfo **ppTInfo);

    HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
        ISpeechPhoneConverter *This,
        REFIID riid,
        LPOLESTR *rgszNames,
        UINT cNames,
        LCID lcid,
        DISPID *rgDispId);

    HRESULT (STDMETHODCALLTYPE *Invoke)(
        ISpeechPhoneConverter *This,
        DISPID dispIdMember,
        REFIID riid,
        LCID lcid,
        WORD wFlags,
        DISPPARAMS *pDispParams,
        VARIANT *pVarResult,
        EXCEPINFO *pExcepInfo,
        UINT *puArgErr);

    /*** ISpeechPhoneConverter methods ***/
    HRESULT (STDMETHODCALLTYPE *get_LanguageId)(
        ISpeechPhoneConverter *This,
        SpeechLanguageId *LanguageId);

    HRESULT (STDMETHODCALLTYPE *put_LanguageId)(
        ISpeechPhoneConverter *This,
        SpeechLanguageId LanguageId);

    HRESULT (STDMETHODCALLTYPE *PhoneToId)(
        ISpeechPhoneConverter *This,
        const BSTR Phonemes,
        VARIANT *IdArray);

    HRESULT (STDMETHODCALLTYPE *IdToPhone)(
        ISpeechPhoneConverter *This,
        const VARIANT IdArray,
        BSTR *Phonemes);

    END_INTERFACE
} ISpeechPhoneConverterVtbl;

interface ISpeechPhoneConverter {
    CONST_VTBL ISpeechPhoneConverterVtbl* lpVtbl;
};

#ifdef COBJMACROS
#ifndef WIDL_C_INLINE_WRAPPERS
/*** IUnknown methods ***/
#define ISpeechPhoneConverter_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define ISpeechPhoneConverter_AddRef(This) (This)->lpVtbl->AddRef(This)
#define ISpeechPhoneConverter_Release(This) (This)->lpVtbl->Release(This)
/*** IDispatch methods ***/
#define ISpeechPhoneConverter_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
#define ISpeechPhoneConverter_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
#define ISpeechPhoneConverter_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
#define ISpeechPhoneConverter_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
/*** ISpeechPhoneConverter methods ***/
#define ISpeechPhoneConverter_get_LanguageId(This,LanguageId) (This)->lpVtbl->get_LanguageId(This,LanguageId)
#define ISpeechPhoneConverter_put_LanguageId(This,LanguageId) (This)->lpVtbl->put_LanguageId(This,LanguageId)
#define ISpeechPhoneConverter_PhoneToId(This,Phonemes,IdArray) (This)->lpVtbl->PhoneToId(This,Phonemes,IdArray)
#define ISpeechPhoneConverter_IdToPhone(This,IdArray,Phonemes) (This)->lpVtbl->IdToPhone(This,IdArray,Phonemes)
#else
/*** IUnknown methods ***/
static FORCEINLINE HRESULT ISpeechPhoneConverter_QueryInterface(ISpeechPhoneConverter* This,REFIID riid,void **ppvObject) {
    return This->lpVtbl->QueryInterface(This,riid,ppvObject);
}
static FORCEINLINE ULONG ISpeechPhoneConverter_AddRef(ISpeechPhoneConverter* This) {
    return This->lpVtbl->AddRef(This);
}
static FORCEINLINE ULONG ISpeechPhoneConverter_Release(ISpeechPhoneConverter* This) {
    return This->lpVtbl->Release(This);
}
/*** IDispatch methods ***/
static FORCEINLINE HRESULT ISpeechPhoneConverter_GetTypeInfoCount(ISpeechPhoneConverter* This,UINT *pctinfo) {
    return This->lpVtbl->GetTypeInfoCount(This,pctinfo);
}
static FORCEINLINE HRESULT ISpeechPhoneConverter_GetTypeInfo(ISpeechPhoneConverter* This,UINT iTInfo,LCID lcid,ITypeInfo **ppTInfo) {
    return This->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo);
}
static FORCEINLINE HRESULT ISpeechPhoneConverter_GetIDsOfNames(ISpeechPhoneConverter* This,REFIID riid,LPOLESTR *rgszNames,UINT cNames,LCID lcid,DISPID *rgDispId) {
    return This->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId);
}
static FORCEINLINE HRESULT ISpeechPhoneConverter_Invoke(ISpeechPhoneConverter* This,DISPID dispIdMember,REFIID riid,LCID lcid,WORD wFlags,DISPPARAMS *pDispParams,VARIANT *pVarResult,EXCEPINFO *pExcepInfo,UINT *puArgErr) {
    return This->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr);
}
/*** ISpeechPhoneConverter methods ***/
static FORCEINLINE HRESULT ISpeechPhoneConverter_get_LanguageId(ISpeechPhoneConverter* This,SpeechLanguageId *LanguageId) {
    return This->lpVtbl->get_LanguageId(This,LanguageId);
}
static FORCEINLINE HRESULT ISpeechPhoneConverter_put_LanguageId(ISpeechPhoneConverter* This,SpeechLanguageId LanguageId) {
    return This->lpVtbl->put_LanguageId(This,LanguageId);
}
static FORCEINLINE HRESULT ISpeechPhoneConverter_PhoneToId(ISpeechPhoneConverter* This,const BSTR Phonemes,VARIANT *IdArray) {
    return This->lpVtbl->PhoneToId(This,Phonemes,IdArray);
}
static FORCEINLINE HRESULT ISpeechPhoneConverter_IdToPhone(ISpeechPhoneConverter* This,const VARIANT IdArray,BSTR *Phonemes) {
    return This->lpVtbl->IdToPhone(This,IdArray,Phonemes);
}
#endif
#endif

#endif


#endif  /* __ISpeechPhoneConverter_INTERFACE_DEFINED__ */

/*****************************************************************************
 * SpNotifyTranslator coclass
 */

DEFINE_GUID(CLSID_SpNotifyTranslator, 0xe2ae5372, 0x5d40, 0x11d2, 0x96,0x0e, 0x00,0xc0,0x4f,0x8e,0xe6,0x28);

#ifdef __cplusplus
class DECLSPEC_UUID("e2ae5372-5d40-11d2-960e-00c04f8ee628") SpNotifyTranslator;
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(SpNotifyTranslator, 0xe2ae5372, 0x5d40, 0x11d2, 0x96,0x0e, 0x00,0xc0,0x4f,0x8e,0xe6,0x28)
#endif
#endif

/*****************************************************************************
 * SpObjectTokenCategory coclass
 */

DEFINE_GUID(CLSID_SpObjectTokenCategory, 0xa910187f, 0x0c7a, 0x45ac, 0x92,0xcc, 0x59,0xed,0xaf,0xb7,0x7b,0x53);

#ifdef __cplusplus
class DECLSPEC_UUID("a910187f-0c7a-45ac-92cc-59edafb77b53") SpObjectTokenCategory;
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(SpObjectTokenCategory, 0xa910187f, 0x0c7a, 0x45ac, 0x92,0xcc, 0x59,0xed,0xaf,0xb7,0x7b,0x53)
#endif
#endif

/*****************************************************************************
 * SpObjectToken coclass
 */

DEFINE_GUID(CLSID_SpObjectToken, 0xef411752, 0x3736, 0x4cb4, 0x9c,0x8c, 0x8e,0xf4,0xcc,0xb5,0x8e,0xfe);

#ifdef __cplusplus
class DECLSPEC_UUID("ef411752-3736-4cb4-9c8c-8ef4ccb58efe") SpObjectToken;
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(SpObjectToken, 0xef411752, 0x3736, 0x4cb4, 0x9c,0x8c, 0x8e,0xf4,0xcc,0xb5,0x8e,0xfe)
#endif
#endif

/*****************************************************************************
 * SpResourceManager coclass
 */

DEFINE_GUID(CLSID_SpResourceManager, 0x96749373, 0x3391, 0x11d2, 0x9e,0xe3, 0x00,0xc0,0x4f,0x79,0x73,0x96);

#ifdef __cplusplus
class DECLSPEC_UUID("96749373-3391-11d2-9ee3-00c04f797396") SpResourceManager;
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(SpResourceManager, 0x96749373, 0x3391, 0x11d2, 0x9e,0xe3, 0x00,0xc0,0x4f,0x79,0x73,0x96)
#endif
#endif

/*****************************************************************************
 * SpStreamFormatConverter coclass
 */

DEFINE_GUID(CLSID_SpStreamFormatConverter, 0x7013943a, 0xe2ec, 0x11d2, 0xa0,0x86, 0x00,0xc0,0x4f,0x8e,0xf9,0xb5);

#ifdef __cplusplus
class DECLSPEC_UUID("7013943a-e2ec-11d2-a086-00c04f8ef9b5") SpStreamFormatConverter;
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(SpStreamFormatConverter, 0x7013943a, 0xe2ec, 0x11d2, 0xa0,0x86, 0x00,0xc0,0x4f,0x8e,0xf9,0xb5)
#endif
#endif

/*****************************************************************************
 * SpMMAudioEnum coclass
 */

DEFINE_GUID(CLSID_SpMMAudioEnum, 0xab1890a0, 0xe91f, 0x11d2, 0xbb,0x91, 0x00,0xc0,0x4f,0x8e,0xe6,0xc0);

#ifdef __cplusplus
class DECLSPEC_UUID("ab1890a0-e91f-11d2-bb91-00c04f8ee6c0") SpMMAudioEnum;
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(SpMMAudioEnum, 0xab1890a0, 0xe91f, 0x11d2, 0xbb,0x91, 0x00,0xc0,0x4f,0x8e,0xe6,0xc0)
#endif
#endif

/*****************************************************************************
 * SpMMAudioIn coclass
 */

DEFINE_GUID(CLSID_SpMMAudioIn, 0xcf3d2e50, 0x53f2, 0x11d2, 0x96,0x0c, 0x00,0xc0,0x4f,0x8e,0xe6,0x28);

#ifdef __cplusplus
class DECLSPEC_UUID("cf3d2e50-53f2-11d2-960c-00c04f8ee628") SpMMAudioIn;
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(SpMMAudioIn, 0xcf3d2e50, 0x53f2, 0x11d2, 0x96,0x0c, 0x00,0xc0,0x4f,0x8e,0xe6,0x28)
#endif
#endif

/*****************************************************************************
 * SpMMAudioOut coclass
 */

DEFINE_GUID(CLSID_SpMMAudioOut, 0xa8c680eb, 0x3d32, 0x11d2, 0x9e,0xe7, 0x00,0xc0,0x4f,0x79,0x73,0x96);

#ifdef __cplusplus
class DECLSPEC_UUID("a8c680eb-3d32-11d2-9ee7-00c04f797396") SpMMAudioOut;
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(SpMMAudioOut, 0xa8c680eb, 0x3d32, 0x11d2, 0x9e,0xe7, 0x00,0xc0,0x4f,0x79,0x73,0x96)
#endif
#endif

/*****************************************************************************
 * SpStream coclass
 */

DEFINE_GUID(CLSID_SpStream, 0x715d9c59, 0x4442, 0x11d2, 0x96,0x05, 0x00,0xc0,0x4f,0x8e,0xe6,0x28);

#ifdef __cplusplus
class DECLSPEC_UUID("715d9c59-4442-11d2-9605-00c04f8ee628") SpStream;
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(SpStream, 0x715d9c59, 0x4442, 0x11d2, 0x96,0x05, 0x00,0xc0,0x4f,0x8e,0xe6,0x28)
#endif
#endif

/*****************************************************************************
 * SpVoice coclass
 */

DEFINE_GUID(CLSID_SpVoice, 0x96749377, 0x3391, 0x11d2, 0x9e,0xe3, 0x00,0xc0,0x4f,0x79,0x73,0x96);

#ifdef __cplusplus
class DECLSPEC_UUID("96749377-3391-11d2-9ee3-00c04f797396") SpVoice;
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(SpVoice, 0x96749377, 0x3391, 0x11d2, 0x9e,0xe3, 0x00,0xc0,0x4f,0x79,0x73,0x96)
#endif
#endif

/*****************************************************************************
 * SpSharedRecoContext coclass
 */

DEFINE_GUID(CLSID_SpSharedRecoContext, 0x47206204, 0x5eca, 0x11d2, 0x96,0x0f, 0x00,0xc0,0x4f,0x8e,0xe6,0x28);

#ifdef __cplusplus
class DECLSPEC_UUID("47206204-5eca-11d2-960f-00c04f8ee628") SpSharedRecoContext;
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(SpSharedRecoContext, 0x47206204, 0x5eca, 0x11d2, 0x96,0x0f, 0x00,0xc0,0x4f,0x8e,0xe6,0x28)
#endif
#endif

/*****************************************************************************
 * SpInprocRecognizer coclass
 */

DEFINE_GUID(CLSID_SpInprocRecognizer, 0x41b89b6b, 0x9399, 0x11d2, 0x96,0x23, 0x00,0xc0,0x4f,0x8e,0xe6,0x28);

#ifdef __cplusplus
class DECLSPEC_UUID("41b89b6b-9399-11d2-9623-00c04f8ee628") SpInprocRecognizer;
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(SpInprocRecognizer, 0x41b89b6b, 0x9399, 0x11d2, 0x96,0x23, 0x00,0xc0,0x4f,0x8e,0xe6,0x28)
#endif
#endif

/*****************************************************************************
 * SpSharedRecognizer coclass
 */

DEFINE_GUID(CLSID_SpSharedRecognizer, 0x3bee4890, 0x4fe9, 0x4a37, 0x8c,0x1e, 0x5e,0x7e,0x12,0x79,0x1c,0x1f);

#ifdef __cplusplus
class DECLSPEC_UUID("3bee4890-4fe9-4a37-8c1e-5e7e12791c1f") SpSharedRecognizer;
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(SpSharedRecognizer, 0x3bee4890, 0x4fe9, 0x4a37, 0x8c,0x1e, 0x5e,0x7e,0x12,0x79,0x1c,0x1f)
#endif
#endif

/*****************************************************************************
 * SpLexicon coclass
 */

DEFINE_GUID(CLSID_SpLexicon, 0x0655e396, 0x25d0, 0x11d3, 0x9c,0x26, 0x00,0xc0,0x4f,0x8e,0xf8,0x7c);

#ifdef __cplusplus
class DECLSPEC_UUID("0655e396-25d0-11d3-9c26-00c04f8ef87c") SpLexicon;
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(SpLexicon, 0x0655e396, 0x25d0, 0x11d3, 0x9c,0x26, 0x00,0xc0,0x4f,0x8e,0xf8,0x7c)
#endif
#endif

/*****************************************************************************
 * SpUnCompressedLexicon coclass
 */

DEFINE_GUID(CLSID_SpUnCompressedLexicon, 0xc9e37c15, 0xdf92, 0x4727, 0x85,0xd6, 0x72,0xe5,0xee,0xb6,0x99,0x5a);

#ifdef __cplusplus
class DECLSPEC_UUID("c9e37c15-df92-4727-85d6-72e5eeb6995a") SpUnCompressedLexicon;
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(SpUnCompressedLexicon, 0xc9e37c15, 0xdf92, 0x4727, 0x85,0xd6, 0x72,0xe5,0xee,0xb6,0x99,0x5a)
#endif
#endif

/*****************************************************************************
 * SpCompressedLexicon coclass
 */

DEFINE_GUID(CLSID_SpCompressedLexicon, 0x90903716, 0x2f42, 0x11d3, 0x9c,0x26, 0x00,0xc0,0x4f,0x8e,0xf8,0x7c);

#ifdef __cplusplus
class DECLSPEC_UUID("90903716-2f42-11d3-9c26-00c04f8ef87c") SpCompressedLexicon;
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(SpCompressedLexicon, 0x90903716, 0x2f42, 0x11d3, 0x9c,0x26, 0x00,0xc0,0x4f,0x8e,0xf8,0x7c)
#endif
#endif

/*****************************************************************************
 * SpShortcut coclass
 */

DEFINE_GUID(CLSID_SpShortcut, 0x0d722f1a, 0x9fcf, 0x4e62, 0x96,0xd8, 0x6d,0xf8,0xf0,0x1a,0x26,0xaa);

#ifdef __cplusplus
class DECLSPEC_UUID("0d722f1a-9fcf-4e62-96d8-6df8f01a26aa") SpShortcut;
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(SpShortcut, 0x0d722f1a, 0x9fcf, 0x4e62, 0x96,0xd8, 0x6d,0xf8,0xf0,0x1a,0x26,0xaa)
#endif
#endif

/*****************************************************************************
 * SpPhoneConverter coclass
 */

DEFINE_GUID(CLSID_SpPhoneConverter, 0x9185f743, 0x1143, 0x4c28, 0x86,0xb5, 0xbf,0xf1,0x4f,0x20,0xe5,0xc8);

#ifdef __cplusplus
class DECLSPEC_UUID("9185f743-1143-4c28-86b5-bff14f20e5c8") SpPhoneConverter;
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(SpPhoneConverter, 0x9185f743, 0x1143, 0x4c28, 0x86,0xb5, 0xbf,0xf1,0x4f,0x20,0xe5,0xc8)
#endif
#endif

/*****************************************************************************
 * SpPhoneticAlphabetConverter coclass
 */

DEFINE_GUID(CLSID_SpPhoneticAlphabetConverter, 0x4f414126, 0xdfe3, 0x4629, 0x99,0xee, 0x79,0x79,0x78,0x31,0x7e,0xad);

#ifdef __cplusplus
class DECLSPEC_UUID("4f414126-dfe3-4629-99ee-797978317ead") SpPhoneticAlphabetConverter;
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(SpPhoneticAlphabetConverter, 0x4f414126, 0xdfe3, 0x4629, 0x99,0xee, 0x79,0x79,0x78,0x31,0x7e,0xad)
#endif
#endif

/*****************************************************************************
 * SpNullPhoneConverter coclass
 */

DEFINE_GUID(CLSID_SpNullPhoneConverter, 0x455f24e9, 0x7396, 0x4a16, 0x97,0x15, 0x7c,0x0f,0xdb,0xe3,0xef,0xe3);

#ifdef __cplusplus
class DECLSPEC_UUID("455f24e9-7396-4a16-9715-7c0fdbe3efe3") SpNullPhoneConverter;
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(SpNullPhoneConverter, 0x455f24e9, 0x7396, 0x4a16, 0x97,0x15, 0x7c,0x0f,0xdb,0xe3,0xef,0xe3)
#endif
#endif

/*****************************************************************************
 * SpTextSelectionInformation coclass
 */

DEFINE_GUID(CLSID_SpTextSelectionInformation, 0x0f92030a, 0xcbfd, 0x4ab8, 0xa1,0x64, 0xff,0x59,0x85,0x54,0x7f,0xf6);

#ifdef __cplusplus
class DECLSPEC_UUID("0f92030a-cbfd-4ab8-a164-ff5985547ff6") SpTextSelectionInformation;
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(SpTextSelectionInformation, 0x0f92030a, 0xcbfd, 0x4ab8, 0xa1,0x64, 0xff,0x59,0x85,0x54,0x7f,0xf6)
#endif
#endif

/*****************************************************************************
 * SpPhraseInfoBuilder coclass
 */

DEFINE_GUID(CLSID_SpPhraseInfoBuilder, 0xc23fc28d, 0xc55f, 0x4720, 0x8b,0x32, 0x91,0xf7,0x3c,0x2b,0xd5,0xd1);

#ifdef __cplusplus
class DECLSPEC_UUID("c23fc28d-c55f-4720-8b32-91f73c2bd5d1") SpPhraseInfoBuilder;
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(SpPhraseInfoBuilder, 0xc23fc28d, 0xc55f, 0x4720, 0x8b,0x32, 0x91,0xf7,0x3c,0x2b,0xd5,0xd1)
#endif
#endif

/*****************************************************************************
 * SpAudioFormat coclass
 */

DEFINE_GUID(CLSID_SpAudioFormat, 0x9ef96870, 0xe160, 0x4792, 0x82,0x0d, 0x48,0xcf,0x06,0x49,0xe4,0xec);

#ifdef __cplusplus
class DECLSPEC_UUID("9ef96870-e160-4792-820d-48cf0649e4ec") SpAudioFormat;
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(SpAudioFormat, 0x9ef96870, 0xe160, 0x4792, 0x82,0x0d, 0x48,0xcf,0x06,0x49,0xe4,0xec)
#endif
#endif

/*****************************************************************************
 * SpWaveFormatEx coclass
 */

DEFINE_GUID(CLSID_SpWaveFormatEx, 0xc79a574c, 0x63be, 0x44b9, 0x80,0x1f, 0x28,0x3f,0x87,0xf8,0x98,0xbe);

#ifdef __cplusplus
class DECLSPEC_UUID("c79a574c-63be-44b9-801f-283f87f898be") SpWaveFormatEx;
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(SpWaveFormatEx, 0xc79a574c, 0x63be, 0x44b9, 0x80,0x1f, 0x28,0x3f,0x87,0xf8,0x98,0xbe)
#endif
#endif

/*****************************************************************************
 * SpInProcRecoContext coclass
 */

DEFINE_GUID(CLSID_SpInProcRecoContext, 0x73ad6842, 0xace0, 0x45e8, 0xa4,0xdd, 0x87,0x95,0x88,0x1a,0x2c,0x2a);

#ifdef __cplusplus
class DECLSPEC_UUID("73ad6842-ace0-45e8-a4dd-8795881a2c2a") SpInProcRecoContext;
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(SpInProcRecoContext, 0x73ad6842, 0xace0, 0x45e8, 0xa4,0xdd, 0x87,0x95,0x88,0x1a,0x2c,0x2a)
#endif
#endif

/*****************************************************************************
 * SpCustomStream coclass
 */

DEFINE_GUID(CLSID_SpCustomStream, 0x8dbef13f, 0x1948, 0x4aa8, 0x8c,0xf0, 0x04,0x8e,0xeb,0xed,0x95,0xd8);

#ifdef __cplusplus
class DECLSPEC_UUID("8dbef13f-1948-4aa8-8cf0-048eebed95d8") SpCustomStream;
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(SpCustomStream, 0x8dbef13f, 0x1948, 0x4aa8, 0x8c,0xf0, 0x04,0x8e,0xeb,0xed,0x95,0xd8)
#endif
#endif

/*****************************************************************************
 * SpFileStream coclass
 */

DEFINE_GUID(CLSID_SpFileStream, 0x947812b3, 0x2ae1, 0x4644, 0xba,0x86, 0x9e,0x90,0xde,0xd7,0xec,0x91);

#ifdef __cplusplus
class DECLSPEC_UUID("947812b3-2ae1-4644-ba86-9e90ded7ec91") SpFileStream;
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(SpFileStream, 0x947812b3, 0x2ae1, 0x4644, 0xba,0x86, 0x9e,0x90,0xde,0xd7,0xec,0x91)
#endif
#endif

/*****************************************************************************
 * SpMemoryStream coclass
 */

DEFINE_GUID(CLSID_SpMemoryStream, 0x5fb7ef7d, 0xdff4, 0x468a, 0xb6,0xb7, 0x2f,0xcb,0xd1,0x88,0xf9,0x94);

#ifdef __cplusplus
class DECLSPEC_UUID("5fb7ef7d-dff4-468a-b6b7-2fcbd188f994") SpMemoryStream;
#ifdef __CRT_UUID_DECL
__CRT_UUID_DECL(SpMemoryStream, 0x5fb7ef7d, 0xdff4, 0x468a, 0xb6,0xb7, 0x2f,0xcb,0xd1,0x88,0xf9,0x94)
#endif
#endif

#ifndef __ISpXMLRecoResult_FWD_DEFINED__
#define __ISpXMLRecoResult_FWD_DEFINED__
typedef interface ISpXMLRecoResult ISpXMLRecoResult;
#ifdef __cplusplus
interface ISpXMLRecoResult;
#endif /* __cplusplus */
#endif

#ifndef __ISpRecoGrammar2_FWD_DEFINED__
#define __ISpRecoGrammar2_FWD_DEFINED__
typedef interface ISpRecoGrammar2 ISpRecoGrammar2;
#ifdef __cplusplus
interface ISpRecoGrammar2;
#endif /* __cplusplus */
#endif

#ifndef __ISpeechResourceLoader_FWD_DEFINED__
#define __ISpeechResourceLoader_FWD_DEFINED__
typedef interface ISpeechResourceLoader ISpeechResourceLoader;
#ifdef __cplusplus
interface ISpeechResourceLoader;
#endif /* __cplusplus */
#endif

#endif /* __SpeechLib_LIBRARY_DEFINED__ */
/* Begin additional prototypes for all interfaces */

ULONG           __RPC_USER HWND_UserSize     (ULONG *, ULONG, HWND *);
unsigned char * __RPC_USER HWND_UserMarshal  (ULONG *, unsigned char *, HWND *);
unsigned char * __RPC_USER HWND_UserUnmarshal(ULONG *, unsigned char *, HWND *);
void            __RPC_USER HWND_UserFree     (ULONG *, HWND *);
ULONG           __RPC_USER BSTR_UserSize     (ULONG *, ULONG, BSTR *);
unsigned char * __RPC_USER BSTR_UserMarshal  (ULONG *, unsigned char *, BSTR *);
unsigned char * __RPC_USER BSTR_UserUnmarshal(ULONG *, unsigned char *, BSTR *);
void            __RPC_USER BSTR_UserFree     (ULONG *, BSTR *);
ULONG           __RPC_USER VARIANT_UserSize     (ULONG *, ULONG, VARIANT *);
unsigned char * __RPC_USER VARIANT_UserMarshal  (ULONG *, unsigned char *, VARIANT *);
unsigned char * __RPC_USER VARIANT_UserUnmarshal(ULONG *, unsigned char *, VARIANT *);
void            __RPC_USER VARIANT_UserFree     (ULONG *, VARIANT *);

/* End additional prototypes */

#ifdef __cplusplus
}
#endif

#endif /* __sapi53_h__ */
