WindowsXP/admin/wmi/wbem/winmgmt/specs/html/interface_imofcompiler.htm
2025-04-27 07:49:33 -04:00

308 lines
27 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
<META NAME="Generator" CONTENT="Microsoft Word 97">
<TITLE>Interface IMofCompiler</TITLE>
</HEAD>
<BODY LINK="#0000ff" VLINK="#800080">
<P>&nbsp;</P>
<B><FONT FACE="Arial Narrow" SIZE=6><P>Interface IMofCompiler</FONT><FONT FACE="Arial Narrow" SIZE=1 COLOR="#800000">¦@¦</P>
</B></FONT><FONT SIZE=2 COLOR="#ff00ff"><P>&lt;span style=color:#FF0000&gt;</FONT><FONT FACE="Arial" SIZE=2 COLOR="#ff0000">[This is preliminary documentation and subject to change.]</FONT><FONT SIZE=2 COLOR="#ff00ff">&lt;/span&gt;</FONT><FONT FACE="Arial" SIZE=2> </P>
<P>The <B>IMofCompiler</B> interface is implemented by mofd.dll. It provides a COM interface which is used by the MOF Compiler and any other applications which need to compile MOF files. Objects can be obtained using the CLSID_MofCompiler CLSID.</P>
<P>&nbsp;</P>
<B><P>Methods in Vtable Order</P></B></FONT>
<TABLE CELLSPACING=0 BORDER=0 WIDTH=462>
<TR><TD WIDTH="57%" VALIGN="TOP">
<P><B><FONT FACE="Arial" SIZE=2>IUnknown Methods</B></FONT></TD>
<TD WIDTH="43%" VALIGN="TOP">
<B><FONT FACE="Arial" SIZE=2><P>Properties</B></FONT></TD>
</TR>
<TR><TD WIDTH="57%" VALIGN="TOP">
<B><U><FONT FACE="Arial" SIZE=2><P>QueryInterface</B></U></FONT><FONT FACE="Arial" SIZE=2 COLOR="#800000">_hmm_IMofCompiler_QueryInterface_b</FONT></TD>
<TD WIDTH="43%" VALIGN="TOP">
<FONT FACE="Arial" SIZE=2><P>Determines if the current object supports a given interface.</FONT></TD>
</TR>
<TR><TD WIDTH="57%" VALIGN="TOP">
<B><U><FONT FACE="Arial" SIZE=2><P>AddRef</B></U></FONT><FONT FACE="Arial" SIZE=2 COLOR="#800000">_hmm_IMofCompiler_AddRef</FONT></TD>
<TD WIDTH="43%" VALIGN="TOP">
<FONT FACE="Arial" SIZE=2><P>Increases the object's reference count by 1.</FONT></TD>
</TR>
<TR><TD WIDTH="57%" VALIGN="TOP">
<B><U><FONT FACE="Arial" SIZE=2><P>Release</B></U></FONT><FONT FACE="Arial" SIZE=2 COLOR="#800000">_hmm_IMofCompiler_Release</FONT></TD>
<TD WIDTH="43%" VALIGN="TOP">
<FONT FACE="Arial" SIZE=2><P>Decrements the object's reference count, and frees the object when the reference count is zero.</FONT></TD>
</TR>
</TABLE>
<P>&nbsp;</P>
<TABLE CELLSPACING=0 BORDER=0 WIDTH=462>
<TR><TD VALIGN="TOP" COLSPAN=2>
<P></TD>
</TR>
<TR><TD WIDTH="37%" VALIGN="TOP">
<B><FONT FACE="Arial" SIZE=2><P>IMofCompiler Methods</B></FONT></TD>
<TD WIDTH="63%" VALIGN="TOP">
<B><FONT FACE="Arial" SIZE=2><P>Properties</B></FONT></TD>
</TR>
<TR><TD WIDTH="37%" VALIGN="TOP">
<B><U><FONT FACE="Arial" SIZE=2><P>CompileFile</B></U></FONT><FONT FACE="Arial" SIZE=2 COLOR="#800000">_hmm_IMofCompiler_CompileFile</FONT></TD>
<TD WIDTH="63%" VALIGN="TOP">
<FONT FACE="Arial" SIZE=2><P>This method can be called to compile a particular MOF file.</FONT></TD>
</TR>
<TR><TD WIDTH="37%" VALIGN="TOP">
<B><U><FONT FACE="Arial" SIZE=2><P>CompileBuffer</B></U></FONT><FONT FACE="Arial" SIZE=2 COLOR="#800000">_hmm_IMofCompiler_CompileBuffer</FONT></TD>
<TD WIDTH="63%" VALIGN="TOP">
<FONT FACE="Arial" SIZE=2><P>Takes the information in a buffer and stores it into WINMGMT. The buffer must contain binary MOF data.</FONT></TD>
</TR>
<TR><TD WIDTH="37%" VALIGN="TOP">
<B><U><FONT FACE="Arial" SIZE=2><P>CreateBMOF</B></U></FONT><FONT FACE="Arial" SIZE=2 COLOR="#800000">_hmm_IMofCompiler_CreateBMOF</FONT></TD>
<TD WIDTH="63%" VALIGN="TOP">
<P>Reads a MOF file and outputs binary MOF data to another file.</TD>
</TR>
</TABLE>
<P>&nbsp;</P>
<FONT FACE="Arial" SIZE=1><P>&nbsp;</P>
</FONT><FONT FACE="Arial Narrow" SIZE=5 COLOR="#800000"><P>^</FONT><B><FONT FACE="Arial Narrow" SIZE=5># $ K + </B></FONT><FONT FACE="Arial Narrow" SIZE=5 COLOR="#800000"></FONT><B><FONT FACE="Arial Narrow" SIZE=5>IMofCompiler::QueryInterface</FONT><FONT FACE="Arial Narrow" SIZE=1 COLOR="#800000">¦@¦</P>
</B></FONT><FONT SIZE=2 COLOR="#ff00ff"><P>&lt;span style=color:#FF0000&gt;</FONT><FONT FACE="Arial" SIZE=2 COLOR="#ff0000">[This is preliminary documentation and subject to change.]</FONT><FONT SIZE=2 COLOR="#ff00ff">&lt;/span&gt;</FONT><FONT FACE="Arial" SIZE=2> </P>
<P>The <B>IMofCompiler::QueryInterface</B> method determines if the object supports a particular COM interface. If it does, the system increases the object's reference count, and the application can use that interface immediately.</P>
</FONT><B><FONT FACE="Lucida Sans Typewriter" SIZE=2><P>HRESULT IMofCompiler::QueryInterface(</P>
<P>[in] REFIID</B><I> riid</I><B>,</P>
<P>[out] LPVOID</B><I> *ppv</P>
</I><B><P>);</P>
</FONT><FONT FACE="Arial Narrow"><P>&nbsp;</P>
<P>Parameters</P>
</B></FONT><I><FONT FACE="Arial" SIZE=2><P>riid</P>
</I><BLOCKQUOTE>The COM interface identifier of the requested interface.</BLOCKQUOTE>
<P>&nbsp;</P>
<I><P>ppv</P>
</I><BLOCKQUOTE>Address of a pointer that will be filled with the interface pointer if the query succeeds.</BLOCKQUOTE>
</FONT><BLOCKQUOTE>&nbsp;</BLOCKQUOTE>
<P>&nbsp;</P>
<B><FONT FACE="Arial Narrow"><P>Return Values</P>
</B></FONT><FONT FACE="Arial" SIZE=2><P>Returns standard COM error codes for <B>QueryInterface</B>. It returns WBEM_S_NO_ERROR if the call succeeds. If the call fails because the requested interface was not supported, the method returns E_NOINTERFACE.</P>
</FONT><B><FONT FACE="Arial Narrow"><P>Remarks</P>
</B></FONT><FONT FACE="Arial" SIZE=2><P>When the application no longer needs the interface retrieved by a call to this method, it must call the <B>Release</B> method for that interface to free it. The <B>QueryInterface</B> method allows the extension of objects without interfering with each object's existing or future functionality.</P>
<P>This method is part of the <B>IUnknown</B> interface inherited by the object. For more information about this method, see the COM documentation in the Microsoft Platform SDK.</P>
</FONT><B><FONT FACE="Arial Narrow"><P>See Also</P>
</FONT><U><FONT FACE="Arial" SIZE=2><P>IUnknown Interface Basics</B></U></FONT><FONT FACE="Arial" SIZE=2 COLOR="#800000">_hmm_IUnknown_Interface_Basics</FONT><FONT FACE="Arial" SIZE=2> </P>
</FONT><FONT FACE="Arial Narrow" SIZE=5 COLOR="#800000"><P>^</FONT><B><FONT FACE="Arial Narrow" SIZE=5># $ K + </B></FONT><FONT FACE="Arial Narrow" SIZE=5 COLOR="#800000"></FONT><B><FONT FACE="Arial Narrow" SIZE=5>IMofCompiler::AddRef</FONT><FONT FACE="Arial Narrow" SIZE=1 COLOR="#800000">¦@¦</P>
</B></FONT><FONT SIZE=2 COLOR="#ff00ff"><P>&lt;span style=color:#FF0000&gt;</FONT><FONT FACE="Arial" SIZE=2 COLOR="#ff0000">[This is preliminary documentation and subject to change.]</FONT><FONT SIZE=2 COLOR="#ff00ff">&lt;/span&gt;</FONT><FONT FACE="Arial" SIZE=2> </P>
<P>The <B>IMofCompiler::AddRef</B> method increases the object's reference count by 1.</P>
</FONT><B><FONT FACE="Lucida Sans Typewriter" SIZE=2><P>ULONG AddRef( );</P>
</FONT><FONT FACE="Arial Narrow"><P>&nbsp;</P>
<P>Parameters</P>
</B></FONT><FONT FACE="Arial" SIZE=2><P>None.</P>
</FONT><B><FONT FACE="Arial Narrow"><P>Return Values</P>
</B></FONT><FONT FACE="Arial" SIZE=2><P>Returns the new reference count.</P>
</FONT><B><FONT FACE="Arial Narrow"><P>Remarks</P>
</B></FONT><FONT FACE="Arial" SIZE=2><P>When the object is created, its reference count is set to 1. Every time an application obtains an interface to the object or calls the <B>AddRef</B> method, the object's reference count is increased by 1. Use the <B><U>Release</B></U></FONT><FONT FACE="Arial" SIZE=2 COLOR="#800000">_hmm_IMofCompiler_Release</FONT><FONT FACE="Arial" SIZE=2> method to decrease the object's reference count by 1. </P>
<P>This method is part of the <B>IUnknown</B> interface inherited by the object. For a complete discussion of <B>IUnknown</B> methods, see <B>IUnknown Programming Basics</B>.</P>
<P>For more information about this method, see the COM documentation in the Microsoft Platform SDK.</P>
</FONT><B><FONT FACE="Arial Narrow"><P>See Also</P>
</FONT><U><FONT FACE="Arial" SIZE=2><P>IUnknown Interface Basics</B></U></FONT><FONT FACE="Arial" SIZE=2 COLOR="#800000">_hmm_IUnknown_Interface_Basics</FONT><FONT FACE="Arial" SIZE=2> </P>
</FONT><FONT FACE="Arial Narrow" SIZE=5 COLOR="#800000"><P>^</FONT><B><FONT FACE="Arial Narrow" SIZE=5># $ K + </B></FONT><FONT FACE="Arial Narrow" SIZE=5 COLOR="#800000"></FONT><B><FONT FACE="Arial Narrow" SIZE=5>IMofCompiler::Release</FONT><FONT FACE="Arial Narrow" SIZE=1 COLOR="#800000">¦@¦</P>
</B></FONT><FONT SIZE=2 COLOR="#ff00ff"><P>&lt;span style=color:#FF0000&gt;</FONT><FONT FACE="Arial" SIZE=2 COLOR="#ff0000">[This is preliminary documentation and subject to change.]</FONT><FONT SIZE=2 COLOR="#ff00ff">&lt;/span&gt;</FONT><FONT FACE="Arial" SIZE=2> </P>
<P>The <B>IMofCompiler::Release</B> method decreases the object's reference count by 1.</P>
</FONT><B><FONT FACE="Lucida Sans Typewriter" SIZE=2><P>ULONG IMofCompiler::Release( );</P>
</FONT><FONT FACE="Arial Narrow"><P>&nbsp;</P>
<P>Parameters</P>
</B></FONT><FONT FACE="Arial" SIZE=2><P>None.</P>
</FONT><B><FONT FACE="Arial Narrow"><P>Return Values</P>
</B></FONT><FONT FACE="Arial" SIZE=2><P>Returns the new reference count.</P>
</FONT><B><FONT FACE="Arial Narrow"><P>Remarks</P>
</B></FONT><FONT FACE="Arial" SIZE=2><P>The object deallocates itself when its reference count reaches zero. Use the <B><U>AddRef</B></U></FONT><FONT FACE="Arial" SIZE=2 COLOR="#800000">_hmm_IMofCompiler_AddRef</FONT><FONT FACE="Arial" SIZE=2> method to increase the object's reference count by 1.</P>
<P>This method is part of the <B>IUnknown</B> interface inherited by the object. For more information about this method, see the COM documentation in the Microsoft Platform SDK.</P>
</FONT><B><FONT FACE="Arial Narrow"><P>See Also</P>
</FONT><U><FONT FACE="Arial" SIZE=2><P>IUnknown Interface Basics</B></U></FONT><FONT FACE="Arial" SIZE=2 COLOR="#800000">_hmm_IUnknown_Interface_Basics</FONT><FONT FACE="Arial" SIZE=2> </P>
</FONT><FONT FACE="Arial Narrow" SIZE=5 COLOR="#800000"><P>^</FONT><B><FONT FACE="Arial Narrow" SIZE=5># $ K + </B></FONT><FONT FACE="Arial Narrow" SIZE=5 COLOR="#800000"></FONT><B><FONT FACE="Arial Narrow" SIZE=5>IMofCompiler::CompileFile</FONT><FONT FACE="Arial Narrow" SIZE=1 COLOR="#800000">¦@¦</P>
</B></FONT><FONT SIZE=2 COLOR="#ff00ff"><P>&lt;span style=color:#FF0000&gt;</FONT><FONT FACE="Arial" SIZE=2 COLOR="#ff0000">[This is preliminary documentation and subject to change.]</FONT><FONT SIZE=2 COLOR="#ff00ff">&lt;/span&gt;</FONT><FONT FACE="Arial" SIZE=2> </P>
<P>This method compiles a MOF file (including binary MOFs) and stores the information into WINMGMT.</P>
</FONT><B><FONT FACE="Lucida Sans Typewriter" SIZE=2><P>HRESULT IMofCompiler::CompileFile(</P><DIR>
<DIR>
<P>[in, string] LPWSTR </B><I>FileName,</P>
</I><B><P>[in, string] LPWSTR </B><I>ServerAndNamespace</I><B>,</P>
<P>[in, string] LPWSTR </B><I>User</I><B>,</P>
<P>[in, string] LPWSTR </B><I>Authority</I><B>,</P>
<P>[in, string] LPWSTR </B><I>Password</I><B>,</P>
<P>[in] LONG </B><I>lOptionFlags</I><B>,&#9;&#9;</P>
<P>[in] LONG </B><I>lClassFlags</I><B>,</P>
<P>[in] LONG </B><I>lInstanceFlags</I><B>,</P>
<P>[in, out] WBEM_COMPILE_STATUS_INFO * </B><I>pInfo</P></DIR>
</DIR>
</I></FONT><FONT FACE="Lucida Sans Typewriter"><H5>);</H5>
</FONT><B><FONT FACE="Arial Narrow"><P>&nbsp;</P>
<P>Parameters</P>
</B></FONT><I><FONT FACE="Lucida Sans Typewriter" SIZE=2><P>FileName</P>
</I></FONT><FONT FACE="Arial" SIZE=2><BLOCKQUOTE>Name of the file to be compiled.</BLOCKQUOTE>
</FONT><I><FONT FACE="Lucida Sans Typewriter" SIZE=2><P>ServerAndNamespace</P>
</I></FONT><FONT SIZE=2><BLOCKQUOTE>Path to the default namespace where any classes or instance are to be written. A namespace on remote machine can be specified. Ex; "\\computer\root". This value may be overriden by pragmas and should not be used if auto recovery is desired. If NULL, then the ROOT\DEFAULT namespace on the local machine is the default.</BLOCKQUOTE>
</FONT><I><FONT FACE="Lucida Sans Typewriter" SIZE=2><P>User</P>
</I></FONT><FONT SIZE=2><BLOCKQUOTE>Used to specify credentials for compiling on remote machines. If NULL, then the user context is whatever the calling process is using. This is always ignored when connecting to the local machine. See the remarks.</BLOCKQUOTE>
</FONT><I><FONT FACE="Lucida Sans Typewriter" SIZE=2><P>Authority</P>
</I></FONT><FONT SIZE=2><BLOCKQUOTE>Used to specify credentials for compiling on remote machines. If NULL, then the Authority context is whatever the calling process is using. This is always ignored when connecting to the local machine. See the remarks.</BLOCKQUOTE>
</FONT><I><FONT FACE="Lucida Sans Typewriter" SIZE=2><P>Password</P>
</I></FONT><FONT SIZE=2><BLOCKQUOTE>Used to specify credentials for compiling on remote machine. If NULL, the password of the current context is used. This is always ignored when connecting to the local machine.</BLOCKQUOTE>
</FONT><I><FONT FACE="Lucida Sans Typewriter" SIZE=2><P>lOptionFlags</I><B>&#9;</P>
</B></FONT><FONT SIZE=2><BLOCKQUOTE>One or more of the following flags may be combined:</BLOCKQUOTE>
<BLOCKQUOTE>WBEM_FLAG_CHECK_ONLY Performs a syntax check only</BLOCKQUOTE>
<BLOCKQUOTE>WBEM_FLAG_AUTORECOVER If successful, add the name of the file to the list of files to that are to be compiled during data base autorecovery. Note that this cannot be combined with either the namespace, class or instance flags.</BLOCKQUOTE>
<BLOCKQUOTE>WBEM_FLAG_CONSOLE_PRINT If set, various useful messages are output to the console. </BLOCKQUOTE>
<BLOCKQUOTE>WBEM_FLAG_DONT_ADD_TO_LIST If set, the file will not be added to the list of files to be compiled during auto recovery. This is not compatible with WBEM_FLAG_AUTORECOVER.</BLOCKQUOTE>
</FONT><I><FONT FACE="Lucida Sans Typewriter" SIZE=2><P>lClassFlags</P>
</I></FONT><FONT SIZE=2><BLOCKQUOTE>Flags controlling the creation of classes. May be 0 or a combination of:</BLOCKQUOTE>
<BLOCKQUOTE>WBEM_FLAG_UPDATE_ONLY Class creation is not allowed. May be combined with either WBEM_FLAG_UPDATE_SAFE_MODE or WBEM_FLAG_UPDATE_FORCE_MODE.</BLOCKQUOTE>
<BLOCKQUOTE>WBEM_FLAG_CREATE_ONLY Only class creation is allowed. May not be combined with the other flags.</BLOCKQUOTE>
<BLOCKQUOTE>WBEM_FLAG_UPDATE_SAFE_MODE Update unless conflicts exist. May be combined with WBEM_FLAG_UPDATE_ONLY.</BLOCKQUOTE>
<BLOCKQUOTE>WBEM_FLAG_UPDATE_FORCE_MODE Update and resolve conflicts where possible. May be combined with lInstanceFlags.</BLOCKQUOTE>
</FONT><I><FONT FACE="Lucida Sans Typewriter" SIZE=2><P>lInstanceFlags</I></FONT> </P>
<FONT SIZE=2><BLOCKQUOTE>Flags controlling the creation of instances. May be either 0 or one of the following:</BLOCKQUOTE>
<BLOCKQUOTE>WBEM_FLAG_UPDATE_ONLY Allow only updates.</BLOCKQUOTE>
<BLOCKQUOTE>WBEM_FLAG_CREATE_ONLY Allow only new instances.</BLOCKQUOTE>
</FONT><I><FONT FACE="Lucida Sans Typewriter" SIZE=2><P>pInfo</P>
</I></FONT><FONT SIZE=2><BLOCKQUOTE>If not NULL, then this is filled in with error information should an error occur. Note that the ObjectNum, FirstLine, and LastLine only contain values for errors that relate to a particular class of instance in the file.</BLOCKQUOTE>
<BLOCKQUOTE>struct</BLOCKQUOTE>
<BLOCKQUOTE>{</BLOCKQUOTE>
<BLOCKQUOTE>long lPhaseError;&#9;&#9;// 0 = no error, 1 = argument error, 2 = parsing, 3 error occurred while storing the data</BLOCKQUOTE>
<BLOCKQUOTE>HRESULT hRes;&#9;&#9;&#9;// Actual error code</BLOCKQUOTE>
<BLOCKQUOTE>long ObjectNum; // object which is at fault</BLOCKQUOTE>
<BLOCKQUOTE>long FirstLine; // first line number of the object</BLOCKQUOTE>
<BLOCKQUOTE>long LastLine; // last line number of the object</BLOCKQUOTE>
<BLOCKQUOTE>DWORD dwOutFlags; // reserved</BLOCKQUOTE>
<BLOCKQUOTE>} WBEM_COMPILE_STATUS_INFO;&nbsp;</BLOCKQUOTE>
<BLOCKQUOTE>&nbsp;</BLOCKQUOTE>
<BLOCKQUOTE>&nbsp;</BLOCKQUOTE>
</FONT><B><FONT FACE="Arial Narrow"><P>Return Values</P>
</B></FONT><FONT FACE="Arial" SIZE=2><P>WBEM_S_NO_ERROR. Success.</P>
<P>WBEM_S_FALSE. Failure.</P>
</FONT><B><FONT FACE="Arial Narrow"><P>Remarks</P>
</B></FONT><FONT FACE="Arial" SIZE=2><P>The User argument may be of the form "domain\user". If that is the case, then the authority field must be NULL.</P>
</FONT><B><FONT FACE="Arial Narrow"><P>See Also</P>
</B></FONT><FONT FACE="Arial Narrow" SIZE=5 COLOR="#800000"><P>^</FONT><B><FONT FACE="Arial Narrow" SIZE=5># $ K + </B></FONT><FONT FACE="Arial Narrow" SIZE=5 COLOR="#800000"></FONT><B><FONT FACE="Arial Narrow" SIZE=5>IMofCompiler::CompileBuffer</FONT><FONT FACE="Arial Narrow" SIZE=1 COLOR="#800000">¦@¦</P>
</B></FONT><FONT SIZE=2 COLOR="#ff00ff"><P>&lt;span style=color:#FF0000&gt;</FONT><FONT FACE="Arial" SIZE=2 COLOR="#ff0000">[This is preliminary documentation and subject to change.]</FONT><FONT SIZE=2 COLOR="#ff00ff">&lt;/span&gt;</FONT><FONT FACE="Arial" SIZE=2> </P>
<P>This method compiles a buffer containing binary MOF data. Binary MOFs contain parsed data and only needs to be stored in the database.</P>
</FONT><B><FONT FACE="Lucida Sans Typewriter" SIZE=2><P>HRESULT IMofCompiler::CompileBuffer(</P><DIR>
<DIR>
<P>[in] long </B><I>BuffSize</I><B>,</P>
<P>[in, size_is(BuffSize)]BYTE *</B><I> pBuffer</I><B>, </P>
<P>[in, string] LPWSTR </B><I>ServerAndNamespace</I><B>,</P>
<P>[in, string] LPWSTR </B><I>User</I><B>,</P>
<P>[in, string] LPWSTR </B><I>Authority</I><B>,</P>
<P>[in, string] LPWSTR </B><I>Password</I><B>,</P>
<P>[in] LONG </B><I>lOptionFlags</I><B>,&#9;</P>
<P>[in] LONG </B><I>lClassFlags</I><B>,</P>
<P>[in] LONG </B><I>lInstanceFlags</I><B>,&#9;</P>
<P>[in, out] WBEM_COMPILE_STATUS_INFO * </B><I>pInfo</P></DIR>
</DIR>
</I></FONT><FONT FACE="Lucida Sans Typewriter"><H5>);</H5>
</FONT><B><FONT FACE="Arial Narrow"><P>&nbsp;</P>
<P>Parameters</P>
</B></FONT><I><FONT FACE="Lucida Sans Typewriter" SIZE=2><P>BuffSize</P>
</I></FONT><FONT SIZE=2><BLOCKQUOTE>Size of the data pointed to by the pBuffer argument.</BLOCKQUOTE>
</FONT><I><FONT FACE="Lucida Sans Typewriter" SIZE=2><P>pBuffer</P>
</I></FONT><FONT FACE="Arial" SIZE=2><BLOCKQUOTE>A pointer to the binary MOF data.</BLOCKQUOTE>
</FONT><I><FONT FACE="Lucida Sans Typewriter" SIZE=2><P>ServerAndNamespace</I><B>,</P>
</B></FONT><FONT FACE="Arial" SIZE=2><BLOCKQUOTE>Ignored since the binary MOF contains the information already. Should be NULL.</BLOCKQUOTE>
</FONT><I><FONT FACE="Lucida Sans Typewriter" SIZE=2><P>User</P>
</I></FONT><FONT SIZE=2><BLOCKQUOTE>Used to specify credentials for compiling on remote machines. If NULL, then the user context is whatever the current process is using. This is always ignored when connecting to the local machine. See the remarks.</BLOCKQUOTE>
</FONT><I><FONT FACE="Lucida Sans Typewriter" SIZE=2><P>Authority</P>
</I></FONT><FONT SIZE=2><BLOCKQUOTE>Used to specify credentials for compiling on remote machines. If NULL, then the Authority context is whatever the current process is using. This is always ignored when connecting to the local machine. See the remarks.</BLOCKQUOTE>
</FONT><I><FONT FACE="Lucida Sans Typewriter" SIZE=2><P>Password</P>
</I></FONT><FONT SIZE=2><BLOCKQUOTE>Used to specify credentials for compiling on remote machine. If NULL, the password of the current context is used. This is always ignored when connecting to the local machine.</BLOCKQUOTE>
</FONT><I><FONT FACE="Lucida Sans Typewriter" SIZE=2><P>lOptionFlags</I><B>&#9;</P>
</B></FONT><FONT SIZE=2><BLOCKQUOTE>One or more of the following flags may be combined:</BLOCKQUOTE>
<BLOCKQUOTE>WBEM_FLAG_CHECK_ONLY Performs a syntax check only</BLOCKQUOTE>
<BLOCKQUOTE>WBEM_FLAG_AUTORECOVER If successful, add the name of the file to the list of files to are to be compiled during data base autorecover. Note that this cannot be combined with either the namespace, class or instance flags.</BLOCKQUOTE>
<BLOCKQUOTE>WBEM_FLAG_CONSOLE_PRINT If set, various useful messages are output to the console. </BLOCKQUOTE>
<BLOCKQUOTE>WBEM_FLAG_DONT_ADD_TO_LIST If set, the file will not be added to the list of files to be compiled during auto recovery. This is not compatible with WBEM_FLAG_AUTORECOVER.</BLOCKQUOTE>
</FONT><I><FONT FACE="Lucida Sans Typewriter" SIZE=2><P>lClassFlags</P>
</I></FONT><FONT FACE="Arial" SIZE=2><BLOCKQUOTE>Ignored since the binary MOF contains the information already. Should be 0.</BLOCKQUOTE>
</FONT><I><FONT FACE="Lucida Sans Typewriter" SIZE=2><P>lInstanceFlags</I><B>&#9;</P>
</B></FONT><FONT FACE="Arial" SIZE=2><BLOCKQUOTE>Ignored since the binary MOF contains the information already. Should be 0.</BLOCKQUOTE>
</FONT><I><FONT FACE="Lucida Sans Typewriter" SIZE=2><P>pInfo</P>
</I></FONT><FONT SIZE=2><BLOCKQUOTE>If not NULL, then this is filled in with error information should an error occur. Note that the ObjectNum, FirstLine, and LastLine only contain values for errors that relate to a particular class of instance in the file.</BLOCKQUOTE>
<BLOCKQUOTE>struct</BLOCKQUOTE>
<BLOCKQUOTE>{</BLOCKQUOTE>
<BLOCKQUOTE>long lPhaseError;&#9;&#9;// 0 = no error, 1 = argument error, 2 = parsing, 3 error occurred while storing the data</BLOCKQUOTE>
<BLOCKQUOTE>HRESULT hRes;&#9;&#9;&#9;// Actual error code</BLOCKQUOTE>
<BLOCKQUOTE>long ObjectNum; // object which is at fault</BLOCKQUOTE>
<BLOCKQUOTE>long FirstLine; // first line number of the object</BLOCKQUOTE>
<BLOCKQUOTE>long LastLine; // last line number of the object</BLOCKQUOTE>
<BLOCKQUOTE>DWORD dwOutFlags; // reserved</BLOCKQUOTE>
<BLOCKQUOTE>} WBEM_COMPILE_STATUS_INFO;&nbsp;</BLOCKQUOTE>
<BLOCKQUOTE>&nbsp;</BLOCKQUOTE>
<BLOCKQUOTE>&nbsp;</BLOCKQUOTE>
</FONT><B><FONT FACE="Arial Narrow"><P>Return Values</P>
</B></FONT><FONT FACE="Arial" SIZE=2><P>WBEM_S_NO_ERROR. Success.</P>
<P>WBEM_S_FALSE. Failure.</P>
</FONT><B><FONT FACE="Arial Narrow"><P>Remarks</P>
</B></FONT><FONT FACE="Arial" SIZE=2><P>The User argument may be of the form "domain\user". If that is the case, then the authority field must be NULL. Binary MOF data can be generated by CreateBMOF function. That function, stores the binary MOF data into a file, which may be read before calling this functions. </P>
</FONT><B><FONT FACE="Arial Narrow"><P>See Also</P>
</B></FONT><P>&nbsp;</P>
<FONT FACE="Arial Narrow" SIZE=5 COLOR="#800000"><P>^</FONT><B><FONT FACE="Arial Narrow" SIZE=5># $ K + </B></FONT><FONT FACE="Arial Narrow" SIZE=5 COLOR="#800000"></FONT><B><FONT FACE="Arial Narrow" SIZE=5>IMofCompiler::CreateBMOF</FONT><FONT FACE="Arial Narrow" SIZE=1 COLOR="#800000">¦@¦</P>
</B></FONT><FONT SIZE=2 COLOR="#ff00ff"><P>&lt;span style=color:#FF0000&gt;</FONT><FONT FACE="Arial" SIZE=2 COLOR="#ff0000">[This is preliminary documentation and subject to change.]</FONT><FONT SIZE=2 COLOR="#ff00ff">&lt;/span&gt;</FONT><FONT FACE="Arial" SIZE=2> </P>
<P>This creates a binary MOF file. This is done, by parsing a regular MOF file, and storing a binary representation of the classes and instances into a special file format. Typically, this data blob is stored as a resource in an executable file. That resource can latter be extracted for a call to CompileBuffer.</P>
<P>&nbsp;</P>
</FONT><B><FONT FACE="Lucida Sans Typewriter" SIZE=2><P>HRESULT IMofCompiler::CreateBMOF(</P><DIR>
<DIR>
<P>[in, string] LPWSTR </B><I>TextFileName</I><B>,</P>
<P>[in, string] LPWSTR </B><I>BMOFFileName</I><B>,</P>
<P>[in, string] LPWSTR </B><I>ServerAndNamespace</I><B>,</P>
<P>[in] LONG </B><I>lOptionFlags</I><B>,&#9;&#9;</P>
<P>[in] LONG </B><I>lClassFlags</I><B>,</P>
<P>[in] LONG </B><I>lInstanceFlags</I><B>,</P>
<P>[in, out] WBEM_COMPILE_STATUS_INFO * </B><I>pInfo</P></DIR>
</DIR>
</I></FONT><FONT FACE="Lucida Sans Typewriter"><H5>);</H5>
</FONT><B><FONT FACE="Arial Narrow"><P>&nbsp;</P>
<P>Parameters</P>
</B></FONT><I><FONT FACE="Lucida Sans Typewriter" SIZE=2><P>TextFileName</P>
</I></FONT><FONT SIZE=2><BLOCKQUOTE>Name of the text file, which is to be parsed.</BLOCKQUOTE>
</FONT><I><FONT FACE="Lucida Sans Typewriter" SIZE=2><P>BMOFFileName</P>
</I></FONT><FONT SIZE=2><BLOCKQUOTE>Name of the file where the resulting binary MOF data is to be stored.</BLOCKQUOTE>
</FONT><I><FONT FACE="Lucida Sans Typewriter" SIZE=2><P>ServerAndNamespace</P>
</I></FONT><FONT SIZE=2><BLOCKQUOTE>Path of the default namespace where any classes or instance are to be written. This can be used to specify a namespace on a remote machine. Ex; "\\computer\root". This value may be over riden by pragmas and should not be use if auto recovery is desired. If NULL, then the ROOT\DEFAULT namespace on the local machine is the default.</BLOCKQUOTE>
</FONT><I><FONT FACE="Lucida Sans Typewriter" SIZE=2><P>lOptionFlags</I><B>&#9;</P>
</B></FONT><FONT SIZE=2><BLOCKQUOTE>One or more of the following flags may be combined;</BLOCKQUOTE>
<BLOCKQUOTE>WBEM_FLAG_CHECK_ONLY Performs a syntax check only</BLOCKQUOTE>
<BLOCKQUOTE>WBEM_FLAG_CONSOLE_PRINT If set, various useful messages are output to the console. </BLOCKQUOTE>
<BLOCKQUOTE>WBEM_FLAG_WMI_CHECK If set, additional checks are done on the resulting binary MOF file using the WMIMOFCHK program which is part of the WMI SDK.</BLOCKQUOTE>
</FONT><I><FONT FACE="Lucida Sans Typewriter" SIZE=2><P>LClassFlags</P>
</I></FONT><FONT SIZE=2><BLOCKQUOTE>Flags controlling the creation of classes. May be 0 or a combination of:</BLOCKQUOTE>
<BLOCKQUOTE>WBEM_FLAG_UPDATE_ONLY Class creation is not allowed. May be combined with either WBEM_FLAG_UPDATE_SAFE_MODE or WBEM_FLAG_UPDATE_FORCE_MODE.</BLOCKQUOTE>
<BLOCKQUOTE>WBEM_FLAG_CREATE_ONLY Only class creation is allowed. May not be combined with the other flags.</BLOCKQUOTE>
<BLOCKQUOTE>WBEM_FLAG_UPDATE_SAFE_MODE Update unless conflicts exist. May be combined with WBEM_FLAG_UPDATE_ONLY.</BLOCKQUOTE>
<BLOCKQUOTE>WBEM_FLAG_UPDATE_FORCE_MODE Update and resolve conflicts where possible. May be combined with lInstanceFlags</BLOCKQUOTE>
<BLOCKQUOTE>lInstanceFlags</BLOCKQUOTE>
<BLOCKQUOTE>Flags controlling the creation of instances. May be either 0 or one of the following:</BLOCKQUOTE>
<BLOCKQUOTE>WBEM_FLAG_UPDATE_ONLY Allow only updates.</BLOCKQUOTE>
<BLOCKQUOTE>WBEM_FLAG_CREATE_ONLY Allow only new instances.</BLOCKQUOTE>
</FONT><I><FONT FACE="Lucida Sans Typewriter" SIZE=2><P>pInfo</P>
</I></FONT><FONT SIZE=2><BLOCKQUOTE>If not NULL, then this is filled in with error information should an error occur. Note that the ObjectNum, FirstLine, and LastLine only contain values for errors that relate to a particular class of instance in the file.</BLOCKQUOTE>
<BLOCKQUOTE>struct</BLOCKQUOTE>
<BLOCKQUOTE>{</BLOCKQUOTE>
<BLOCKQUOTE>long lPhaseError;&#9;&#9;// 0 = no error, 1 = argument error, 2 = parsing, 3 error occurred while store the data </BLOCKQUOTE>
<BLOCKQUOTE>HRESULT hRes;&#9;&#9;&#9;// Actual error code</BLOCKQUOTE>
<BLOCKQUOTE>long ObjectNum; // object which is at fault</BLOCKQUOTE>
<BLOCKQUOTE>long FirstLine; // first line number of the object</BLOCKQUOTE>
<BLOCKQUOTE>long LastLine; // last line number of the object</BLOCKQUOTE>
<BLOCKQUOTE>DWORD dwOutFlags; // reserved</BLOCKQUOTE>
<BLOCKQUOTE>} WBEM_COMPILE_STATUS_INFO;&nbsp;</BLOCKQUOTE>
<BLOCKQUOTE>&nbsp;</BLOCKQUOTE>
<BLOCKQUOTE>&nbsp;</BLOCKQUOTE>
</FONT><B><FONT FACE="Arial Narrow"><P>Return Values</P>
</B></FONT><FONT FACE="Arial" SIZE=2><P>WBEM_S_NO_ERROR. Success.</P>
<P>WBEM_S_FALSE. Failure.</P>
</FONT><B><FONT FACE="Arial Narrow"><P>Remarks</P>
<P>See Also</P>
</B></FONT><P>&nbsp;</P>
<P>&nbsp;</P></BODY>
</HTML>