HostingModel attribute for Windows 2000 and WindowsXP

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Will Wright (will4wright_at_yahoo.com)
Date: 03/30/04


Date: 30 Mar 2004 14:36:08 -0800

I have written a WMI Instance provider and installed it successfully
on Windows 2000. However, when I try to compile the same MOF file on
Windows XP the registration fails due to my not setting the
HostingModel attribute.

Now, I can easily change the MOF to include this HostingModel
attribute, however if I do that then the same MOF file will not
compile on Windows 2000, i.e. I get the following output:

>mofcomp DelProv.mof
Microsoft (R) 32-bit MOF Compiler Version 1.50.1085.0007
Copyright (c) Microsoft Corp. 1997-1999. All rights reserved.

Parsing MOF file: DelProv.mof
MOF file has been successfully parsed
Storing data in the repository...
An error occurred while creating object 5 defined on lines 35 - 40:
0X80041002 Class, instance, or property 'HostingModel' was not found.
Compiler returned error 0x80041001

So, does anyone know if there is a MofComp.exe preprocessor directive
that I could use to exclude the line 'HostingModel =
"NetworkServiceHost"; ' from a compilation on a Windows 2000 machine?

I know that I could ship two different MOF files with my installation,
but I was trying to avoid that.

All help greatly appreciated.
Thanks,
Will



Relevant Pages

  • Error Number: 0x8004100e, Facility: WMI, Description: Invalid namespace
    ... - Unable to compile file SmsClient.mof ... Stopped the WinMgmt service, ... Parsing MOF file: SmsClient.mof ... mofcomp cimwin32.mof ...
    (microsoft.public.sms.setup)
  • Re: Trouble with MOF file: Unparsable Query
    ... > I am trying to write a MOF file that will fireoff an event to the ... > SMTPEventConsumer when a specific even id shows up in a specific event ... Everytime I compile the file I get an UNPARSABLE ... > I've been using WMI for awhile now and just learned that with MOF ...
    (microsoft.public.win32.programmer.wmi)
  • Re: Trouble with MOF file: Unparsable Query
    ... > I believe you're missing some spaces at the end of every line. ... >> I am trying to write a MOF file that will fireoff an event to the ... >> I've been using WMI for awhile now and just learned that with MOF ... >> compile. ...
    (microsoft.public.win32.programmer.wmi)
  • Re: Trouble with MOF file: Unparsable Query
    ... > I believe you're missing some spaces at the end of every line. ... >> I am trying to write a MOF file that will fireoff an event to the ... >> I've been using WMI for awhile now and just learned that with MOF ... >> compile. ...
    (microsoft.public.win32.programmer.wmi)
  • XP SP2 MOF Failure
    ... I get "MOFCOMP error code:6c. ... Below is the MOF file taken. ... // Windows XP with atleast 1500 MB of free disk space. ... Name = "Clients ready for Windows XP SP2 Upgrade"; ...
    (microsoft.public.sms.setup)