Interface IWinmgmtMofCompiler¦@¦

<span style=color:#FF0000>[This is preliminary documentation and subject to change.]</span>

The IWinmgmtMofCompiler interface is implemented by mofd.dll. It provides a COM interface which is used by the providers and WINMGMT itself. Objects can be obtained using the CLSID_WinmgmtMofCompiler CLSID.

 

Methods in Vtable Order

IUnknown Methods

Properties

QueryInterface_hmm_IwinmgmtMofCompiler_QueryInterface_b

Determines if the current object supports a given interface.

AddRef_hmm_IwinmgmtMofCompiler_AddRef

Increases the object's reference count by 1.

Release_hmm_IwinmgmtMofCompiler_Release

Decrements the object's reference count, and frees the object when the reference count is zero.

 

IWinmgmtMofCompiler Methods

Properties

WinmgmtCompileFile_hmm_IWinmgmtMofCompiler_WinmgmtCompileFile

This is called to compile a particular MOF file.

WinmgmtCompileBuffer_hmm_IWinmgmtMofCompiler_WinmgmtCompileBuffer

Takes the information in a buffer and stores it into WINMGMT. The buffer must contain binary MOF data.

   

 

 

‹^# $ K + IWinmgmtMofCompiler::QueryInterface¦@¦

<span style=color:#FF0000>[This is preliminary documentation and subject to change.]</span>

The IWinmgmtMofCompiler::QueryInterface 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.

HRESULT IWinmgmtMofCompiler::QueryInterface(

[in] REFIID riid,

[out] LPVOID *ppv

);

 

Parameters

riid

The COM interface identifier of the requested interface.

 

ppv

Address of a pointer that will be filled with the interface pointer if the query succeeds.
 

 

Return Values

Returns standard COM error codes for QueryInterface. 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.

Remarks

When the application no longer needs the interface retrieved by a call to this method, it must call the Release method for that interface to free it. The QueryInterface method allows the extension of objects without interfering with each object's existing or future functionality.

This method is part of the IUnknown interface inherited by the object. For more information about this method, see the COM documentation in the Microsoft Platform SDK.

See Also

IUnknown Interface Basics_hmm_IUnknown_Interface_Basics

‹^# $ K + IWinmgmtMofCompiler::AddRef¦@¦

<span style=color:#FF0000>[This is preliminary documentation and subject to change.]</span>

The IWinmgmtMofCompiler::AddRef method increases the object's reference count by 1.

ULONG AddRef( );

 

Parameters

None.

Return Values

Returns the new reference count.

Remarks

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 AddRef method, the object's reference count is increased by 1. Use the Release_hmm_IWinmgmtMofCompiler_Release method to decrease the object's reference count by 1.

This method is part of the IUnknown interface inherited by the object. For a complete discussion of IUnknown methods, see IUnknown Programming Basics.

For more information about this method, see the COM documentation in the Microsoft Platform SDK.

See Also

IUnknown Interface Basics_hmm_IUnknown_Interface_Basics

‹^# $ K + IWinmgmtMofCompiler::Release¦@¦

<span style=color:#FF0000>[This is preliminary documentation and subject to change.]</span>

The IWinmgmtMofCompiler::Release method decreases the object's reference count by 1.

ULONG IWinmgmtMofCompiler::Release( );

 

Parameters

None.

Return Values

Returns the new reference count.

Remarks

The object deallocates itself when its reference count reaches zero. Use the AddRef_hmm_IWinmgmtMofCompiler_AddRef method to increase the object's reference count by 1.

This method is part of the IUnknown interface inherited by the object. For more information about this method, see the COM documentation in the Microsoft Platform SDK.

See Also

IUnknown Interface Basics_hmm_IUnknown_Interface_Basics

‹^# $ K + IWinmgmtMofCompiler::WinmgmtCompileFile¦@¦

<span style=color:#FF0000>[This is preliminary documentation and subject to change.]</span>

This is compiles a MOF file and possibly stores the information into WINMGMT.

HRESULT IWinmgmtMofCompiler::WinmgmtCompileFile(

[in, string] LPWSTR FileName,

[in, string] LPWSTR ServerAndNamespace,

[in] LONG lOptionFlags,

[in] LONG lClassFlags,

[in] LONG lInstanceFlags,

[in] IWbemServices * pOverride,

[in] IWbemContext * pCtx,

[in, out] WBEM_COMPILE_STATUS_INFO * pInfo

);

 

Parameters

FileName

Name of the file to be compiled.

ServerAndNamespace

Path to 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 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.

lOptionFlags

One or more of the following flags may be combined;
WBEM_FLAG_CHECK_ONLY – Performs a syntax check only
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 autorecover. Note that this cannot be combined with either the namespace, class or instance flags.
WBEM_FLAG_CONSOLE_PRINT – If set, various useful messages are output to the console.
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.

lClassFlags

Flags controlling the creation of classes. May be either 0 or a combination of:
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.
WBEM_FLAG_CREATE_ONLY – Only class creation is allowed. May not be combined with the other flags.
WBEM_FLAG_UPDATE_SAFE_MODE – Update unless conflicts exist. May be combined with WBEM_FLAG_UPDATE_ONLY.
WBEM_FLAG_UPDATE_FORCE_MODE – Update and resolve conflicts where possible. May be combined with lInstanceFlags

lInstanceFlags

Flags controlling the creation of instances. May be either 0 or one of the following:
WBEM_FLAG_UPDATE_ONLY – Allow only updates.
WBEM_FLAG_CREATE_ONLY – Allow only new instances.

pOverride

IWbemServices pointer to the namespace where the data is to be stored.
pCtx
IWbemContext pointer. This is important when being called by a provider since the provider is basically loops back into WINMGMT.

pInfo

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.
struct
{
long lPhaseError; // 0 = no error, 1 = argument error, 2 = parsing, 3 error occurred while storing the data
HRESULT hRes; // Actual error code
long ObjectNum; // object which is at fault
long FirstLine; // first line number of the object
long LastLine; // last line number of the object
DWORD dwOutFlags; // reserved
} WBEM_COMPILE_STATUS_INFO; 
 
 

Return Values

WBEM_S_NO_ERROR. Success.

WBEM_S_FALSE. Failure.

Remarks

The User argument may be of the form "domain\user". If that is the case, then the authority field must be NULL.

See Also

‹^# $ K + IWinmgmtMofCompiler::WinmgmtCompileBuffer¦@¦

<span style=color:#FF0000>[This is preliminary documentation and subject to change.]</span>

This method compiles a buffer containing binary MOF data. Binary MOF data has already been parsed and so this call just stores the instances and classes into the data base.

HRESULT IWinmgmtMofCompiler::WinmgmtCompileBuffer(

[in] long BuffSize,

[in, size_is(BuffSize)]BYTE * pBuffer,

[in, string] LPWSTR ServerAndNamespace,

[in, string] LPWSTR User,

[in, string] LPWSTR Authority,

[in, string] LPWSTR Password,

[in] LONG lOptionFlags,

[in] LONG lClassFlags,

[in] LONG lInstanceFlags,

[in] IWbemServices * pOverride,

[in] IWbemContext * pCtx,

[in, out] WBEM_COMPILE_STATUS_INFO * pInfo

);

 

Parameters

BuffSize

Size of the data pointed to by the pBuffer argument.

pBuffer

A pointer to the binary MOF data.

ServerAndNamespace,

Ignored since the binary MOF contains the information already. Should be NULL.

User

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.

Authority

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.

Password

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.

lOptionFlags

One or more of the following flags may be combined;
WBEM_FLAG_CHECK_ONLY – Performs syntax check only
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 specify either the namespace, class or instance flags.
WBEM_FLAG_CONSOLE_PRINT – If set, various useful messages are output to the console.
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 compatibule with WBEM_FLAG_AUTORECOVER.

lClassFlags

Mainly Ignored since the binary MOF contains the information already. If this function is being called from a provider, this value must be set to WBEM_FLAG_OWNER_UPDATE.

lInstanceFlags

Ignored since the binary MOF contains the information already. Should be 0.

pOverride

IWbemServices pointer to the namespace where the data is to be stored.
pCtx
IWbemContext pointer. This is important when being called by a provider since the provider is basically loops back into WINMGMT.

pInfo

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.
struct
{
long lPhaseError; // 0 = no error, 1 = argument error, 2 = parsing, 3 error occurred while storing the data
HRESULT hRes; // Actual error code
long ObjectNum; // object which is at fault
long FirstLine; // first line number of the object
long LastLine; // last line number of the object
DWORD dwOutFlags; // reserved
} WBEM_COMPILE_STATUS_INFO; 
 
 

Return Values

WBEM_S_NO_ERROR. Success.

WBEM_S_FALSE. Failure.

Remarks

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.

See Also