To compile a MOF file that defines WMI data and event blocks, use the MOF compiler, called Mofcomp, that is included with the Microsoft Windows operating systems. Use the following syntax:
mofcomp -WMI -B:filename.bmf filename.mof
The following items appear in the preceding syntax:
Validates all classes in filename.mof for use with WMI. If any class definition is invalid, Mofcomp deletes the output file filename.bmf. If -WMI is omitted, you should run Wmimofck on filename.bmf to validate the classes. A driver must either use the WMI switch or run Wmimofck to validate the MOF. Failure to do so can result in the MOF file not loading correctly into the WMI schema.
To learn more about how to use Mofcomp, open a Command Prompt window and type mofcomp /?.
For more information about Mofcomp, see MofComp and other topics in the Windows SDK.
To include the compiled MOF file as a resource in the driver's binary image, add the following line to the driver's resource script (RC) file:
MofResource MOFDATA filename.bmf
If the driver is using the WMI library routines to handle WMI IRPs, it specifies the MOF resource name in its DpWmiQueryReginfo routine.
If the driver is handling WMI IRPs directly, it specifies the MOF resource name in the WMIREGINFO structure that the driver passes to WMI.
For more information about handling IRP_MN_REGINFO and IRP_MN_REGINFO_EX requests, see Registering as a WMI Data Provider.
For more information about handling WMI IRPs using WMI iibrary routines, see Handling WMI Requests.
For more information about defining and including resources in executable files, see the Microsoft Windows SDK.