Advertisement
Guest User

xgem

a guest
Dec 5th, 2018
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 204.41 KB | None | 0 0
  1. unit xGem;
  2.  
  3. {$WARN UNSAFE_TYPE off}
  4. {$WARN UNSAFE_CAST off}
  5. {$WARN UNSAFE_CODE off}
  6. {$WARN SYMBOL_PLATFORM OFF}
  7. {$WARN SYMBOL_LIBRARY OFF}
  8. {$WARN SYMBOL_DEPRECATED OFF}
  9.  
  10. // ************************************************************************ //
  11. // WARNING
  12. // -------
  13. // The types declared in this file were generated from data read from a
  14. // Type Library. If this type library is explicitly or indirectly (via
  15. // another type library referring to this type library) re-imported, or the
  16. // 'Refresh' command of the Type Library Editor activated while editing the
  17. // Type Library, the contents of this file will be regenerated and all
  18. // manual modifications will be lost.
  19. // ************************************************************************ //
  20.  
  21. // PASTLWTR : $Revision:   1.130.1.0.1.0.1.6  $
  22. // File generated on 09/07/2003 16:17:52 from Type Library described below.
  23.  
  24. // ************************************************************************  //
  25. // Type Lib: D:\WINDOWS\System32\wbem\wbemdisp.TLB (1)
  26. // LIBID: {565783C6-CB41-11D1-8B02-00600806D9B6}
  27. // LCID: 0
  28. // Helpfile:
  29. // DepndLst:
  30. //   (1) v2.0 stdole, (D:\WINDOWS\System32\stdole2.tlb)
  31. //   (2) v4.0 StdVCL, (D:\WINDOWS\System32\STDVCL40.DLL)
  32. // Errors:
  33. //   Hint: Member 'Class' of 'ISWbemObjectPath' changed to 'Class_'
  34. //   Hint: Member 'Object' of 'ISWbemRefreshableItem' changed to 'Object_'
  35. //   Error creating palette bitmap of (TSWbemLocator) : Server D:\WINDOWS\System32\wbem\wbemdisp.dll contains no icons
  36. //   Error creating palette bitmap of (TSWbemNamedValueSet) : Server D:\WINDOWS\System32\wbem\wbemdisp.dll contains no icons
  37. //   Error creating palette bitmap of (TSWbemObjectPath) : Server D:\WINDOWS\System32\wbem\wbemdisp.dll contains no icons
  38. //   Error creating palette bitmap of (TSWbemLastError) : Server D:\WINDOWS\System32\wbem\wbemdisp.dll contains no icons
  39. //   Error creating palette bitmap of (TSWbemSink) : Server D:\WINDOWS\System32\wbem\wbemdisp.dll contains no icons
  40. //   Error creating palette bitmap of (TSWbemDateTime) : Server D:\WINDOWS\System32\wbem\wbemdisp.dll contains no icons
  41. //   Error creating palette bitmap of (TSWbemRefresher) : Server D:\WINDOWS\System32\wbem\wbemdisp.dll contains no icons
  42. // ************************************************************************ //
  43. // *************************************************************************//
  44. // NOTE:
  45. // Items guarded by $IFDEF_LIVE_SERVER_AT_DESIGN_TIME are used by properties
  46. // which return objects that may need to be explicitly created via a function
  47. // call prior to any access via the property. These items have been disabled
  48. // in order to prevent accidental use from within the object inspector. You
  49. // may enable them by defining LIVE_SERVER_AT_DESIGN_TIME or by selectively
  50. // removing them from the $IFDEF blocks. However, such items must still be
  51. // programmatically created via a method of the appropriate CoClass before
  52. // they can be used.
  53. {$TYPEDADDRESS OFF} // Unit must be compiled without type-checked pointers.
  54. {$WARN SYMBOL_PLATFORM OFF}
  55. {$WRITEABLECONST ON}
  56. {$VARPROPSETTER ON}
  57.  
  58. interface
  59.  
  60. uses SysUtils, Windows, Messages, ActiveX, Classes, Graphics, OleServer, StdVCL,
  61.      Variants;
  62.  
  63. type
  64.   T2DimStrArray = array of array of string;
  65.  
  66. function MagWmiGetBaseBoard: AnsiString;
  67.  
  68. const
  69.   RootNameSpace = 'root\CIMV2' ;
  70.  
  71. // *********************************************************************//
  72. // GUIDS declared in the TypeLibrary. Following prefixes are used:
  73. //   Type Libraries     : LIBID_xxxx
  74. //   CoClasses          : CLASS_xxxx
  75. //   DISPInterfaces     : DIID_xxxx
  76. //   Non-DISP interfaces: IID_xxxx
  77. // *********************************************************************//
  78. const
  79.   // TypeLibrary Major and minor versions
  80.   WbemScriptingMajorVersion = 1;
  81.   WbemScriptingMinorVersion = 2;
  82.  
  83.   LIBID_WbemScripting: TGUID = '{565783C6-CB41-11D1-8B02-00600806D9B6}';
  84.  
  85.   IID_ISWbemServices: TGUID = '{76A6415C-CB41-11D1-8B02-00600806D9B6}';
  86.   IID_ISWbemObject: TGUID = '{76A6415A-CB41-11D1-8B02-00600806D9B6}';
  87.   IID_ISWbemObjectPath: TGUID = '{5791BC27-CE9C-11D1-97BF-0000F81E849C}';
  88.   IID_ISWbemNamedValueSet: TGUID = '{CF2376EA-CE8C-11D1-8B05-00600806D9B6}';
  89.   IID_ISWbemNamedValue: TGUID = '{76A64164-CB41-11D1-8B02-00600806D9B6}';
  90.   IID_ISWbemSecurity: TGUID = '{B54D66E6-2287-11D2-8B33-00600806D9B6}';
  91.   IID_ISWbemPrivilegeSet: TGUID = '{26EE67BF-5804-11D2-8B4A-00600806D9B6}';
  92.   IID_ISWbemPrivilege: TGUID = '{26EE67BD-5804-11D2-8B4A-00600806D9B6}';
  93.   IID_ISWbemObjectSet: TGUID = '{76A6415F-CB41-11D1-8B02-00600806D9B6}';
  94.   IID_ISWbemQualifierSet: TGUID = '{9B16ED16-D3DF-11D1-8B08-00600806D9B6}';
  95.   IID_ISWbemQualifier: TGUID = '{79B05932-D3B7-11D1-8B06-00600806D9B6}';
  96.   IID_ISWbemPropertySet: TGUID = '{DEA0A7B2-D4BA-11D1-8B09-00600806D9B6}';
  97.   IID_ISWbemProperty: TGUID = '{1A388F98-D4BA-11D1-8B09-00600806D9B6}';
  98.   IID_ISWbemMethodSet: TGUID = '{C93BA292-D955-11D1-8B09-00600806D9B6}';
  99.   IID_ISWbemMethod: TGUID = '{422E8E90-D955-11D1-8B09-00600806D9B6}';
  100.   IID_ISWbemEventSource: TGUID = '{27D54D92-0EBE-11D2-8B22-00600806D9B6}';
  101.   IID_ISWbemLocator: TGUID = '{76A6415B-CB41-11D1-8B02-00600806D9B6}';
  102.   IID_ISWbemLastError: TGUID = '{D962DB84-D4BB-11D1-8B09-00600806D9B6}';
  103.   DIID_ISWbemSinkEvents: TGUID = '{75718CA0-F029-11D1-A1AC-00C04FB6C223}';
  104.   IID_ISWbemSink: TGUID = '{75718C9F-F029-11D1-A1AC-00C04FB6C223}';
  105.   IID_ISWbemServicesEx: TGUID = '{D2F68443-85DC-427E-91D8-366554CC754C}';
  106.   IID_ISWbemObjectEx: TGUID = '{269AD56A-8A67-4129-BC8C-0506DCFE9880}';
  107.   IID_ISWbemDateTime: TGUID = '{5E97458A-CF77-11D3-B38F-00105A1F473A}';
  108.   IID_ISWbemRefresher: TGUID = '{14D8250E-D9C2-11D3-B38F-00105A1F473A}';
  109.   IID_ISWbemRefreshableItem: TGUID = '{5AD4BF92-DAAB-11D3-B38F-00105A1F473A}';
  110.   CLASS_SWbemLocator: TGUID = '{76A64158-CB41-11D1-8B02-00600806D9B6}';
  111.   CLASS_SWbemNamedValueSet: TGUID = '{9AED384E-CE8B-11D1-8B05-00600806D9B6}';
  112.   CLASS_SWbemObjectPath: TGUID = '{5791BC26-CE9C-11D1-97BF-0000F81E849C}';
  113.   CLASS_SWbemLastError: TGUID = '{C2FEEEAC-CFCD-11D1-8B05-00600806D9B6}';
  114.   CLASS_SWbemSink: TGUID = '{75718C9A-F029-11D1-A1AC-00C04FB6C223}';
  115.   CLASS_SWbemDateTime: TGUID = '{47DFBE54-CF76-11D3-B38F-00105A1F473A}';
  116.   CLASS_SWbemRefresher: TGUID = '{D269BF5C-D9C1-11D3-B38F-00105A1F473A}';
  117.   CLASS_SWbemServices: TGUID = '{04B83D63-21AE-11D2-8B33-00600806D9B6}';
  118.   CLASS_SWbemServicesEx: TGUID = '{62E522DC-8CF3-40A8-8B2E-37D595651E40}';
  119.   CLASS_SWbemObject: TGUID = '{04B83D62-21AE-11D2-8B33-00600806D9B6}';
  120.   CLASS_SWbemObjectEx: TGUID = '{D6BDAFB2-9435-491F-BB87-6AA0F0BC31A2}';
  121.   CLASS_SWbemObjectSet: TGUID = '{04B83D61-21AE-11D2-8B33-00600806D9B6}';
  122.   CLASS_SWbemNamedValue: TGUID = '{04B83D60-21AE-11D2-8B33-00600806D9B6}';
  123.   CLASS_SWbemQualifier: TGUID = '{04B83D5F-21AE-11D2-8B33-00600806D9B6}';
  124.   CLASS_SWbemQualifierSet: TGUID = '{04B83D5E-21AE-11D2-8B33-00600806D9B6}';
  125.   CLASS_SWbemProperty: TGUID = '{04B83D5D-21AE-11D2-8B33-00600806D9B6}';
  126.   CLASS_SWbemPropertySet: TGUID = '{04B83D5C-21AE-11D2-8B33-00600806D9B6}';
  127.   CLASS_SWbemMethod: TGUID = '{04B83D5B-21AE-11D2-8B33-00600806D9B6}';
  128.   CLASS_SWbemMethodSet: TGUID = '{04B83D5A-21AE-11D2-8B33-00600806D9B6}';
  129.   CLASS_SWbemEventSource: TGUID = '{04B83D58-21AE-11D2-8B33-00600806D9B6}';
  130.   CLASS_SWbemSecurity: TGUID = '{B54D66E9-2287-11D2-8B33-00600806D9B6}';
  131.   CLASS_SWbemPrivilege: TGUID = '{26EE67BC-5804-11D2-8B4A-00600806D9B6}';
  132.   CLASS_SWbemPrivilegeSet: TGUID = '{26EE67BE-5804-11D2-8B4A-00600806D9B6}';
  133.   CLASS_SWbemRefreshableItem: TGUID = '{8C6854BC-DE4B-11D3-B390-00105A1F473A}';
  134.  
  135. // *********************************************************************//
  136. // Declaration of Enumerations defined in Type Library
  137. // *********************************************************************//
  138. // Constants for enum WbemImpersonationLevelEnum
  139. type
  140.   WbemImpersonationLevelEnum = TOleEnum;
  141. const
  142.   wbemImpersonationLevelAnonymous = $00000001;
  143.   wbemImpersonationLevelIdentify = $00000002;
  144.   wbemImpersonationLevelImpersonate = $00000003;
  145.   wbemImpersonationLevelDelegate = $00000004;
  146.  
  147. // Constants for enum WbemAuthenticationLevelEnum
  148. type
  149.   WbemAuthenticationLevelEnum = TOleEnum;
  150. const
  151.   wbemAuthenticationLevelDefault = $00000000;
  152.   wbemAuthenticationLevelNone = $00000001;
  153.   wbemAuthenticationLevelConnect = $00000002;
  154.   wbemAuthenticationLevelCall = $00000003;
  155.   wbemAuthenticationLevelPkt = $00000004;
  156.   wbemAuthenticationLevelPktIntegrity = $00000005;
  157.   wbemAuthenticationLevelPktPrivacy = $00000006;
  158.  
  159. // Constants for enum WbemPrivilegeEnum
  160. type
  161.   WbemPrivilegeEnum = TOleEnum;
  162. const
  163.   wbemPrivilegeCreateToken = $00000001;
  164.   wbemPrivilegePrimaryToken = $00000002;
  165.   wbemPrivilegeLockMemory = $00000003;
  166.   wbemPrivilegeIncreaseQuota = $00000004;
  167.   wbemPrivilegeMachineAccount = $00000005;
  168.   wbemPrivilegeTcb = $00000006;
  169.   wbemPrivilegeSecurity = $00000007;
  170.   wbemPrivilegeTakeOwnership = $00000008;
  171.   wbemPrivilegeLoadDriver = $00000009;
  172.   wbemPrivilegeSystemProfile = $0000000A;
  173.   wbemPrivilegeSystemtime = $0000000B;
  174.   wbemPrivilegeProfileSingleProcess = $0000000C;
  175.   wbemPrivilegeIncreaseBasePriority = $0000000D;
  176.   wbemPrivilegeCreatePagefile = $0000000E;
  177.   wbemPrivilegeCreatePermanent = $0000000F;
  178.   wbemPrivilegeBackup = $00000010;
  179.   wbemPrivilegeRestore = $00000011;
  180.   wbemPrivilegeShutdown = $00000012;
  181.   wbemPrivilegeDebug = $00000013;
  182.   wbemPrivilegeAudit = $00000014;
  183.   wbemPrivilegeSystemEnvironment = $00000015;
  184.   wbemPrivilegeChangeNotify = $00000016;
  185.   wbemPrivilegeRemoteShutdown = $00000017;
  186.   wbemPrivilegeUndock = $00000018;
  187.   wbemPrivilegeSyncAgent = $00000019;
  188.   wbemPrivilegeEnableDelegation = $0000001A;
  189.   wbemPrivilegeManageVolume = $0000001B;
  190.  
  191. // Constants for enum WbemCimtypeEnum
  192. type
  193.   WbemCimtypeEnum = TOleEnum;
  194. const
  195.   wbemCimtypeSint8 = $00000010;
  196.   wbemCimtypeUint8 = $00000011;
  197.   wbemCimtypeSint16 = $00000002;
  198.   wbemCimtypeUint16 = $00000012;
  199.   wbemCimtypeSint32 = $00000003;
  200.   wbemCimtypeUint32 = $00000013;
  201.   wbemCimtypeSint64 = $00000014;
  202.   wbemCimtypeUint64 = $00000015;
  203.   wbemCimtypeReal32 = $00000004;
  204.   wbemCimtypeReal64 = $00000005;
  205.   wbemCimtypeBoolean = $0000000B;
  206.   wbemCimtypeString = $00000008;
  207.   wbemCimtypeDatetime = $00000065;
  208.   wbemCimtypeReference = $00000066;
  209.   wbemCimtypeChar16 = $00000067;
  210.   wbemCimtypeObject = $0000000D;
  211.  
  212. // Constants for enum WbemErrorEnum
  213. type
  214.   WbemErrorEnum = TOleEnum;
  215. const
  216.   wbemNoErr = $00000000;
  217.   wbemErrFailed = $80041001;
  218.   wbemErrNotFound = $80041002;
  219.   wbemErrAccessDenied = $80041003;
  220.   wbemErrProviderFailure = $80041004;
  221.   wbemErrTypeMismatch = $80041005;
  222.   wbemErrOutOfMemory = $80041006;
  223.   wbemErrInvalidContext = $80041007;
  224.   wbemErrInvalidParameter = $80041008;
  225.   wbemErrNotAvailable = $80041009;
  226.   wbemErrCriticalError = $8004100A;
  227.   wbemErrInvalidStream = $8004100B;
  228.   wbemErrNotSupported = $8004100C;
  229.   wbemErrInvalidSuperclass = $8004100D;
  230.   wbemErrInvalidNamespace = $8004100E;
  231.   wbemErrInvalidObject = $8004100F;
  232.   wbemErrInvalidClass = $80041010;
  233.   wbemErrProviderNotFound = $80041011;
  234.   wbemErrInvalidProviderRegistration = $80041012;
  235.   wbemErrProviderLoadFailure = $80041013;
  236.   wbemErrInitializationFailure = $80041014;
  237.   wbemErrTransportFailure = $80041015;
  238.   wbemErrInvalidOperation = $80041016;
  239.   wbemErrInvalidQuery = $80041017;
  240.   wbemErrInvalidQueryType = $80041018;
  241.   wbemErrAlreadyExists = $80041019;
  242.   wbemErrOverrideNotAllowed = $8004101A;
  243.   wbemErrPropagatedQualifier = $8004101B;
  244.   wbemErrPropagatedProperty = $8004101C;
  245.   wbemErrUnexpected = $8004101D;
  246.   wbemErrIllegalOperation = $8004101E;
  247.   wbemErrCannotBeKey = $8004101F;
  248.   wbemErrIncompleteClass = $80041020;
  249.   wbemErrInvalidSyntax = $80041021;
  250.   wbemErrNondecoratedObject = $80041022;
  251.   wbemErrReadOnly = $80041023;
  252.   wbemErrProviderNotCapable = $80041024;
  253.   wbemErrClassHasChildren = $80041025;
  254.   wbemErrClassHasInstances = $80041026;
  255.   wbemErrQueryNotImplemented = $80041027;
  256.   wbemErrIllegalNull = $80041028;
  257.   wbemErrInvalidQualifierType = $80041029;
  258.   wbemErrInvalidPropertyType = $8004102A;
  259.   wbemErrValueOutOfRange = $8004102B;
  260.   wbemErrCannotBeSingleton = $8004102C;
  261.   wbemErrInvalidCimType = $8004102D;
  262.   wbemErrInvalidMethod = $8004102E;
  263.   wbemErrInvalidMethodParameters = $8004102F;
  264.   wbemErrSystemProperty = $80041030;
  265.   wbemErrInvalidProperty = $80041031;
  266.   wbemErrCallCancelled = $80041032;
  267.   wbemErrShuttingDown = $80041033;
  268.   wbemErrPropagatedMethod = $80041034;
  269.   wbemErrUnsupportedParameter = $80041035;
  270.   wbemErrMissingParameter = $80041036;
  271.   wbemErrInvalidParameterId = $80041037;
  272.   wbemErrNonConsecutiveParameterIds = $80041038;
  273.   wbemErrParameterIdOnRetval = $80041039;
  274.   wbemErrInvalidObjectPath = $8004103A;
  275.   wbemErrOutOfDiskSpace = $8004103B;
  276.   wbemErrBufferTooSmall = $8004103C;
  277.   wbemErrUnsupportedPutExtension = $8004103D;
  278.   wbemErrUnknownObjectType = $8004103E;
  279.   wbemErrUnknownPacketType = $8004103F;
  280.   wbemErrMarshalVersionMismatch = $80041040;
  281.   wbemErrMarshalInvalidSignature = $80041041;
  282.   wbemErrInvalidQualifier = $80041042;
  283.   wbemErrInvalidDuplicateParameter = $80041043;
  284.   wbemErrTooMuchData = $80041044;
  285.   wbemErrServerTooBusy = $80041045;
  286.   wbemErrInvalidFlavor = $80041046;
  287.   wbemErrCircularReference = $80041047;
  288.   wbemErrUnsupportedClassUpdate = $80041048;
  289.   wbemErrCannotChangeKeyInheritance = $80041049;
  290.   wbemErrCannotChangeIndexInheritance = $80041050;
  291.   wbemErrTooManyProperties = $80041051;
  292.   wbemErrUpdateTypeMismatch = $80041052;
  293.   wbemErrUpdateOverrideNotAllowed = $80041053;
  294.   wbemErrUpdatePropagatedMethod = $80041054;
  295.   wbemErrMethodNotImplemented = $80041055;
  296.   wbemErrMethodDisabled = $80041056;
  297.   wbemErrRefresherBusy = $80041057;
  298.   wbemErrUnparsableQuery = $80041058;
  299.   wbemErrNotEventClass = $80041059;
  300.   wbemErrMissingGroupWithin = $8004105A;
  301.   wbemErrMissingAggregationList = $8004105B;
  302.   wbemErrPropertyNotAnObject = $8004105C;
  303.   wbemErrAggregatingByObject = $8004105D;
  304.   wbemErrUninterpretableProviderQuery = $8004105F;
  305.   wbemErrBackupRestoreWinmgmtRunning = $80041060;
  306.   wbemErrQueueOverflow = $80041061;
  307.   wbemErrPrivilegeNotHeld = $80041062;
  308.   wbemErrInvalidOperator = $80041063;
  309.   wbemErrLocalCredentials = $80041064;
  310.   wbemErrCannotBeAbstract = $80041065;
  311.   wbemErrAmendedObject = $80041066;
  312.   wbemErrClientTooSlow = $80041067;
  313.   wbemErrNullSecurityDescriptor = $80041068;
  314.   wbemErrTimeout = $80041069;
  315.   wbemErrInvalidAssociation = $8004106A;
  316.   wbemErrAmbiguousOperation = $8004106B;
  317.   wbemErrQuotaViolation = $8004106C;
  318.   wbemErrTransactionConflict = $8004106D;
  319.   wbemErrForcedRollback = $8004106E;
  320.   wbemErrUnsupportedLocale = $8004106F;
  321.   wbemErrHandleOutOfDate = $80041070;
  322.   wbemErrConnectionFailed = $80041071;
  323.   wbemErrInvalidHandleRequest = $80041072;
  324.   wbemErrPropertyNameTooWide = $80041073;
  325.   wbemErrClassNameTooWide = $80041074;
  326.   wbemErrMethodNameTooWide = $80041075;
  327.   wbemErrQualifierNameTooWide = $80041076;
  328.   wbemErrRerunCommand = $80041077;
  329.   wbemErrDatabaseVerMismatch = $80041078;
  330.   wbemErrVetoPut = $80041079;
  331.   wbemErrVetoDelete = $8004107A;
  332.   wbemErrInvalidLocale = $80041080;
  333.   wbemErrProviderSuspended = $80041081;
  334.   wbemErrSynchronizationRequired = $80041082;
  335.   wbemErrNoSchema = $80041083;
  336.   wbemErrProviderAlreadyRegistered = $80041084;
  337.   wbemErrProviderNotRegistered = $80041085;
  338.   wbemErrFatalTransportError = $80041086;
  339.   wbemErrEncryptedConnectionRequired = $80041087;
  340.   wbemErrRegistrationTooBroad = $80042001;
  341.   wbemErrRegistrationTooPrecise = $80042002;
  342.   wbemErrTimedout = $80043001;
  343.   wbemErrResetToDefault = $80043002;
  344.  
  345. // Constants for enum WbemObjectTextFormatEnum
  346. type
  347.   WbemObjectTextFormatEnum = TOleEnum;
  348. const
  349.   wbemObjectTextFormatCIMDTD20 = $00000001;
  350.   wbemObjectTextFormatWMIDTD20 = $00000002;
  351.  
  352. // Constants for enum WbemChangeFlagEnum
  353. type
  354.   WbemChangeFlagEnum = TOleEnum;
  355. const
  356.   wbemChangeFlagCreateOrUpdate = $00000000;
  357.   wbemChangeFlagUpdateOnly = $00000001;
  358.   wbemChangeFlagCreateOnly = $00000002;
  359.   wbemChangeFlagUpdateCompatible = $00000000;
  360.   wbemChangeFlagUpdateSafeMode = $00000020;
  361.   wbemChangeFlagUpdateForceMode = $00000040;
  362.   wbemChangeFlagStrongValidation = $00000080;
  363.   wbemChangeFlagAdvisory = $00010000;
  364.  
  365. // Constants for enum WbemFlagEnum
  366. type
  367.   WbemFlagEnum = TOleEnum;
  368. const
  369.   wbemFlagReturnImmediately = $00000010;
  370.   wbemFlagReturnWhenComplete = $00000000;
  371.   wbemFlagBidirectional = $00000000;
  372.   wbemFlagForwardOnly = $00000020;
  373.   wbemFlagNoErrorObject = $00000040;
  374.   wbemFlagReturnErrorObject = $00000000;
  375.   wbemFlagSendStatus = $00000080;
  376.   wbemFlagDontSendStatus = $00000000;
  377.   wbemFlagEnsureLocatable = $00000100;
  378.   wbemFlagDirectRead = $00000200;
  379.   wbemFlagSendOnlySelected = $00000000;
  380.   wbemFlagUseAmendedQualifiers = $00020000;
  381.   wbemFlagGetDefault = $00000000;
  382.   wbemFlagSpawnInstance = $00000001;
  383.   wbemFlagUseCurrentTime = $00000001;
  384.  
  385. // Constants for enum WbemQueryFlagEnum
  386. type
  387.   WbemQueryFlagEnum = TOleEnum;
  388. const
  389.   wbemQueryFlagDeep = $00000000;
  390.   wbemQueryFlagShallow = $00000001;
  391.   wbemQueryFlagPrototype = $00000002;
  392.  
  393. // Constants for enum WbemTextFlagEnum
  394. type
  395.   WbemTextFlagEnum = TOleEnum;
  396. const
  397.   wbemTextFlagNoFlavors = $00000001;
  398.  
  399. // Constants for enum WbemTimeout
  400. type
  401.   WbemTimeout = TOleEnum;
  402. const
  403.   wbemTimeoutInfinite = $FFFFFFFF;
  404.  
  405. // Constants for enum WbemComparisonFlagEnum
  406. type
  407.   WbemComparisonFlagEnum = TOleEnum;
  408. const
  409.   wbemComparisonFlagIncludeAll = $00000000;
  410.   wbemComparisonFlagIgnoreQualifiers = $00000001;
  411.   wbemComparisonFlagIgnoreObjectSource = $00000002;
  412.   wbemComparisonFlagIgnoreDefaultValues = $00000004;
  413.   wbemComparisonFlagIgnoreClass = $00000008;
  414.   wbemComparisonFlagIgnoreCase = $00000010;
  415.   wbemComparisonFlagIgnoreFlavor = $00000020;
  416.  
  417. // Constants for enum WbemConnectOptionsEnum
  418. type
  419.   WbemConnectOptionsEnum = TOleEnum;
  420. const
  421.   wbemConnectFlagUseMaxWait = $00000080;
  422.  
  423. type
  424.  
  425. // *********************************************************************//
  426. // Forward declaration of types defined in TypeLibrary
  427. // *********************************************************************//
  428.   ISWbemServices = interface;
  429.   ISWbemServicesDisp = dispinterface;
  430.   ISWbemObject = interface;
  431.   ISWbemObjectDisp = dispinterface;
  432.   ISWbemObjectPath = interface;
  433.   ISWbemObjectPathDisp = dispinterface;
  434.   ISWbemNamedValueSet = interface;
  435.   ISWbemNamedValueSetDisp = dispinterface;
  436.   ISWbemNamedValue = interface;
  437.   ISWbemNamedValueDisp = dispinterface;
  438.   ISWbemSecurity = interface;
  439.   ISWbemSecurityDisp = dispinterface;
  440.   ISWbemPrivilegeSet = interface;
  441.   ISWbemPrivilegeSetDisp = dispinterface;
  442.   ISWbemPrivilege = interface;
  443.   ISWbemPrivilegeDisp = dispinterface;
  444.   ISWbemObjectSet = interface;
  445.   ISWbemObjectSetDisp = dispinterface;
  446.   ISWbemQualifierSet = interface;
  447.   ISWbemQualifierSetDisp = dispinterface;
  448.   ISWbemQualifier = interface;
  449.   ISWbemQualifierDisp = dispinterface;
  450.   ISWbemPropertySet = interface;
  451.   ISWbemPropertySetDisp = dispinterface;
  452.   ISWbemProperty = interface;
  453.   ISWbemPropertyDisp = dispinterface;
  454.   ISWbemMethodSet = interface;
  455.   ISWbemMethodSetDisp = dispinterface;
  456.   ISWbemMethod = interface;
  457.   ISWbemMethodDisp = dispinterface;
  458.   ISWbemEventSource = interface;
  459.   ISWbemEventSourceDisp = dispinterface;
  460.   ISWbemLocator = interface;
  461.   ISWbemLocatorDisp = dispinterface;
  462.   ISWbemLastError = interface;
  463.   ISWbemLastErrorDisp = dispinterface;
  464.   ISWbemSinkEvents = dispinterface;
  465.   ISWbemSink = interface;
  466.   ISWbemSinkDisp = dispinterface;
  467.   ISWbemServicesEx = interface;
  468.   ISWbemServicesExDisp = dispinterface;
  469.   ISWbemObjectEx = interface;
  470.   ISWbemObjectExDisp = dispinterface;
  471.   ISWbemDateTime = interface;
  472.   ISWbemDateTimeDisp = dispinterface;
  473.   ISWbemRefresher = interface;
  474.   ISWbemRefresherDisp = dispinterface;
  475.   ISWbemRefreshableItem = interface;
  476.   ISWbemRefreshableItemDisp = dispinterface;
  477.  
  478. // *********************************************************************//
  479. // Declaration of CoClasses defined in Type Library
  480. // (NOTE: Here we map each CoClass to its Default Interface)
  481. // *********************************************************************//
  482.   SWbemLocator = ISWbemLocator;
  483.   SWbemNamedValueSet = ISWbemNamedValueSet;
  484.   SWbemObjectPath = ISWbemObjectPath;
  485.   SWbemLastError = ISWbemLastError;
  486.   SWbemSink = ISWbemSink;
  487.   SWbemDateTime = ISWbemDateTime;
  488.   SWbemRefresher = ISWbemRefresher;
  489.   SWbemServices = ISWbemServices;
  490.   SWbemServicesEx = ISWbemServicesEx;
  491.   SWbemObject = ISWbemObject;
  492.   SWbemObjectEx = ISWbemObjectEx;
  493.   SWbemObjectSet = ISWbemObjectSet;
  494.   SWbemNamedValue = ISWbemNamedValue;
  495.   SWbemQualifier = ISWbemQualifier;
  496.   SWbemQualifierSet = ISWbemQualifierSet;
  497.   SWbemProperty = ISWbemProperty;
  498.   SWbemPropertySet = ISWbemPropertySet;
  499.   SWbemMethod = ISWbemMethod;
  500.   SWbemMethodSet = ISWbemMethodSet;
  501.   SWbemEventSource = ISWbemEventSource;
  502.   SWbemSecurity = ISWbemSecurity;
  503.   SWbemPrivilege = ISWbemPrivilege;
  504.   SWbemPrivilegeSet = ISWbemPrivilegeSet;
  505.   SWbemRefreshableItem = ISWbemRefreshableItem;
  506.  
  507.  
  508. // *********************************************************************//
  509. // Declaration of structures, unions and aliases.
  510. // *********************************************************************//
  511.   POleVariant1 = ^OleVariant; {*}
  512.  
  513.  
  514. // *********************************************************************//
  515. // Interface: ISWbemServices
  516. // Flags:     (4432) Hidden Dual OleAutomation Dispatchable
  517. // GUID:      {76A6415C-CB41-11D1-8B02-00600806D9B6}
  518. // *********************************************************************//
  519.   ISWbemServices = interface(IDispatch)
  520.     ['{76A6415C-CB41-11D1-8B02-00600806D9B6}']
  521.     function Get(const strObjectPath: WideString; iFlags: Integer;
  522.                  const objWbemNamedValueSet: IDispatch): ISWbemObject; safecall;
  523.     procedure GetAsync(const objWbemSink: IDispatch; const strObjectPath: WideString;
  524.                        iFlags: Integer; const objWbemNamedValueSet: IDispatch;
  525.                        const objWbemAsyncContext: IDispatch); safecall;
  526.     procedure Delete(const strObjectPath: WideString; iFlags: Integer;
  527.                      const objWbemNamedValueSet: IDispatch); safecall;
  528.     procedure DeleteAsync(const objWbemSink: IDispatch; const strObjectPath: WideString;
  529.                           iFlags: Integer; const objWbemNamedValueSet: IDispatch;
  530.                           const objWbemAsyncContext: IDispatch); safecall;
  531.     function InstancesOf(const strClass: WideString; iFlags: Integer;
  532.                          const objWbemNamedValueSet: IDispatch): ISWbemObjectSet; safecall;
  533.     procedure InstancesOfAsync(const objWbemSink: IDispatch; const strClass: WideString;
  534.                                iFlags: Integer; const objWbemNamedValueSet: IDispatch;
  535.                                const objWbemAsyncContext: IDispatch); safecall;
  536.     function SubclassesOf(const strSuperclass: WideString; iFlags: Integer;
  537.                           const objWbemNamedValueSet: IDispatch): ISWbemObjectSet; safecall;
  538.     procedure SubclassesOfAsync(const objWbemSink: IDispatch; const strSuperclass: WideString;
  539.                                 iFlags: Integer; const objWbemNamedValueSet: IDispatch;
  540.                                 const objWbemAsyncContext: IDispatch); safecall;
  541.     function ExecQuery(const strQuery: WideString; const strQueryLanguage: WideString;
  542.                        iFlags: Integer; const objWbemNamedValueSet: IDispatch): ISWbemObjectSet; safecall;
  543.     procedure ExecQueryAsync(const objWbemSink: IDispatch; const strQuery: WideString;
  544.                              const strQueryLanguage: WideString; lFlags: Integer;
  545.                              const objWbemNamedValueSet: IDispatch;
  546.                              const objWbemAsyncContext: IDispatch); safecall;
  547.     function AssociatorsOf(const strObjectPath: WideString; const strAssocClass: WideString;
  548.                            const strResultClass: WideString; const strResultRole: WideString;
  549.                            const strRole: WideString; bClassesOnly: WordBool;
  550.                            bSchemaOnly: WordBool; const strRequiredAssocQualifier: WideString;
  551.                            const strRequiredQualifier: WideString; iFlags: Integer;
  552.                            const objWbemNamedValueSet: IDispatch): ISWbemObjectSet; safecall;
  553.     procedure AssociatorsOfAsync(const objWbemSink: IDispatch; const strObjectPath: WideString;
  554.                                  const strAssocClass: WideString; const strResultClass: WideString;
  555.                                  const strResultRole: WideString; const strRole: WideString;
  556.                                  bClassesOnly: WordBool; bSchemaOnly: WordBool;
  557.                                  const strRequiredAssocQualifier: WideString;
  558.                                  const strRequiredQualifier: WideString; iFlags: Integer;
  559.                                  const objWbemNamedValueSet: IDispatch;
  560.                                  const objWbemAsyncContext: IDispatch); safecall;
  561.     function ReferencesTo(const strObjectPath: WideString; const strResultClass: WideString;
  562.                           const strRole: WideString; bClassesOnly: WordBool; bSchemaOnly: WordBool;
  563.                           const strRequiredQualifier: WideString; iFlags: Integer;
  564.                           const objWbemNamedValueSet: IDispatch): ISWbemObjectSet; safecall;
  565.     procedure ReferencesToAsync(const objWbemSink: IDispatch; const strObjectPath: WideString;
  566.                                 const strResultClass: WideString; const strRole: WideString;
  567.                                 bClassesOnly: WordBool; bSchemaOnly: WordBool;
  568.                                 const strRequiredQualifier: WideString; iFlags: Integer;
  569.                                 const objWbemNamedValueSet: IDispatch;
  570.                                 const objWbemAsyncContext: IDispatch); safecall;
  571.     function ExecNotificationQuery(const strQuery: WideString; const strQueryLanguage: WideString;
  572.                                    iFlags: Integer; const objWbemNamedValueSet: IDispatch): ISWbemEventSource; safecall;
  573.     procedure ExecNotificationQueryAsync(const objWbemSink: IDispatch; const strQuery: WideString;
  574.                                          const strQueryLanguage: WideString; iFlags: Integer;
  575.                                          const objWbemNamedValueSet: IDispatch;
  576.                                          const objWbemAsyncContext: IDispatch); safecall;
  577.     function ExecMethod(const strObjectPath: WideString; const strMethodName: WideString;
  578.                         const objWbemInParameters: IDispatch; iFlags: Integer;
  579.                         const objWbemNamedValueSet: IDispatch): ISWbemObject; safecall;
  580.     procedure ExecMethodAsync(const objWbemSink: IDispatch; const strObjectPath: WideString;
  581.                               const strMethodName: WideString;
  582.                               const objWbemInParameters: IDispatch; iFlags: Integer;
  583.                               const objWbemNamedValueSet: IDispatch;
  584.                               const objWbemAsyncContext: IDispatch); safecall;
  585.     function Get_Security_: ISWbemSecurity; safecall;
  586.     property Security_: ISWbemSecurity read Get_Security_;
  587.   end;
  588.  
  589. // *********************************************************************//
  590. // DispIntf:  ISWbemServicesDisp
  591. // Flags:     (4432) Hidden Dual OleAutomation Dispatchable
  592. // GUID:      {76A6415C-CB41-11D1-8B02-00600806D9B6}
  593. // *********************************************************************//
  594.   ISWbemServicesDisp = dispinterface
  595.     ['{76A6415C-CB41-11D1-8B02-00600806D9B6}']
  596.     function Get(const strObjectPath: WideString; iFlags: Integer;
  597.                  const objWbemNamedValueSet: IDispatch): ISWbemObject; dispid 1;
  598.     procedure GetAsync(const objWbemSink: IDispatch; const strObjectPath: WideString;
  599.                        iFlags: Integer; const objWbemNamedValueSet: IDispatch;
  600.                        const objWbemAsyncContext: IDispatch); dispid 2;
  601.     procedure Delete(const strObjectPath: WideString; iFlags: Integer;
  602.                      const objWbemNamedValueSet: IDispatch); dispid 3;
  603.     procedure DeleteAsync(const objWbemSink: IDispatch; const strObjectPath: WideString;
  604.                           iFlags: Integer; const objWbemNamedValueSet: IDispatch;
  605.                           const objWbemAsyncContext: IDispatch); dispid 4;
  606.     function InstancesOf(const strClass: WideString; iFlags: Integer;
  607.                          const objWbemNamedValueSet: IDispatch): ISWbemObjectSet; dispid 5;
  608.     procedure InstancesOfAsync(const objWbemSink: IDispatch; const strClass: WideString;
  609.                                iFlags: Integer; const objWbemNamedValueSet: IDispatch;
  610.                                const objWbemAsyncContext: IDispatch); dispid 6;
  611.     function SubclassesOf(const strSuperclass: WideString; iFlags: Integer;
  612.                           const objWbemNamedValueSet: IDispatch): ISWbemObjectSet; dispid 7;
  613.     procedure SubclassesOfAsync(const objWbemSink: IDispatch; const strSuperclass: WideString;
  614.                                 iFlags: Integer; const objWbemNamedValueSet: IDispatch;
  615.                                 const objWbemAsyncContext: IDispatch); dispid 8;
  616.     function ExecQuery(const strQuery: WideString; const strQueryLanguage: WideString;
  617.                        iFlags: Integer; const objWbemNamedValueSet: IDispatch): ISWbemObjectSet; dispid 9;
  618.     procedure ExecQueryAsync(const objWbemSink: IDispatch; const strQuery: WideString;
  619.                              const strQueryLanguage: WideString; lFlags: Integer;
  620.                              const objWbemNamedValueSet: IDispatch;
  621.                              const objWbemAsyncContext: IDispatch); dispid 10;
  622.     function AssociatorsOf(const strObjectPath: WideString; const strAssocClass: WideString;
  623.                            const strResultClass: WideString; const strResultRole: WideString;
  624.                            const strRole: WideString; bClassesOnly: WordBool;
  625.                            bSchemaOnly: WordBool; const strRequiredAssocQualifier: WideString;
  626.                            const strRequiredQualifier: WideString; iFlags: Integer;
  627.                            const objWbemNamedValueSet: IDispatch): ISWbemObjectSet; dispid 11;
  628.     procedure AssociatorsOfAsync(const objWbemSink: IDispatch; const strObjectPath: WideString;
  629.                                  const strAssocClass: WideString; const strResultClass: WideString;
  630.                                  const strResultRole: WideString; const strRole: WideString;
  631.                                  bClassesOnly: WordBool; bSchemaOnly: WordBool;
  632.                                  const strRequiredAssocQualifier: WideString;
  633.                                  const strRequiredQualifier: WideString; iFlags: Integer;
  634.                                  const objWbemNamedValueSet: IDispatch;
  635.                                  const objWbemAsyncContext: IDispatch); dispid 12;
  636.     function ReferencesTo(const strObjectPath: WideString; const strResultClass: WideString;
  637.                           const strRole: WideString; bClassesOnly: WordBool; bSchemaOnly: WordBool;
  638.                           const strRequiredQualifier: WideString; iFlags: Integer;
  639.                           const objWbemNamedValueSet: IDispatch): ISWbemObjectSet; dispid 13;
  640.     procedure ReferencesToAsync(const objWbemSink: IDispatch; const strObjectPath: WideString;
  641.                                 const strResultClass: WideString; const strRole: WideString;
  642.                                 bClassesOnly: WordBool; bSchemaOnly: WordBool;
  643.                                 const strRequiredQualifier: WideString; iFlags: Integer;
  644.                                 const objWbemNamedValueSet: IDispatch;
  645.                                 const objWbemAsyncContext: IDispatch); dispid 14;
  646.     function ExecNotificationQuery(const strQuery: WideString; const strQueryLanguage: WideString;
  647.                                    iFlags: Integer; const objWbemNamedValueSet: IDispatch): ISWbemEventSource; dispid 15;
  648.     procedure ExecNotificationQueryAsync(const objWbemSink: IDispatch; const strQuery: WideString;
  649.                                          const strQueryLanguage: WideString; iFlags: Integer;
  650.                                          const objWbemNamedValueSet: IDispatch;
  651.                                          const objWbemAsyncContext: IDispatch); dispid 16;
  652.     function ExecMethod(const strObjectPath: WideString; const strMethodName: WideString;
  653.                         const objWbemInParameters: IDispatch; iFlags: Integer;
  654.                         const objWbemNamedValueSet: IDispatch): ISWbemObject; dispid 17;
  655.     procedure ExecMethodAsync(const objWbemSink: IDispatch; const strObjectPath: WideString;
  656.                               const strMethodName: WideString;
  657.                               const objWbemInParameters: IDispatch; iFlags: Integer;
  658.                               const objWbemNamedValueSet: IDispatch;
  659.                               const objWbemAsyncContext: IDispatch); dispid 18;
  660.     property Security_: ISWbemSecurity readonly dispid 19;
  661.   end;
  662.  
  663. // *********************************************************************//
  664. // Interface: ISWbemObject
  665. // Flags:     (4432) Hidden Dual OleAutomation Dispatchable
  666. // GUID:      {76A6415A-CB41-11D1-8B02-00600806D9B6}
  667. // *********************************************************************//
  668.   ISWbemObject = interface(IDispatch)
  669.     ['{76A6415A-CB41-11D1-8B02-00600806D9B6}']
  670.     function Put_(iFlags: Integer; const objWbemNamedValueSet: IDispatch): ISWbemObjectPath; safecall;
  671.     procedure PutAsync_(const objWbemSink: IDispatch; iFlags: Integer;
  672.                         const objWbemNamedValueSet: IDispatch; const objWbemAsyncContext: IDispatch); safecall;
  673.     procedure Delete_(iFlags: Integer; const objWbemNamedValueSet: IDispatch); safecall;
  674.     procedure DeleteAsync_(const objWbemSink: IDispatch; iFlags: Integer;
  675.                            const objWbemNamedValueSet: IDispatch;
  676.                            const objWbemAsyncContext: IDispatch); safecall;
  677.     function Instances_(iFlags: Integer; const objWbemNamedValueSet: IDispatch): ISWbemObjectSet; safecall;
  678.     procedure InstancesAsync_(const objWbemSink: IDispatch; iFlags: Integer;
  679.                               const objWbemNamedValueSet: IDispatch;
  680.                               const objWbemAsyncContext: IDispatch); safecall;
  681.     function Subclasses_(iFlags: Integer; const objWbemNamedValueSet: IDispatch): ISWbemObjectSet; safecall;
  682.     procedure SubclassesAsync_(const objWbemSink: IDispatch; iFlags: Integer;
  683.                                const objWbemNamedValueSet: IDispatch;
  684.                                const objWbemAsyncContext: IDispatch); safecall;
  685.     function Associators_(const strAssocClass: WideString; const strResultClass: WideString;
  686.                           const strResultRole: WideString; const strRole: WideString;
  687.                           bClassesOnly: WordBool; bSchemaOnly: WordBool;
  688.                           const strRequiredAssocQualifier: WideString;
  689.                           const strRequiredQualifier: WideString; iFlags: Integer;
  690.                           const objWbemNamedValueSet: IDispatch): ISWbemObjectSet; safecall;
  691.     procedure AssociatorsAsync_(const objWbemSink: IDispatch; const strAssocClass: WideString;
  692.                                 const strResultClass: WideString; const strResultRole: WideString;
  693.                                 const strRole: WideString; bClassesOnly: WordBool;
  694.                                 bSchemaOnly: WordBool; const strRequiredAssocQualifier: WideString;
  695.                                 const strRequiredQualifier: WideString; iFlags: Integer;
  696.                                 const objWbemNamedValueSet: IDispatch;
  697.                                 const objWbemAsyncContext: IDispatch); safecall;
  698.     function References_(const strResultClass: WideString; const strRole: WideString;
  699.                          bClassesOnly: WordBool; bSchemaOnly: WordBool;
  700.                          const strRequiredQualifier: WideString; iFlags: Integer;
  701.                          const objWbemNamedValueSet: IDispatch): ISWbemObjectSet; safecall;
  702.     procedure ReferencesAsync_(const objWbemSink: IDispatch; const strResultClass: WideString;
  703.                                const strRole: WideString; bClassesOnly: WordBool;
  704.                                bSchemaOnly: WordBool; const strRequiredQualifier: WideString;
  705.                                iFlags: Integer; const objWbemNamedValueSet: IDispatch;
  706.                                const objWbemAsyncContext: IDispatch); safecall;
  707.     function ExecMethod_(const strMethodName: WideString; const objWbemInParameters: IDispatch;
  708.                          iFlags: Integer; const objWbemNamedValueSet: IDispatch): ISWbemObject; safecall;
  709.     procedure ExecMethodAsync_(const objWbemSink: IDispatch; const strMethodName: WideString;
  710.                                const objWbemInParameters: IDispatch; iFlags: Integer;
  711.                                const objWbemNamedValueSet: IDispatch;
  712.                                const objWbemAsyncContext: IDispatch); safecall;
  713.     function Clone_: ISWbemObject; safecall;
  714.     function GetObjectText_(iFlags: Integer): WideString; safecall;
  715.     function SpawnDerivedClass_(iFlags: Integer): ISWbemObject; safecall;
  716.     function SpawnInstance_(iFlags: Integer): ISWbemObject; safecall;
  717.     function CompareTo_(const objWbemObject: IDispatch; iFlags: Integer): WordBool; safecall;
  718.     function Get_Qualifiers_: ISWbemQualifierSet; safecall;
  719.     function Get_Properties_: ISWbemPropertySet; safecall;
  720.     function Get_Methods_: ISWbemMethodSet; safecall;
  721.     function Get_Derivation_: OleVariant; safecall;
  722.     function Get_Path_: ISWbemObjectPath; safecall;
  723.     function Get_Security_: ISWbemSecurity; safecall;
  724.     property Qualifiers_: ISWbemQualifierSet read Get_Qualifiers_;
  725.     property Properties_: ISWbemPropertySet read Get_Properties_;
  726.     property Methods_: ISWbemMethodSet read Get_Methods_;
  727.     property Derivation_: OleVariant read Get_Derivation_;
  728.     property Path_: ISWbemObjectPath read Get_Path_;
  729.     property Security_: ISWbemSecurity read Get_Security_;
  730.   end;
  731.  
  732. // *********************************************************************//
  733. // DispIntf:  ISWbemObjectDisp
  734. // Flags:     (4432) Hidden Dual OleAutomation Dispatchable
  735. // GUID:      {76A6415A-CB41-11D1-8B02-00600806D9B6}
  736. // *********************************************************************//
  737.   ISWbemObjectDisp = dispinterface
  738.     ['{76A6415A-CB41-11D1-8B02-00600806D9B6}']
  739.     function Put_(iFlags: Integer; const objWbemNamedValueSet: IDispatch): ISWbemObjectPath; dispid 1;
  740.     procedure PutAsync_(const objWbemSink: IDispatch; iFlags: Integer;
  741.                         const objWbemNamedValueSet: IDispatch; const objWbemAsyncContext: IDispatch); dispid 2;
  742.     procedure Delete_(iFlags: Integer; const objWbemNamedValueSet: IDispatch); dispid 3;
  743.     procedure DeleteAsync_(const objWbemSink: IDispatch; iFlags: Integer;
  744.                            const objWbemNamedValueSet: IDispatch;
  745.                            const objWbemAsyncContext: IDispatch); dispid 4;
  746.     function Instances_(iFlags: Integer; const objWbemNamedValueSet: IDispatch): ISWbemObjectSet; dispid 5;
  747.     procedure InstancesAsync_(const objWbemSink: IDispatch; iFlags: Integer;
  748.                               const objWbemNamedValueSet: IDispatch;
  749.                               const objWbemAsyncContext: IDispatch); dispid 6;
  750.     function Subclasses_(iFlags: Integer; const objWbemNamedValueSet: IDispatch): ISWbemObjectSet; dispid 7;
  751.     procedure SubclassesAsync_(const objWbemSink: IDispatch; iFlags: Integer;
  752.                                const objWbemNamedValueSet: IDispatch;
  753.                                const objWbemAsyncContext: IDispatch); dispid 8;
  754.     function Associators_(const strAssocClass: WideString; const strResultClass: WideString;
  755.                           const strResultRole: WideString; const strRole: WideString;
  756.                           bClassesOnly: WordBool; bSchemaOnly: WordBool;
  757.                           const strRequiredAssocQualifier: WideString;
  758.                           const strRequiredQualifier: WideString; iFlags: Integer;
  759.                           const objWbemNamedValueSet: IDispatch): ISWbemObjectSet; dispid 9;
  760.     procedure AssociatorsAsync_(const objWbemSink: IDispatch; const strAssocClass: WideString;
  761.                                 const strResultClass: WideString; const strResultRole: WideString;
  762.                                 const strRole: WideString; bClassesOnly: WordBool;
  763.                                 bSchemaOnly: WordBool; const strRequiredAssocQualifier: WideString;
  764.                                 const strRequiredQualifier: WideString; iFlags: Integer;
  765.                                 const objWbemNamedValueSet: IDispatch;
  766.                                 const objWbemAsyncContext: IDispatch); dispid 10;
  767.     function References_(const strResultClass: WideString; const strRole: WideString;
  768.                          bClassesOnly: WordBool; bSchemaOnly: WordBool;
  769.                          const strRequiredQualifier: WideString; iFlags: Integer;
  770.                          const objWbemNamedValueSet: IDispatch): ISWbemObjectSet; dispid 11;
  771.     procedure ReferencesAsync_(const objWbemSink: IDispatch; const strResultClass: WideString;
  772.                                const strRole: WideString; bClassesOnly: WordBool;
  773.                                bSchemaOnly: WordBool; const strRequiredQualifier: WideString;
  774.                                iFlags: Integer; const objWbemNamedValueSet: IDispatch;
  775.                                const objWbemAsyncContext: IDispatch); dispid 12;
  776.     function ExecMethod_(const strMethodName: WideString; const objWbemInParameters: IDispatch;
  777.                          iFlags: Integer; const objWbemNamedValueSet: IDispatch): ISWbemObject; dispid 13;
  778.     procedure ExecMethodAsync_(const objWbemSink: IDispatch; const strMethodName: WideString;
  779.                                const objWbemInParameters: IDispatch; iFlags: Integer;
  780.                                const objWbemNamedValueSet: IDispatch;
  781.                                const objWbemAsyncContext: IDispatch); dispid 14;
  782.     function Clone_: ISWbemObject; dispid 15;
  783.     function GetObjectText_(iFlags: Integer): WideString; dispid 16;
  784.     function SpawnDerivedClass_(iFlags: Integer): ISWbemObject; dispid 17;
  785.     function SpawnInstance_(iFlags: Integer): ISWbemObject; dispid 18;
  786.     function CompareTo_(const objWbemObject: IDispatch; iFlags: Integer): WordBool; dispid 19;
  787.     property Qualifiers_: ISWbemQualifierSet readonly dispid 20;
  788.     property Properties_: ISWbemPropertySet readonly dispid 21;
  789.     property Methods_: ISWbemMethodSet readonly dispid 22;
  790.     property Derivation_: OleVariant readonly dispid 23;
  791.     property Path_: ISWbemObjectPath readonly dispid 24;
  792.     property Security_: ISWbemSecurity readonly dispid 25;
  793.   end;
  794.  
  795. // *********************************************************************//
  796. // Interface: ISWbemObjectPath
  797. // Flags:     (4432) Hidden Dual OleAutomation Dispatchable
  798. // GUID:      {5791BC27-CE9C-11D1-97BF-0000F81E849C}
  799. // *********************************************************************//
  800.   ISWbemObjectPath = interface(IDispatch)
  801.     ['{5791BC27-CE9C-11D1-97BF-0000F81E849C}']
  802.     function Get_Path: WideString; safecall;
  803.     procedure Set_Path(const strPath: WideString); safecall;
  804.     function Get_RelPath: WideString; safecall;
  805.     procedure Set_RelPath(const strRelPath: WideString); safecall;
  806.     function Get_Server: WideString; safecall;
  807.     procedure Set_Server(const strServer: WideString); safecall;
  808.     function Get_Namespace: WideString; safecall;
  809.     procedure Set_Namespace(const strNamespace: WideString); safecall;
  810.     function Get_ParentNamespace: WideString; safecall;
  811.     function Get_DisplayName: WideString; safecall;
  812.     procedure Set_DisplayName(const strDisplayName: WideString); safecall;
  813.     function Get_Class_: WideString; safecall;
  814.     procedure Set_Class_(const strClass: WideString); safecall;
  815.     function Get_IsClass: WordBool; safecall;
  816.     procedure SetAsClass; safecall;
  817.     function Get_IsSingleton: WordBool; safecall;
  818.     procedure SetAsSingleton; safecall;
  819.     function Get_Keys: ISWbemNamedValueSet; safecall;
  820.     function Get_Security_: ISWbemSecurity; safecall;
  821.     function Get_Locale: WideString; safecall;
  822.     procedure Set_Locale(const strLocale: WideString); safecall;
  823.     function Get_Authority: WideString; safecall;
  824.     procedure Set_Authority(const strAuthority: WideString); safecall;
  825.     property Path: WideString read Get_Path write Set_Path;
  826.     property RelPath: WideString read Get_RelPath write Set_RelPath;
  827.     property Server: WideString read Get_Server write Set_Server;
  828.     property Namespace: WideString read Get_Namespace write Set_Namespace;
  829.     property ParentNamespace: WideString read Get_ParentNamespace;
  830.     property DisplayName: WideString read Get_DisplayName write Set_DisplayName;
  831.     property Class_: WideString read Get_Class_ write Set_Class_;
  832.     property IsClass: WordBool read Get_IsClass;
  833.     property IsSingleton: WordBool read Get_IsSingleton;
  834.     property Keys: ISWbemNamedValueSet read Get_Keys;
  835.     property Security_: ISWbemSecurity read Get_Security_;
  836.     property Locale: WideString read Get_Locale write Set_Locale;
  837.     property Authority: WideString read Get_Authority write Set_Authority;
  838.   end;
  839.  
  840. // *********************************************************************//
  841. // DispIntf:  ISWbemObjectPathDisp
  842. // Flags:     (4432) Hidden Dual OleAutomation Dispatchable
  843. // GUID:      {5791BC27-CE9C-11D1-97BF-0000F81E849C}
  844. // *********************************************************************//
  845.   ISWbemObjectPathDisp = dispinterface
  846.     ['{5791BC27-CE9C-11D1-97BF-0000F81E849C}']
  847.     property Path: WideString dispid 0;
  848.     property RelPath: WideString dispid 1;
  849.     property Server: WideString dispid 2;
  850.     property Namespace: WideString dispid 3;
  851.     property ParentNamespace: WideString readonly dispid 4;
  852.     property DisplayName: WideString dispid 5;
  853.     property Class_: WideString dispid 6;
  854.     property IsClass: WordBool readonly dispid 7;
  855.     procedure SetAsClass; dispid 8;
  856.     property IsSingleton: WordBool readonly dispid 9;
  857.     procedure SetAsSingleton; dispid 10;
  858.     property Keys: ISWbemNamedValueSet readonly dispid 11;
  859.     property Security_: ISWbemSecurity readonly dispid 12;
  860.     property Locale: WideString dispid 13;
  861.     property Authority: WideString dispid 14;
  862.   end;
  863.  
  864. // *********************************************************************//
  865. // Interface: ISWbemNamedValueSet
  866. // Flags:     (4432) Hidden Dual OleAutomation Dispatchable
  867. // GUID:      {CF2376EA-CE8C-11D1-8B05-00600806D9B6}
  868. // *********************************************************************//
  869.   ISWbemNamedValueSet = interface(IDispatch)
  870.     ['{CF2376EA-CE8C-11D1-8B05-00600806D9B6}']
  871.     function Get__NewEnum: IUnknown; safecall;
  872.     function Item(const strName: WideString; iFlags: Integer): ISWbemNamedValue; safecall;
  873.     function Get_Count: Integer; safecall;
  874.     function Add(const strName: WideString; var varValue: OleVariant; iFlags: Integer): ISWbemNamedValue; safecall;
  875.     procedure Remove(const strName: WideString; iFlags: Integer); safecall;
  876.     function Clone: ISWbemNamedValueSet; safecall;
  877.     procedure DeleteAll; safecall;
  878.     property _NewEnum: IUnknown read Get__NewEnum;
  879.     property Count: Integer read Get_Count;
  880.   end;
  881.  
  882. // *********************************************************************//
  883. // DispIntf:  ISWbemNamedValueSetDisp
  884. // Flags:     (4432) Hidden Dual OleAutomation Dispatchable
  885. // GUID:      {CF2376EA-CE8C-11D1-8B05-00600806D9B6}
  886. // *********************************************************************//
  887.   ISWbemNamedValueSetDisp = dispinterface
  888.     ['{CF2376EA-CE8C-11D1-8B05-00600806D9B6}']
  889.     property _NewEnum: IUnknown readonly dispid -4;
  890.     function Item(const strName: WideString; iFlags: Integer): ISWbemNamedValue; dispid 0;
  891.     property Count: Integer readonly dispid 1;
  892.     function Add(const strName: WideString; var varValue: OleVariant; iFlags: Integer): ISWbemNamedValue; dispid 2;
  893.     procedure Remove(const strName: WideString; iFlags: Integer); dispid 3;
  894.     function Clone: ISWbemNamedValueSet; dispid 4;
  895.     procedure DeleteAll; dispid 5;
  896.   end;
  897.  
  898. // *********************************************************************//
  899. // Interface: ISWbemNamedValue
  900. // Flags:     (4432) Hidden Dual OleAutomation Dispatchable
  901. // GUID:      {76A64164-CB41-11D1-8B02-00600806D9B6}
  902. // *********************************************************************//
  903.   ISWbemNamedValue = interface(IDispatch)
  904.     ['{76A64164-CB41-11D1-8B02-00600806D9B6}']
  905.     function Get_Value: OleVariant; safecall;
  906.     procedure Set_Value(var varValue: OleVariant); safecall;
  907.     function Get_Name: WideString; safecall;
  908.     property Name: WideString read Get_Name;
  909.   end;
  910.  
  911. // *********************************************************************//
  912. // DispIntf:  ISWbemNamedValueDisp
  913. // Flags:     (4432) Hidden Dual OleAutomation Dispatchable
  914. // GUID:      {76A64164-CB41-11D1-8B02-00600806D9B6}
  915. // *********************************************************************//
  916.   ISWbemNamedValueDisp = dispinterface
  917.     ['{76A64164-CB41-11D1-8B02-00600806D9B6}']
  918.     function Value: OleVariant; dispid 0;
  919.     property Name: WideString readonly dispid 2;
  920.   end;
  921.  
  922. // *********************************************************************//
  923. // Interface: ISWbemSecurity
  924. // Flags:     (4560) Hidden Dual NonExtensible OleAutomation Dispatchable
  925. // GUID:      {B54D66E6-2287-11D2-8B33-00600806D9B6}
  926. // *********************************************************************//
  927.   ISWbemSecurity = interface(IDispatch)
  928.     ['{B54D66E6-2287-11D2-8B33-00600806D9B6}']
  929.     function Get_ImpersonationLevel: WbemImpersonationLevelEnum; safecall;
  930.     procedure Set_ImpersonationLevel(iImpersonationLevel: WbemImpersonationLevelEnum); safecall;
  931.     function Get_AuthenticationLevel: WbemAuthenticationLevelEnum; safecall;
  932.     procedure Set_AuthenticationLevel(iAuthenticationLevel: WbemAuthenticationLevelEnum); safecall;
  933.     function Get_Privileges: ISWbemPrivilegeSet; safecall;
  934.     property ImpersonationLevel: WbemImpersonationLevelEnum read Get_ImpersonationLevel write Set_ImpersonationLevel;
  935.     property AuthenticationLevel: WbemAuthenticationLevelEnum read Get_AuthenticationLevel write Set_AuthenticationLevel;
  936.     property Privileges: ISWbemPrivilegeSet read Get_Privileges;
  937.   end;
  938.  
  939. // *********************************************************************//
  940. // DispIntf:  ISWbemSecurityDisp
  941. // Flags:     (4560) Hidden Dual NonExtensible OleAutomation Dispatchable
  942. // GUID:      {B54D66E6-2287-11D2-8B33-00600806D9B6}
  943. // *********************************************************************//
  944.   ISWbemSecurityDisp = dispinterface
  945.     ['{B54D66E6-2287-11D2-8B33-00600806D9B6}']
  946.     property ImpersonationLevel: WbemImpersonationLevelEnum dispid 1;
  947.     property AuthenticationLevel: WbemAuthenticationLevelEnum dispid 2;
  948.     property Privileges: ISWbemPrivilegeSet readonly dispid 3;
  949.   end;
  950.  
  951. // *********************************************************************//
  952. // Interface: ISWbemPrivilegeSet
  953. // Flags:     (4560) Hidden Dual NonExtensible OleAutomation Dispatchable
  954. // GUID:      {26EE67BF-5804-11D2-8B4A-00600806D9B6}
  955. // *********************************************************************//
  956.   ISWbemPrivilegeSet = interface(IDispatch)
  957.     ['{26EE67BF-5804-11D2-8B4A-00600806D9B6}']
  958.     function Get__NewEnum: IUnknown; safecall;
  959.     function Item(iPrivilege: WbemPrivilegeEnum): ISWbemPrivilege; safecall;
  960.     function Get_Count: Integer; safecall;
  961.     function Add(iPrivilege: WbemPrivilegeEnum; bIsEnabled: WordBool): ISWbemPrivilege; safecall;
  962.     procedure Remove(iPrivilege: WbemPrivilegeEnum); safecall;
  963.     procedure DeleteAll; safecall;
  964.     function AddAsString(const strPrivilege: WideString; bIsEnabled: WordBool): ISWbemPrivilege; safecall;
  965.     property _NewEnum: IUnknown read Get__NewEnum;
  966.     property Count: Integer read Get_Count;
  967.   end;
  968.  
  969. // *********************************************************************//
  970. // DispIntf:  ISWbemPrivilegeSetDisp
  971. // Flags:     (4560) Hidden Dual NonExtensible OleAutomation Dispatchable
  972. // GUID:      {26EE67BF-5804-11D2-8B4A-00600806D9B6}
  973. // *********************************************************************//
  974.   ISWbemPrivilegeSetDisp = dispinterface
  975.     ['{26EE67BF-5804-11D2-8B4A-00600806D9B6}']
  976.     property _NewEnum: IUnknown readonly dispid -4;
  977.     function Item(iPrivilege: WbemPrivilegeEnum): ISWbemPrivilege; dispid 0;
  978.     property Count: Integer readonly dispid 1;
  979.     function Add(iPrivilege: WbemPrivilegeEnum; bIsEnabled: WordBool): ISWbemPrivilege; dispid 2;
  980.     procedure Remove(iPrivilege: WbemPrivilegeEnum); dispid 3;
  981.     procedure DeleteAll; dispid 4;
  982.     function AddAsString(const strPrivilege: WideString; bIsEnabled: WordBool): ISWbemPrivilege; dispid 5;
  983.   end;
  984.  
  985. // *********************************************************************//
  986. // Interface: ISWbemPrivilege
  987. // Flags:     (4560) Hidden Dual NonExtensible OleAutomation Dispatchable
  988. // GUID:      {26EE67BD-5804-11D2-8B4A-00600806D9B6}
  989. // *********************************************************************//
  990.   ISWbemPrivilege = interface(IDispatch)
  991.     ['{26EE67BD-5804-11D2-8B4A-00600806D9B6}']
  992.     function Get_IsEnabled: WordBool; safecall;
  993.     procedure Set_IsEnabled(bIsEnabled: WordBool); safecall;
  994.     function Get_Name: WideString; safecall;
  995.     function Get_DisplayName: WideString; safecall;
  996.     function Get_Identifier: WbemPrivilegeEnum; safecall;
  997.     property IsEnabled: WordBool read Get_IsEnabled write Set_IsEnabled;
  998.     property Name: WideString read Get_Name;
  999.     property DisplayName: WideString read Get_DisplayName;
  1000.     property Identifier: WbemPrivilegeEnum read Get_Identifier;
  1001.   end;
  1002.  
  1003. // *********************************************************************//
  1004. // DispIntf:  ISWbemPrivilegeDisp
  1005. // Flags:     (4560) Hidden Dual NonExtensible OleAutomation Dispatchable
  1006. // GUID:      {26EE67BD-5804-11D2-8B4A-00600806D9B6}
  1007. // *********************************************************************//
  1008.   ISWbemPrivilegeDisp = dispinterface
  1009.     ['{26EE67BD-5804-11D2-8B4A-00600806D9B6}']
  1010.     property IsEnabled: WordBool dispid 0;
  1011.     property Name: WideString readonly dispid 1;
  1012.     property DisplayName: WideString readonly dispid 2;
  1013.     property Identifier: WbemPrivilegeEnum readonly dispid 3;
  1014.   end;
  1015.  
  1016. // *********************************************************************//
  1017. // Interface: ISWbemObjectSet
  1018. // Flags:     (4560) Hidden Dual NonExtensible OleAutomation Dispatchable
  1019. // GUID:      {76A6415F-CB41-11D1-8B02-00600806D9B6}
  1020. // *********************************************************************//
  1021.   ISWbemObjectSet = interface(IDispatch)
  1022.     ['{76A6415F-CB41-11D1-8B02-00600806D9B6}']
  1023.     function Get__NewEnum: IUnknown; safecall;
  1024.     function Item(const strObjectPath: WideString; iFlags: Integer): ISWbemObject; safecall;
  1025.     function Get_Count: Integer; safecall;
  1026.     function Get_Security_: ISWbemSecurity; safecall;
  1027.     property _NewEnum: IUnknown read Get__NewEnum;
  1028.     property Count: Integer read Get_Count;
  1029.     property Security_: ISWbemSecurity read Get_Security_;
  1030.   end;
  1031.  
  1032. // *********************************************************************//
  1033. // DispIntf:  ISWbemObjectSetDisp
  1034. // Flags:     (4560) Hidden Dual NonExtensible OleAutomation Dispatchable
  1035. // GUID:      {76A6415F-CB41-11D1-8B02-00600806D9B6}
  1036. // *********************************************************************//
  1037.   ISWbemObjectSetDisp = dispinterface
  1038.     ['{76A6415F-CB41-11D1-8B02-00600806D9B6}']
  1039.     property _NewEnum: IUnknown readonly dispid -4;
  1040.     function Item(const strObjectPath: WideString; iFlags: Integer): ISWbemObject; dispid 0;
  1041.     property Count: Integer readonly dispid 1;
  1042.     property Security_: ISWbemSecurity readonly dispid 4;
  1043.   end;
  1044.  
  1045. // *********************************************************************//
  1046. // Interface: ISWbemQualifierSet
  1047. // Flags:     (4560) Hidden Dual NonExtensible OleAutomation Dispatchable
  1048. // GUID:      {9B16ED16-D3DF-11D1-8B08-00600806D9B6}
  1049. // *********************************************************************//
  1050.   ISWbemQualifierSet = interface(IDispatch)
  1051.     ['{9B16ED16-D3DF-11D1-8B08-00600806D9B6}']
  1052.     function Get__NewEnum: IUnknown; safecall;
  1053.     function Item(const Name: WideString; iFlags: Integer): ISWbemQualifier; safecall;
  1054.     function Get_Count: Integer; safecall;
  1055.     function Add(const strName: WideString; var varVal: OleVariant;
  1056.                  bPropagatesToSubclass: WordBool; bPropagatesToInstance: WordBool;
  1057.                  bIsOverridable: WordBool; iFlags: Integer): ISWbemQualifier; safecall;
  1058.     procedure Remove(const strName: WideString; iFlags: Integer); safecall;
  1059.     property _NewEnum: IUnknown read Get__NewEnum;
  1060.     property Count: Integer read Get_Count;
  1061.   end;
  1062.  
  1063. // *********************************************************************//
  1064. // DispIntf:  ISWbemQualifierSetDisp
  1065. // Flags:     (4560) Hidden Dual NonExtensible OleAutomation Dispatchable
  1066. // GUID:      {9B16ED16-D3DF-11D1-8B08-00600806D9B6}
  1067. // *********************************************************************//
  1068.   ISWbemQualifierSetDisp = dispinterface
  1069.     ['{9B16ED16-D3DF-11D1-8B08-00600806D9B6}']
  1070.     property _NewEnum: IUnknown readonly dispid -4;
  1071.     function Item(const Name: WideString; iFlags: Integer): ISWbemQualifier; dispid 0;
  1072.     property Count: Integer readonly dispid 1;
  1073.     function Add(const strName: WideString; var varVal: OleVariant;
  1074.                  bPropagatesToSubclass: WordBool; bPropagatesToInstance: WordBool;
  1075.                  bIsOverridable: WordBool; iFlags: Integer): ISWbemQualifier; dispid 2;
  1076.     procedure Remove(const strName: WideString; iFlags: Integer); dispid 3;
  1077.   end;
  1078.  
  1079. // *********************************************************************//
  1080. // Interface: ISWbemQualifier
  1081. // Flags:     (4560) Hidden Dual NonExtensible OleAutomation Dispatchable
  1082. // GUID:      {79B05932-D3B7-11D1-8B06-00600806D9B6}
  1083. // *********************************************************************//
  1084.   ISWbemQualifier = interface(IDispatch)
  1085.     ['{79B05932-D3B7-11D1-8B06-00600806D9B6}']
  1086.     function Get_Value: OleVariant; safecall;
  1087.     procedure Set_Value(var varValue: OleVariant); safecall;
  1088.     function Get_Name: WideString; safecall;
  1089.     function Get_IsLocal: WordBool; safecall;
  1090.     function Get_PropagatesToSubclass: WordBool; safecall;
  1091.     procedure Set_PropagatesToSubclass(bPropagatesToSubclass: WordBool); safecall;
  1092.     function Get_PropagatesToInstance: WordBool; safecall;
  1093.     procedure Set_PropagatesToInstance(bPropagatesToInstance: WordBool); safecall;
  1094.     function Get_IsOverridable: WordBool; safecall;
  1095.     procedure Set_IsOverridable(bIsOverridable: WordBool); safecall;
  1096.     function Get_IsAmended: WordBool; safecall;
  1097.     property Name: WideString read Get_Name;
  1098.     property IsLocal: WordBool read Get_IsLocal;
  1099.     property PropagatesToSubclass: WordBool read Get_PropagatesToSubclass write Set_PropagatesToSubclass;
  1100.     property PropagatesToInstance: WordBool read Get_PropagatesToInstance write Set_PropagatesToInstance;
  1101.     property IsOverridable: WordBool read Get_IsOverridable write Set_IsOverridable;
  1102.     property IsAmended: WordBool read Get_IsAmended;
  1103.   end;
  1104.  
  1105. // *********************************************************************//
  1106. // DispIntf:  ISWbemQualifierDisp
  1107. // Flags:     (4560) Hidden Dual NonExtensible OleAutomation Dispatchable
  1108. // GUID:      {79B05932-D3B7-11D1-8B06-00600806D9B6}
  1109. // *********************************************************************//
  1110.   ISWbemQualifierDisp = dispinterface
  1111.     ['{79B05932-D3B7-11D1-8B06-00600806D9B6}']
  1112.     function Value: OleVariant; dispid 0;
  1113.     property Name: WideString readonly dispid 1;
  1114.     property IsLocal: WordBool readonly dispid 2;
  1115.     property PropagatesToSubclass: WordBool dispid 3;
  1116.     property PropagatesToInstance: WordBool dispid 4;
  1117.     property IsOverridable: WordBool dispid 5;
  1118.     property IsAmended: WordBool readonly dispid 6;
  1119.   end;
  1120.  
  1121. // *********************************************************************//
  1122. // Interface: ISWbemPropertySet
  1123. // Flags:     (4432) Hidden Dual OleAutomation Dispatchable
  1124. // GUID:      {DEA0A7B2-D4BA-11D1-8B09-00600806D9B6}
  1125. // *********************************************************************//
  1126.   ISWbemPropertySet = interface(IDispatch)
  1127.     ['{DEA0A7B2-D4BA-11D1-8B09-00600806D9B6}']
  1128.     function Get__NewEnum: IUnknown; safecall;
  1129.     function Item(const strName: WideString; iFlags: Integer): ISWbemProperty; safecall;
  1130.     function Get_Count: Integer; safecall;
  1131.     function Add(const strName: WideString; iCimType: WbemCimtypeEnum; bIsArray: WordBool;
  1132.                  iFlags: Integer): ISWbemProperty; safecall;
  1133.     procedure Remove(const strName: WideString; iFlags: Integer); safecall;
  1134.     property _NewEnum: IUnknown read Get__NewEnum;
  1135.     property Count: Integer read Get_Count;
  1136.   end;
  1137.  
  1138. // *********************************************************************//
  1139. // DispIntf:  ISWbemPropertySetDisp
  1140. // Flags:     (4432) Hidden Dual OleAutomation Dispatchable
  1141. // GUID:      {DEA0A7B2-D4BA-11D1-8B09-00600806D9B6}
  1142. // *********************************************************************//
  1143.   ISWbemPropertySetDisp = dispinterface
  1144.     ['{DEA0A7B2-D4BA-11D1-8B09-00600806D9B6}']
  1145.     property _NewEnum: IUnknown readonly dispid -4;
  1146.     function Item(const strName: WideString; iFlags: Integer): ISWbemProperty; dispid 0;
  1147.     property Count: Integer readonly dispid 1;
  1148.     function Add(const strName: WideString; iCimType: WbemCimtypeEnum; bIsArray: WordBool;
  1149.                  iFlags: Integer): ISWbemProperty; dispid 2;
  1150.     procedure Remove(const strName: WideString; iFlags: Integer); dispid 3;
  1151.   end;
  1152.  
  1153. // *********************************************************************//
  1154. // Interface: ISWbemProperty
  1155. // Flags:     (4432) Hidden Dual OleAutomation Dispatchable
  1156. // GUID:      {1A388F98-D4BA-11D1-8B09-00600806D9B6}
  1157. // *********************************************************************//
  1158.   ISWbemProperty = interface(IDispatch)
  1159.     ['{1A388F98-D4BA-11D1-8B09-00600806D9B6}']
  1160.     function Get_Value: OleVariant; safecall;
  1161.     procedure Set_Value(var varValue: OleVariant); safecall;
  1162.     function Get_Name: WideString; safecall;
  1163.     function Get_IsLocal: WordBool; safecall;
  1164.     function Get_Origin: WideString; safecall;
  1165.     function Get_CIMType: WbemCimtypeEnum; safecall;
  1166.     function Get_Qualifiers_: ISWbemQualifierSet; safecall;
  1167.     function Get_IsArray: WordBool; safecall;
  1168.     property Name: WideString read Get_Name;
  1169.     property IsLocal: WordBool read Get_IsLocal;
  1170.     property Origin: WideString read Get_Origin;
  1171.     property CIMType: WbemCimtypeEnum read Get_CIMType;
  1172.     property Qualifiers_: ISWbemQualifierSet read Get_Qualifiers_;
  1173.     property IsArray: WordBool read Get_IsArray;
  1174.   end;
  1175.  
  1176. // *********************************************************************//
  1177. // DispIntf:  ISWbemPropertyDisp
  1178. // Flags:     (4432) Hidden Dual OleAutomation Dispatchable
  1179. // GUID:      {1A388F98-D4BA-11D1-8B09-00600806D9B6}
  1180. // *********************************************************************//
  1181.   ISWbemPropertyDisp = dispinterface
  1182.     ['{1A388F98-D4BA-11D1-8B09-00600806D9B6}']
  1183.     function Value: OleVariant; dispid 0;
  1184.     property Name: WideString readonly dispid 1;
  1185.     property IsLocal: WordBool readonly dispid 2;
  1186.     property Origin: WideString readonly dispid 3;
  1187.     property CIMType: WbemCimtypeEnum readonly dispid 4;
  1188.     property Qualifiers_: ISWbemQualifierSet readonly dispid 5;
  1189.     property IsArray: WordBool readonly dispid 6;
  1190.   end;
  1191.  
  1192. // *********************************************************************//
  1193. // Interface: ISWbemMethodSet
  1194. // Flags:     (4560) Hidden Dual NonExtensible OleAutomation Dispatchable
  1195. // GUID:      {C93BA292-D955-11D1-8B09-00600806D9B6}
  1196. // *********************************************************************//
  1197.   ISWbemMethodSet = interface(IDispatch)
  1198.     ['{C93BA292-D955-11D1-8B09-00600806D9B6}']
  1199.     function Get__NewEnum: IUnknown; safecall;
  1200.     function Item(const strName: WideString; iFlags: Integer): ISWbemMethod; safecall;
  1201.     function Get_Count: Integer; safecall;
  1202.     property _NewEnum: IUnknown read Get__NewEnum;
  1203.     property Count: Integer read Get_Count;
  1204.   end;
  1205.  
  1206. // *********************************************************************//
  1207. // DispIntf:  ISWbemMethodSetDisp
  1208. // Flags:     (4560) Hidden Dual NonExtensible OleAutomation Dispatchable
  1209. // GUID:      {C93BA292-D955-11D1-8B09-00600806D9B6}
  1210. // *********************************************************************//
  1211.   ISWbemMethodSetDisp = dispinterface
  1212.     ['{C93BA292-D955-11D1-8B09-00600806D9B6}']
  1213.     property _NewEnum: IUnknown readonly dispid -4;
  1214.     function Item(const strName: WideString; iFlags: Integer): ISWbemMethod; dispid 0;
  1215.     property Count: Integer readonly dispid 1;
  1216.   end;
  1217.  
  1218. // *********************************************************************//
  1219. // Interface: ISWbemMethod
  1220. // Flags:     (4560) Hidden Dual NonExtensible OleAutomation Dispatchable
  1221. // GUID:      {422E8E90-D955-11D1-8B09-00600806D9B6}
  1222. // *********************************************************************//
  1223.   ISWbemMethod = interface(IDispatch)
  1224.     ['{422E8E90-D955-11D1-8B09-00600806D9B6}']
  1225.     function Get_Name: WideString; safecall;
  1226.     function Get_Origin: WideString; safecall;
  1227.     function Get_InParameters: ISWbemObject; safecall;
  1228.     function Get_OutParameters: ISWbemObject; safecall;
  1229.     function Get_Qualifiers_: ISWbemQualifierSet; safecall;
  1230.     property Name: WideString read Get_Name;
  1231.     property Origin: WideString read Get_Origin;
  1232.     property InParameters: ISWbemObject read Get_InParameters;
  1233.     property OutParameters: ISWbemObject read Get_OutParameters;
  1234.     property Qualifiers_: ISWbemQualifierSet read Get_Qualifiers_;
  1235.   end;
  1236.  
  1237. // *********************************************************************//
  1238. // DispIntf:  ISWbemMethodDisp
  1239. // Flags:     (4560) Hidden Dual NonExtensible OleAutomation Dispatchable
  1240. // GUID:      {422E8E90-D955-11D1-8B09-00600806D9B6}
  1241. // *********************************************************************//
  1242.   ISWbemMethodDisp = dispinterface
  1243.     ['{422E8E90-D955-11D1-8B09-00600806D9B6}']
  1244.     property Name: WideString readonly dispid 1;
  1245.     property Origin: WideString readonly dispid 2;
  1246.     property InParameters: ISWbemObject readonly dispid 3;
  1247.     property OutParameters: ISWbemObject readonly dispid 4;
  1248.     property Qualifiers_: ISWbemQualifierSet readonly dispid 5;
  1249.   end;
  1250.  
  1251. // *********************************************************************//
  1252. // Interface: ISWbemEventSource
  1253. // Flags:     (4560) Hidden Dual NonExtensible OleAutomation Dispatchable
  1254. // GUID:      {27D54D92-0EBE-11D2-8B22-00600806D9B6}
  1255. // *********************************************************************//
  1256.   ISWbemEventSource = interface(IDispatch)
  1257.     ['{27D54D92-0EBE-11D2-8B22-00600806D9B6}']
  1258.     function NextEvent(iTimeoutMs: Integer): ISWbemObject; safecall;
  1259.     function Get_Security_: ISWbemSecurity; safecall;
  1260.     property Security_: ISWbemSecurity read Get_Security_;
  1261.   end;
  1262.  
  1263. // *********************************************************************//
  1264. // DispIntf:  ISWbemEventSourceDisp
  1265. // Flags:     (4560) Hidden Dual NonExtensible OleAutomation Dispatchable
  1266. // GUID:      {27D54D92-0EBE-11D2-8B22-00600806D9B6}
  1267. // *********************************************************************//
  1268.   ISWbemEventSourceDisp = dispinterface
  1269.     ['{27D54D92-0EBE-11D2-8B22-00600806D9B6}']
  1270.     function NextEvent(iTimeoutMs: Integer): ISWbemObject; dispid 1;
  1271.     property Security_: ISWbemSecurity readonly dispid 2;
  1272.   end;
  1273.  
  1274. // *********************************************************************//
  1275. // Interface: ISWbemLocator
  1276. // Flags:     (4432) Hidden Dual OleAutomation Dispatchable
  1277. // GUID:      {76A6415B-CB41-11D1-8B02-00600806D9B6}
  1278. // *********************************************************************//
  1279.   ISWbemLocator = interface(IDispatch)
  1280.     ['{76A6415B-CB41-11D1-8B02-00600806D9B6}']
  1281.     function ConnectServer(const strServer: WideString; const strNamespace: WideString;
  1282.                            const strUser: WideString; const strPassword: WideString;
  1283.                            const strLocale: WideString; const strAuthority: WideString;
  1284.                            iSecurityFlags: Integer; const objWbemNamedValueSet: IDispatch): ISWbemServices; safecall;
  1285.     function Get_Security_: ISWbemSecurity; safecall;
  1286.     property Security_: ISWbemSecurity read Get_Security_;
  1287.   end;
  1288.  
  1289. // *********************************************************************//
  1290. // DispIntf:  ISWbemLocatorDisp
  1291. // Flags:     (4432) Hidden Dual OleAutomation Dispatchable
  1292. // GUID:      {76A6415B-CB41-11D1-8B02-00600806D9B6}
  1293. // *********************************************************************//
  1294.   ISWbemLocatorDisp = dispinterface
  1295.     ['{76A6415B-CB41-11D1-8B02-00600806D9B6}']
  1296.     function ConnectServer(const strServer: WideString; const strNamespace: WideString;
  1297.                            const strUser: WideString; const strPassword: WideString;
  1298.                            const strLocale: WideString; const strAuthority: WideString;
  1299.                            iSecurityFlags: Integer; const objWbemNamedValueSet: IDispatch): ISWbemServices; dispid 1;
  1300.     property Security_: ISWbemSecurity readonly dispid 2;
  1301.   end;
  1302.  
  1303. // *********************************************************************//
  1304. // Interface: ISWbemLastError
  1305. // Flags:     (4432) Hidden Dual OleAutomation Dispatchable
  1306. // GUID:      {D962DB84-D4BB-11D1-8B09-00600806D9B6}
  1307. // *********************************************************************//
  1308.   ISWbemLastError = interface(ISWbemObject)
  1309.     ['{D962DB84-D4BB-11D1-8B09-00600806D9B6}']
  1310.   end;
  1311.  
  1312. // *********************************************************************//
  1313. // DispIntf:  ISWbemLastErrorDisp
  1314. // Flags:     (4432) Hidden Dual OleAutomation Dispatchable
  1315. // GUID:      {D962DB84-D4BB-11D1-8B09-00600806D9B6}
  1316. // *********************************************************************//
  1317.   ISWbemLastErrorDisp = dispinterface
  1318.     ['{D962DB84-D4BB-11D1-8B09-00600806D9B6}']
  1319.     function Put_(iFlags: Integer; const objWbemNamedValueSet: IDispatch): ISWbemObjectPath; dispid 1;
  1320.     procedure PutAsync_(const objWbemSink: IDispatch; iFlags: Integer;
  1321.                         const objWbemNamedValueSet: IDispatch; const objWbemAsyncContext: IDispatch); dispid 2;
  1322.     procedure Delete_(iFlags: Integer; const objWbemNamedValueSet: IDispatch); dispid 3;
  1323.     procedure DeleteAsync_(const objWbemSink: IDispatch; iFlags: Integer;
  1324.                            const objWbemNamedValueSet: IDispatch;
  1325.                            const objWbemAsyncContext: IDispatch); dispid 4;
  1326.     function Instances_(iFlags: Integer; const objWbemNamedValueSet: IDispatch): ISWbemObjectSet; dispid 5;
  1327.     procedure InstancesAsync_(const objWbemSink: IDispatch; iFlags: Integer;
  1328.                               const objWbemNamedValueSet: IDispatch;
  1329.                               const objWbemAsyncContext: IDispatch); dispid 6;
  1330.     function Subclasses_(iFlags: Integer; const objWbemNamedValueSet: IDispatch): ISWbemObjectSet; dispid 7;
  1331.     procedure SubclassesAsync_(const objWbemSink: IDispatch; iFlags: Integer;
  1332.                                const objWbemNamedValueSet: IDispatch;
  1333.                                const objWbemAsyncContext: IDispatch); dispid 8;
  1334.     function Associators_(const strAssocClass: WideString; const strResultClass: WideString;
  1335.                           const strResultRole: WideString; const strRole: WideString;
  1336.                           bClassesOnly: WordBool; bSchemaOnly: WordBool;
  1337.                           const strRequiredAssocQualifier: WideString;
  1338.                           const strRequiredQualifier: WideString; iFlags: Integer;
  1339.                           const objWbemNamedValueSet: IDispatch): ISWbemObjectSet; dispid 9;
  1340.     procedure AssociatorsAsync_(const objWbemSink: IDispatch; const strAssocClass: WideString;
  1341.                                 const strResultClass: WideString; const strResultRole: WideString;
  1342.                                 const strRole: WideString; bClassesOnly: WordBool;
  1343.                                 bSchemaOnly: WordBool; const strRequiredAssocQualifier: WideString;
  1344.                                 const strRequiredQualifier: WideString; iFlags: Integer;
  1345.                                 const objWbemNamedValueSet: IDispatch;
  1346.                                 const objWbemAsyncContext: IDispatch); dispid 10;
  1347.     function References_(const strResultClass: WideString; const strRole: WideString;
  1348.                          bClassesOnly: WordBool; bSchemaOnly: WordBool;
  1349.                          const strRequiredQualifier: WideString; iFlags: Integer;
  1350.                          const objWbemNamedValueSet: IDispatch): ISWbemObjectSet; dispid 11;
  1351.     procedure ReferencesAsync_(const objWbemSink: IDispatch; const strResultClass: WideString;
  1352.                                const strRole: WideString; bClassesOnly: WordBool;
  1353.                                bSchemaOnly: WordBool; const strRequiredQualifier: WideString;
  1354.                                iFlags: Integer; const objWbemNamedValueSet: IDispatch;
  1355.                                const objWbemAsyncContext: IDispatch); dispid 12;
  1356.     function ExecMethod_(const strMethodName: WideString; const objWbemInParameters: IDispatch;
  1357.                          iFlags: Integer; const objWbemNamedValueSet: IDispatch): ISWbemObject; dispid 13;
  1358.     procedure ExecMethodAsync_(const objWbemSink: IDispatch; const strMethodName: WideString;
  1359.                                const objWbemInParameters: IDispatch; iFlags: Integer;
  1360.                                const objWbemNamedValueSet: IDispatch;
  1361.                                const objWbemAsyncContext: IDispatch); dispid 14;
  1362.     function Clone_: ISWbemObject; dispid 15;
  1363.     function GetObjectText_(iFlags: Integer): WideString; dispid 16;
  1364.     function SpawnDerivedClass_(iFlags: Integer): ISWbemObject; dispid 17;
  1365.     function SpawnInstance_(iFlags: Integer): ISWbemObject; dispid 18;
  1366.     function CompareTo_(const objWbemObject: IDispatch; iFlags: Integer): WordBool; dispid 19;
  1367.     property Qualifiers_: ISWbemQualifierSet readonly dispid 20;
  1368.     property Properties_: ISWbemPropertySet readonly dispid 21;
  1369.     property Methods_: ISWbemMethodSet readonly dispid 22;
  1370.     property Derivation_: OleVariant readonly dispid 23;
  1371.     property Path_: ISWbemObjectPath readonly dispid 24;
  1372.     property Security_: ISWbemSecurity readonly dispid 25;
  1373.   end;
  1374.  
  1375. // *********************************************************************//
  1376. // DispIntf:  ISWbemSinkEvents
  1377. // Flags:     (4240) Hidden NonExtensible Dispatchable
  1378. // GUID:      {75718CA0-F029-11D1-A1AC-00C04FB6C223}
  1379. // *********************************************************************//
  1380.   ISWbemSinkEvents = dispinterface
  1381.     ['{75718CA0-F029-11D1-A1AC-00C04FB6C223}']
  1382.     procedure OnObjectReady(const objWbemObject: ISWbemObject;
  1383.                             const objWbemAsyncContext: ISWbemNamedValueSet); dispid 1;
  1384.     procedure OnCompleted(iHResult: WbemErrorEnum; const objWbemErrorObject: ISWbemObject;
  1385.                           const objWbemAsyncContext: ISWbemNamedValueSet); dispid 2;
  1386.     procedure OnProgress(iUpperBound: Integer; iCurrent: Integer; const strMessage: WideString;
  1387.                          const objWbemAsyncContext: ISWbemNamedValueSet); dispid 3;
  1388.     procedure OnObjectPut(const objWbemObjectPath: ISWbemObjectPath;
  1389.                           const objWbemAsyncContext: ISWbemNamedValueSet); dispid 4;
  1390.   end;
  1391.  
  1392. // *********************************************************************//
  1393. // Interface: ISWbemSink
  1394. // Flags:     (4560) Hidden Dual NonExtensible OleAutomation Dispatchable
  1395. // GUID:      {75718C9F-F029-11D1-A1AC-00C04FB6C223}
  1396. // *********************************************************************//
  1397.   ISWbemSink = interface(IDispatch)
  1398.     ['{75718C9F-F029-11D1-A1AC-00C04FB6C223}']
  1399.     procedure Cancel; safecall;
  1400.   end;
  1401.  
  1402. // *********************************************************************//
  1403. // DispIntf:  ISWbemSinkDisp
  1404. // Flags:     (4560) Hidden Dual NonExtensible OleAutomation Dispatchable
  1405. // GUID:      {75718C9F-F029-11D1-A1AC-00C04FB6C223}
  1406. // *********************************************************************//
  1407.   ISWbemSinkDisp = dispinterface
  1408.     ['{75718C9F-F029-11D1-A1AC-00C04FB6C223}']
  1409.     procedure Cancel; dispid 1;
  1410.   end;
  1411.  
  1412. // *********************************************************************//
  1413. // Interface: ISWbemServicesEx
  1414. // Flags:     (4560) Hidden Dual NonExtensible OleAutomation Dispatchable
  1415. // GUID:      {D2F68443-85DC-427E-91D8-366554CC754C}
  1416. // *********************************************************************//
  1417.   ISWbemServicesEx = interface(ISWbemServices)
  1418.     ['{D2F68443-85DC-427E-91D8-366554CC754C}']
  1419.     function Put(const objWbemObject: ISWbemObjectEx; iFlags: Integer;
  1420.                  const objWbemNamedValueSet: IDispatch): ISWbemObjectPath; safecall;
  1421.     procedure PutAsync(const objWbemSink: ISWbemSink; const objWbemObject: ISWbemObjectEx;
  1422.                        iFlags: Integer; const objWbemNamedValueSet: IDispatch;
  1423.                        const objWbemAsyncContext: IDispatch); safecall;
  1424.   end;
  1425.  
  1426. // *********************************************************************//
  1427. // DispIntf:  ISWbemServicesExDisp
  1428. // Flags:     (4560) Hidden Dual NonExtensible OleAutomation Dispatchable
  1429. // GUID:      {D2F68443-85DC-427E-91D8-366554CC754C}
  1430. // *********************************************************************//
  1431.   ISWbemServicesExDisp = dispinterface
  1432.     ['{D2F68443-85DC-427E-91D8-366554CC754C}']
  1433.     function Put(const objWbemObject: ISWbemObjectEx; iFlags: Integer;
  1434.                  const objWbemNamedValueSet: IDispatch): ISWbemObjectPath; dispid 20;
  1435.     procedure PutAsync(const objWbemSink: ISWbemSink; const objWbemObject: ISWbemObjectEx;
  1436.                        iFlags: Integer; const objWbemNamedValueSet: IDispatch;
  1437.                        const objWbemAsyncContext: IDispatch); dispid 21;
  1438.     function Get(const strObjectPath: WideString; iFlags: Integer;
  1439.                  const objWbemNamedValueSet: IDispatch): ISWbemObject; dispid 1;
  1440.     procedure GetAsync(const objWbemSink: IDispatch; const strObjectPath: WideString;
  1441.                        iFlags: Integer; const objWbemNamedValueSet: IDispatch;
  1442.                        const objWbemAsyncContext: IDispatch); dispid 2;
  1443.     procedure Delete(const strObjectPath: WideString; iFlags: Integer;
  1444.                      const objWbemNamedValueSet: IDispatch); dispid 3;
  1445.     procedure DeleteAsync(const objWbemSink: IDispatch; const strObjectPath: WideString;
  1446.                           iFlags: Integer; const objWbemNamedValueSet: IDispatch;
  1447.                           const objWbemAsyncContext: IDispatch); dispid 4;
  1448.     function InstancesOf(const strClass: WideString; iFlags: Integer;
  1449.                          const objWbemNamedValueSet: IDispatch): ISWbemObjectSet; dispid 5;
  1450.     procedure InstancesOfAsync(const objWbemSink: IDispatch; const strClass: WideString;
  1451.                                iFlags: Integer; const objWbemNamedValueSet: IDispatch;
  1452.                                const objWbemAsyncContext: IDispatch); dispid 6;
  1453.     function SubclassesOf(const strSuperclass: WideString; iFlags: Integer;
  1454.                           const objWbemNamedValueSet: IDispatch): ISWbemObjectSet; dispid 7;
  1455.     procedure SubclassesOfAsync(const objWbemSink: IDispatch; const strSuperclass: WideString;
  1456.                                 iFlags: Integer; const objWbemNamedValueSet: IDispatch;
  1457.                                 const objWbemAsyncContext: IDispatch); dispid 8;
  1458.     function ExecQuery(const strQuery: WideString; const strQueryLanguage: WideString;
  1459.                        iFlags: Integer; const objWbemNamedValueSet: IDispatch): ISWbemObjectSet; dispid 9;
  1460.     procedure ExecQueryAsync(const objWbemSink: IDispatch; const strQuery: WideString;
  1461.                              const strQueryLanguage: WideString; lFlags: Integer;
  1462.                              const objWbemNamedValueSet: IDispatch;
  1463.                              const objWbemAsyncContext: IDispatch); dispid 10;
  1464.     function AssociatorsOf(const strObjectPath: WideString; const strAssocClass: WideString;
  1465.                            const strResultClass: WideString; const strResultRole: WideString;
  1466.                            const strRole: WideString; bClassesOnly: WordBool;
  1467.                            bSchemaOnly: WordBool; const strRequiredAssocQualifier: WideString;
  1468.                            const strRequiredQualifier: WideString; iFlags: Integer;
  1469.                            const objWbemNamedValueSet: IDispatch): ISWbemObjectSet; dispid 11;
  1470.     procedure AssociatorsOfAsync(const objWbemSink: IDispatch; const strObjectPath: WideString;
  1471.                                  const strAssocClass: WideString; const strResultClass: WideString;
  1472.                                  const strResultRole: WideString; const strRole: WideString;
  1473.                                  bClassesOnly: WordBool; bSchemaOnly: WordBool;
  1474.                                  const strRequiredAssocQualifier: WideString;
  1475.                                  const strRequiredQualifier: WideString; iFlags: Integer;
  1476.                                  const objWbemNamedValueSet: IDispatch;
  1477.                                  const objWbemAsyncContext: IDispatch); dispid 12;
  1478.     function ReferencesTo(const strObjectPath: WideString; const strResultClass: WideString;
  1479.                           const strRole: WideString; bClassesOnly: WordBool; bSchemaOnly: WordBool;
  1480.                           const strRequiredQualifier: WideString; iFlags: Integer;
  1481.                           const objWbemNamedValueSet: IDispatch): ISWbemObjectSet; dispid 13;
  1482.     procedure ReferencesToAsync(const objWbemSink: IDispatch; const strObjectPath: WideString;
  1483.                                 const strResultClass: WideString; const strRole: WideString;
  1484.                                 bClassesOnly: WordBool; bSchemaOnly: WordBool;
  1485.                                 const strRequiredQualifier: WideString; iFlags: Integer;
  1486.                                 const objWbemNamedValueSet: IDispatch;
  1487.                                 const objWbemAsyncContext: IDispatch); dispid 14;
  1488.     function ExecNotificationQuery(const strQuery: WideString; const strQueryLanguage: WideString;
  1489.                                    iFlags: Integer; const objWbemNamedValueSet: IDispatch): ISWbemEventSource; dispid 15;
  1490.     procedure ExecNotificationQueryAsync(const objWbemSink: IDispatch; const strQuery: WideString;
  1491.                                          const strQueryLanguage: WideString; iFlags: Integer;
  1492.                                          const objWbemNamedValueSet: IDispatch;
  1493.                                          const objWbemAsyncContext: IDispatch); dispid 16;
  1494.     function ExecMethod(const strObjectPath: WideString; const strMethodName: WideString;
  1495.                         const objWbemInParameters: IDispatch; iFlags: Integer;
  1496.                         const objWbemNamedValueSet: IDispatch): ISWbemObject; dispid 17;
  1497.     procedure ExecMethodAsync(const objWbemSink: IDispatch; const strObjectPath: WideString;
  1498.                               const strMethodName: WideString;
  1499.                               const objWbemInParameters: IDispatch; iFlags: Integer;
  1500.                               const objWbemNamedValueSet: IDispatch;
  1501.                               const objWbemAsyncContext: IDispatch); dispid 18;
  1502.     property Security_: ISWbemSecurity readonly dispid 19;
  1503.   end;
  1504.  
  1505. // *********************************************************************//
  1506. // Interface: ISWbemObjectEx
  1507. // Flags:     (4432) Hidden Dual OleAutomation Dispatchable
  1508. // GUID:      {269AD56A-8A67-4129-BC8C-0506DCFE9880}
  1509. // *********************************************************************//
  1510.   ISWbemObjectEx = interface(ISWbemObject)
  1511.     ['{269AD56A-8A67-4129-BC8C-0506DCFE9880}']
  1512.     procedure Refresh_(iFlags: Integer; const objWbemNamedValueSet: IDispatch); safecall;
  1513.     function Get_SystemProperties_: ISWbemPropertySet; safecall;
  1514.     function GetText_(iObjectTextFormat: WbemObjectTextFormatEnum; iFlags: Integer;
  1515.                       const objWbemNamedValueSet: IDispatch): WideString; safecall;
  1516.     procedure SetFromText_(const bsText: WideString; iObjectTextFormat: WbemObjectTextFormatEnum;
  1517.                            iFlags: Integer; const objWbemNamedValueSet: IDispatch); safecall;
  1518.     property SystemProperties_: ISWbemPropertySet read Get_SystemProperties_;
  1519.   end;
  1520.  
  1521. // *********************************************************************//
  1522. // DispIntf:  ISWbemObjectExDisp
  1523. // Flags:     (4432) Hidden Dual OleAutomation Dispatchable
  1524. // GUID:      {269AD56A-8A67-4129-BC8C-0506DCFE9880}
  1525. // *********************************************************************//
  1526.   ISWbemObjectExDisp = dispinterface
  1527.     ['{269AD56A-8A67-4129-BC8C-0506DCFE9880}']
  1528.     procedure Refresh_(iFlags: Integer; const objWbemNamedValueSet: IDispatch); dispid 26;
  1529.     property SystemProperties_: ISWbemPropertySet readonly dispid 27;
  1530.     function GetText_(iObjectTextFormat: WbemObjectTextFormatEnum; iFlags: Integer;
  1531.                       const objWbemNamedValueSet: IDispatch): WideString; dispid 28;
  1532.     procedure SetFromText_(const bsText: WideString; iObjectTextFormat: WbemObjectTextFormatEnum;
  1533.                            iFlags: Integer; const objWbemNamedValueSet: IDispatch); dispid 29;
  1534.     function Put_(iFlags: Integer; const objWbemNamedValueSet: IDispatch): ISWbemObjectPath; dispid 1;
  1535.     procedure PutAsync_(const objWbemSink: IDispatch; iFlags: Integer;
  1536.                         const objWbemNamedValueSet: IDispatch; const objWbemAsyncContext: IDispatch); dispid 2;
  1537.     procedure Delete_(iFlags: Integer; const objWbemNamedValueSet: IDispatch); dispid 3;
  1538.     procedure DeleteAsync_(const objWbemSink: IDispatch; iFlags: Integer;
  1539.                            const objWbemNamedValueSet: IDispatch;
  1540.                            const objWbemAsyncContext: IDispatch); dispid 4;
  1541.     function Instances_(iFlags: Integer; const objWbemNamedValueSet: IDispatch): ISWbemObjectSet; dispid 5;
  1542.     procedure InstancesAsync_(const objWbemSink: IDispatch; iFlags: Integer;
  1543.                               const objWbemNamedValueSet: IDispatch;
  1544.                               const objWbemAsyncContext: IDispatch); dispid 6;
  1545.     function Subclasses_(iFlags: Integer; const objWbemNamedValueSet: IDispatch): ISWbemObjectSet; dispid 7;
  1546.     procedure SubclassesAsync_(const objWbemSink: IDispatch; iFlags: Integer;
  1547.                                const objWbemNamedValueSet: IDispatch;
  1548.                                const objWbemAsyncContext: IDispatch); dispid 8;
  1549.     function Associators_(const strAssocClass: WideString; const strResultClass: WideString;
  1550.                           const strResultRole: WideString; const strRole: WideString;
  1551.                           bClassesOnly: WordBool; bSchemaOnly: WordBool;
  1552.                           const strRequiredAssocQualifier: WideString;
  1553.                           const strRequiredQualifier: WideString; iFlags: Integer;
  1554.                           const objWbemNamedValueSet: IDispatch): ISWbemObjectSet; dispid 9;
  1555.     procedure AssociatorsAsync_(const objWbemSink: IDispatch; const strAssocClass: WideString;
  1556.                                 const strResultClass: WideString; const strResultRole: WideString;
  1557.                                 const strRole: WideString; bClassesOnly: WordBool;
  1558.                                 bSchemaOnly: WordBool; const strRequiredAssocQualifier: WideString;
  1559.                                 const strRequiredQualifier: WideString; iFlags: Integer;
  1560.                                 const objWbemNamedValueSet: IDispatch;
  1561.                                 const objWbemAsyncContext: IDispatch); dispid 10;
  1562.     function References_(const strResultClass: WideString; const strRole: WideString;
  1563.                          bClassesOnly: WordBool; bSchemaOnly: WordBool;
  1564.                          const strRequiredQualifier: WideString; iFlags: Integer;
  1565.                          const objWbemNamedValueSet: IDispatch): ISWbemObjectSet; dispid 11;
  1566.     procedure ReferencesAsync_(const objWbemSink: IDispatch; const strResultClass: WideString;
  1567.                                const strRole: WideString; bClassesOnly: WordBool;
  1568.                                bSchemaOnly: WordBool; const strRequiredQualifier: WideString;
  1569.                                iFlags: Integer; const objWbemNamedValueSet: IDispatch;
  1570.                                const objWbemAsyncContext: IDispatch); dispid 12;
  1571.     function ExecMethod_(const strMethodName: WideString; const objWbemInParameters: IDispatch;
  1572.                          iFlags: Integer; const objWbemNamedValueSet: IDispatch): ISWbemObject; dispid 13;
  1573.     procedure ExecMethodAsync_(const objWbemSink: IDispatch; const strMethodName: WideString;
  1574.                                const objWbemInParameters: IDispatch; iFlags: Integer;
  1575.                                const objWbemNamedValueSet: IDispatch;
  1576.                                const objWbemAsyncContext: IDispatch); dispid 14;
  1577.     function Clone_: ISWbemObject; dispid 15;
  1578.     function GetObjectText_(iFlags: Integer): WideString; dispid 16;
  1579.     function SpawnDerivedClass_(iFlags: Integer): ISWbemObject; dispid 17;
  1580.     function SpawnInstance_(iFlags: Integer): ISWbemObject; dispid 18;
  1581.     function CompareTo_(const objWbemObject: IDispatch; iFlags: Integer): WordBool; dispid 19;
  1582.     property Qualifiers_: ISWbemQualifierSet readonly dispid 20;
  1583.     property Properties_: ISWbemPropertySet readonly dispid 21;
  1584.     property Methods_: ISWbemMethodSet readonly dispid 22;
  1585.     property Derivation_: OleVariant readonly dispid 23;
  1586.     property Path_: ISWbemObjectPath readonly dispid 24;
  1587.     property Security_: ISWbemSecurity readonly dispid 25;
  1588.   end;
  1589.  
  1590. // *********************************************************************//
  1591. // Interface: ISWbemDateTime
  1592. // Flags:     (4544) Dual NonExtensible OleAutomation Dispatchable
  1593. // GUID:      {5E97458A-CF77-11D3-B38F-00105A1F473A}
  1594. // *********************************************************************//
  1595.   ISWbemDateTime = interface(IDispatch)
  1596.     ['{5E97458A-CF77-11D3-B38F-00105A1F473A}']
  1597.     function Get_Value: WideString; safecall;
  1598.     procedure Set_Value(const strValue: WideString); safecall;
  1599.     function Get_Year: Integer; safecall;
  1600.     procedure Set_Year(iYear: Integer); safecall;
  1601.     function Get_YearSpecified: WordBool; safecall;
  1602.     procedure Set_YearSpecified(bYearSpecified: WordBool); safecall;
  1603.     function Get_Month: Integer; safecall;
  1604.     procedure Set_Month(iMonth: Integer); safecall;
  1605.     function Get_MonthSpecified: WordBool; safecall;
  1606.     procedure Set_MonthSpecified(bMonthSpecified: WordBool); safecall;
  1607.     function Get_Day: Integer; safecall;
  1608.     procedure Set_Day(iDay: Integer); safecall;
  1609.     function Get_DaySpecified: WordBool; safecall;
  1610.     procedure Set_DaySpecified(bDaySpecified: WordBool); safecall;
  1611.     function Get_Hours: Integer; safecall;
  1612.     procedure Set_Hours(iHours: Integer); safecall;
  1613.     function Get_HoursSpecified: WordBool; safecall;
  1614.     procedure Set_HoursSpecified(bHoursSpecified: WordBool); safecall;
  1615.     function Get_Minutes: Integer; safecall;
  1616.     procedure Set_Minutes(iMinutes: Integer); safecall;
  1617.     function Get_MinutesSpecified: WordBool; safecall;
  1618.     procedure Set_MinutesSpecified(bMinutesSpecified: WordBool); safecall;
  1619.     function Get_Seconds: Integer; safecall;
  1620.     procedure Set_Seconds(iSeconds: Integer); safecall;
  1621.     function Get_SecondsSpecified: WordBool; safecall;
  1622.     procedure Set_SecondsSpecified(bSecondsSpecified: WordBool); safecall;
  1623.     function Get_Microseconds: Integer; safecall;
  1624.     procedure Set_Microseconds(iMicroseconds: Integer); safecall;
  1625.     function Get_MicrosecondsSpecified: WordBool; safecall;
  1626.     procedure Set_MicrosecondsSpecified(bMicrosecondsSpecified: WordBool); safecall;
  1627.     function Get_UTC: Integer; safecall;
  1628.     procedure Set_UTC(iUTC: Integer); safecall;
  1629.     function Get_UTCSpecified: WordBool; safecall;
  1630.     procedure Set_UTCSpecified(bUTCSpecified: WordBool); safecall;
  1631.     function Get_IsInterval: WordBool; safecall;
  1632.     procedure Set_IsInterval(bIsInterval: WordBool); safecall;
  1633.     function GetVarDate(bIsLocal: WordBool): TDateTime; safecall;
  1634.     procedure SetVarDate(dVarDate: TDateTime; bIsLocal: WordBool); safecall;
  1635.     function GetFileTime(bIsLocal: WordBool): WideString; safecall;
  1636.     procedure SetFileTime(const strFileTime: WideString; bIsLocal: WordBool); safecall;
  1637.     property Value: WideString read Get_Value write Set_Value;
  1638.     property Year: Integer read Get_Year write Set_Year;
  1639.     property YearSpecified: WordBool read Get_YearSpecified write Set_YearSpecified;
  1640.     property Month: Integer read Get_Month write Set_Month;
  1641.     property MonthSpecified: WordBool read Get_MonthSpecified write Set_MonthSpecified;
  1642.     property Day: Integer read Get_Day write Set_Day;
  1643.     property DaySpecified: WordBool read Get_DaySpecified write Set_DaySpecified;
  1644.     property Hours: Integer read Get_Hours write Set_Hours;
  1645.     property HoursSpecified: WordBool read Get_HoursSpecified write Set_HoursSpecified;
  1646.     property Minutes: Integer read Get_Minutes write Set_Minutes;
  1647.     property MinutesSpecified: WordBool read Get_MinutesSpecified write Set_MinutesSpecified;
  1648.     property Seconds: Integer read Get_Seconds write Set_Seconds;
  1649.     property SecondsSpecified: WordBool read Get_SecondsSpecified write Set_SecondsSpecified;
  1650.     property Microseconds: Integer read Get_Microseconds write Set_Microseconds;
  1651.     property MicrosecondsSpecified: WordBool read Get_MicrosecondsSpecified write Set_MicrosecondsSpecified;
  1652.     property UTC: Integer read Get_UTC write Set_UTC;
  1653.     property UTCSpecified: WordBool read Get_UTCSpecified write Set_UTCSpecified;
  1654.     property IsInterval: WordBool read Get_IsInterval write Set_IsInterval;
  1655.   end;
  1656.  
  1657. // *********************************************************************//
  1658. // DispIntf:  ISWbemDateTimeDisp
  1659. // Flags:     (4544) Dual NonExtensible OleAutomation Dispatchable
  1660. // GUID:      {5E97458A-CF77-11D3-B38F-00105A1F473A}
  1661. // *********************************************************************//
  1662.   ISWbemDateTimeDisp = dispinterface
  1663.     ['{5E97458A-CF77-11D3-B38F-00105A1F473A}']
  1664.     property Value: WideString dispid 0;
  1665.     property Year: Integer dispid 1;
  1666.     property YearSpecified: WordBool dispid 2;
  1667.     property Month: Integer dispid 3;
  1668.     property MonthSpecified: WordBool dispid 4;
  1669.     property Day: Integer dispid 5;
  1670.     property DaySpecified: WordBool dispid 6;
  1671.     property Hours: Integer dispid 7;
  1672.     property HoursSpecified: WordBool dispid 8;
  1673.     property Minutes: Integer dispid 9;
  1674.     property MinutesSpecified: WordBool dispid 10;
  1675.     property Seconds: Integer dispid 11;
  1676.     property SecondsSpecified: WordBool dispid 12;
  1677.     property Microseconds: Integer dispid 13;
  1678.     property MicrosecondsSpecified: WordBool dispid 14;
  1679.     property UTC: Integer dispid 15;
  1680.     property UTCSpecified: WordBool dispid 16;
  1681.     property IsInterval: WordBool dispid 17;
  1682.     function GetVarDate(bIsLocal: WordBool): TDateTime; dispid 18;
  1683.     procedure SetVarDate(dVarDate: TDateTime; bIsLocal: WordBool); dispid 19;
  1684.     function GetFileTime(bIsLocal: WordBool): WideString; dispid 20;
  1685.     procedure SetFileTime(const strFileTime: WideString; bIsLocal: WordBool); dispid 21;
  1686.   end;
  1687.  
  1688. // *********************************************************************//
  1689. // Interface: ISWbemRefresher
  1690. // Flags:     (4544) Dual NonExtensible OleAutomation Dispatchable
  1691. // GUID:      {14D8250E-D9C2-11D3-B38F-00105A1F473A}
  1692. // *********************************************************************//
  1693.   ISWbemRefresher = interface(IDispatch)
  1694.     ['{14D8250E-D9C2-11D3-B38F-00105A1F473A}']
  1695.     function Get__NewEnum: IUnknown; safecall;
  1696.     function Item(iIndex: Integer): ISWbemRefreshableItem; safecall;
  1697.     function Get_Count: Integer; safecall;
  1698.     function Add(const objWbemServices: ISWbemServicesEx; const bsInstancePath: WideString;
  1699.                  iFlags: Integer; const objWbemNamedValueSet: IDispatch): ISWbemRefreshableItem; safecall;
  1700.     function AddEnum(const objWbemServices: ISWbemServicesEx; const bsClassName: WideString;
  1701.                      iFlags: Integer; const objWbemNamedValueSet: IDispatch): ISWbemRefreshableItem; safecall;
  1702.     procedure Remove(iIndex: Integer; iFlags: Integer); safecall;
  1703.     procedure Refresh(iFlags: Integer); safecall;
  1704.     function Get_AutoReconnect: WordBool; safecall;
  1705.     procedure Set_AutoReconnect(bCount: WordBool); safecall;
  1706.     procedure DeleteAll; safecall;
  1707.     property _NewEnum: IUnknown read Get__NewEnum;
  1708.     property Count: Integer read Get_Count;
  1709.     property AutoReconnect: WordBool read Get_AutoReconnect write Set_AutoReconnect;
  1710.   end;
  1711.  
  1712. // *********************************************************************//
  1713. // DispIntf:  ISWbemRefresherDisp
  1714. // Flags:     (4544) Dual NonExtensible OleAutomation Dispatchable
  1715. // GUID:      {14D8250E-D9C2-11D3-B38F-00105A1F473A}
  1716. // *********************************************************************//
  1717.   ISWbemRefresherDisp = dispinterface
  1718.     ['{14D8250E-D9C2-11D3-B38F-00105A1F473A}']
  1719.     property _NewEnum: IUnknown readonly dispid -4;
  1720.     function Item(iIndex: Integer): ISWbemRefreshableItem; dispid 0;
  1721.     property Count: Integer readonly dispid 1;
  1722.     function Add(const objWbemServices: ISWbemServicesEx; const bsInstancePath: WideString;
  1723.                  iFlags: Integer; const objWbemNamedValueSet: IDispatch): ISWbemRefreshableItem; dispid 2;
  1724.     function AddEnum(const objWbemServices: ISWbemServicesEx; const bsClassName: WideString;
  1725.                      iFlags: Integer; const objWbemNamedValueSet: IDispatch): ISWbemRefreshableItem; dispid 3;
  1726.     procedure Remove(iIndex: Integer; iFlags: Integer); dispid 4;
  1727.     procedure Refresh(iFlags: Integer); dispid 5;
  1728.     property AutoReconnect: WordBool dispid 6;
  1729.     procedure DeleteAll; dispid 7;
  1730.   end;
  1731.  
  1732. // *********************************************************************//
  1733. // Interface: ISWbemRefreshableItem
  1734. // Flags:     (4544) Dual NonExtensible OleAutomation Dispatchable
  1735. // GUID:      {5AD4BF92-DAAB-11D3-B38F-00105A1F473A}
  1736. // *********************************************************************//
  1737.   ISWbemRefreshableItem = interface(IDispatch)
  1738.     ['{5AD4BF92-DAAB-11D3-B38F-00105A1F473A}']
  1739.     function Get_Index: Integer; safecall;
  1740.     function Get_Refresher: ISWbemRefresher; safecall;
  1741.     function Get_IsSet: WordBool; safecall;
  1742.     function Get_Object_: ISWbemObjectEx; safecall;
  1743.     function Get_ObjectSet: ISWbemObjectSet; safecall;
  1744.     procedure Remove(iFlags: Integer); safecall;
  1745.     property Index: Integer read Get_Index;
  1746.     property Refresher: ISWbemRefresher read Get_Refresher;
  1747.     property IsSet: WordBool read Get_IsSet;
  1748.     property Object_: ISWbemObjectEx read Get_Object_;
  1749.     property ObjectSet: ISWbemObjectSet read Get_ObjectSet;
  1750.   end;
  1751.  
  1752. // *********************************************************************//
  1753. // DispIntf:  ISWbemRefreshableItemDisp
  1754. // Flags:     (4544) Dual NonExtensible OleAutomation Dispatchable
  1755. // GUID:      {5AD4BF92-DAAB-11D3-B38F-00105A1F473A}
  1756. // *********************************************************************//
  1757.   ISWbemRefreshableItemDisp = dispinterface
  1758.     ['{5AD4BF92-DAAB-11D3-B38F-00105A1F473A}']
  1759.     property Index: Integer readonly dispid 1;
  1760.     property Refresher: ISWbemRefresher readonly dispid 2;
  1761.     property IsSet: WordBool readonly dispid 3;
  1762.     property Object_: ISWbemObjectEx readonly dispid 4;
  1763.     property ObjectSet: ISWbemObjectSet readonly dispid 5;
  1764.     procedure Remove(iFlags: Integer); dispid 6;
  1765.   end;
  1766.  
  1767. // *********************************************************************//
  1768. // The Class CoSWbemLocator provides a Create and CreateRemote method to
  1769. // create instances of the default interface ISWbemLocator exposed by
  1770. // the CoClass SWbemLocator. The functions are intended to be used by
  1771. // clients wishing to automate the CoClass objects exposed by the
  1772. // server of this typelibrary.
  1773. // *********************************************************************//
  1774.   CoSWbemLocator = class
  1775.     class function Create: ISWbemLocator;
  1776.     class function CreateRemote(const MachineName: string): ISWbemLocator;
  1777.   end;
  1778.  
  1779.  
  1780. // *********************************************************************//
  1781. // OLE Server Proxy class declaration
  1782. // Server Object    : TSWbemLocator
  1783. // Help String      : Used to obtain Namespace connections
  1784. // Default Interface: ISWbemLocator
  1785. // Def. Intf. DISP? : No
  1786. // Event   Interface:
  1787. // TypeFlags        : (2) CanCreate
  1788. // *********************************************************************//
  1789. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  1790.   TSWbemLocatorProperties= class;
  1791. {$ENDIF}
  1792.   TSWbemLocator = class(TOleServer)
  1793.   private
  1794.     FIntf:        ISWbemLocator;
  1795. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  1796.     FProps:       TSWbemLocatorProperties;
  1797.     function      GetServerProperties: TSWbemLocatorProperties;
  1798. {$ENDIF}
  1799.     function      GetDefaultInterface: ISWbemLocator;
  1800.   protected
  1801.     procedure InitServerData; override;
  1802.     function Get_Security_: ISWbemSecurity;
  1803.   public
  1804.     constructor Create(AOwner: TComponent); override;
  1805.     destructor  Destroy; override;
  1806.     procedure Connect; override;
  1807.     procedure ConnectTo(svrIntf: ISWbemLocator);
  1808.     procedure Disconnect; override;
  1809.     function ConnectServer(const strServer: WideString; const strNamespace: WideString;
  1810.                            const strUser: WideString; const strPassword: WideString;
  1811.                            const strLocale: WideString; const strAuthority: WideString;
  1812.                            iSecurityFlags: Integer; const objWbemNamedValueSet: IDispatch): ISWbemServices;
  1813.     property DefaultInterface: ISWbemLocator read GetDefaultInterface;
  1814.     property Security_: ISWbemSecurity read Get_Security_;
  1815.   published
  1816. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  1817.     property Server: TSWbemLocatorProperties read GetServerProperties;
  1818. {$ENDIF}
  1819.   end;
  1820.  
  1821. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  1822. // *********************************************************************//
  1823. // OLE Server Properties Proxy Class
  1824. // Server Object    : TSWbemLocator
  1825. // (This object is used by the IDE's Property Inspector to allow editing
  1826. //  of the properties of this server)
  1827. // *********************************************************************//
  1828.  TSWbemLocatorProperties = class(TPersistent)
  1829.   private
  1830.     FServer:    TSWbemLocator;
  1831.     function    GetDefaultInterface: ISWbemLocator;
  1832.     constructor Create(AServer: TSWbemLocator);
  1833.   protected
  1834.     function Get_Security_: ISWbemSecurity;
  1835.   public
  1836.     property DefaultInterface: ISWbemLocator read GetDefaultInterface;
  1837.   published
  1838.   end;
  1839. {$ENDIF}
  1840.  
  1841.  
  1842. // *********************************************************************//
  1843. // The Class CoSWbemNamedValueSet provides a Create and CreateRemote method to
  1844. // create instances of the default interface ISWbemNamedValueSet exposed by
  1845. // the CoClass SWbemNamedValueSet. The functions are intended to be used by
  1846. // clients wishing to automate the CoClass objects exposed by the
  1847. // server of this typelibrary.
  1848. // *********************************************************************//
  1849.   CoSWbemNamedValueSet = class
  1850.     class function Create: ISWbemNamedValueSet;
  1851.     class function CreateRemote(const MachineName: string): ISWbemNamedValueSet;
  1852.   end;
  1853.  
  1854.  
  1855. // *********************************************************************//
  1856. // OLE Server Proxy class declaration
  1857. // Server Object    : TSWbemNamedValueSet
  1858. // Help String      : A collection of Named Values
  1859. // Default Interface: ISWbemNamedValueSet
  1860. // Def. Intf. DISP? : No
  1861. // Event   Interface:
  1862. // TypeFlags        : (2) CanCreate
  1863. // *********************************************************************//
  1864. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  1865.   TSWbemNamedValueSetProperties= class;
  1866. {$ENDIF}
  1867.   TSWbemNamedValueSet = class(TOleServer)
  1868.   private
  1869.     FIntf:        ISWbemNamedValueSet;
  1870. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  1871.     FProps:       TSWbemNamedValueSetProperties;
  1872.     function      GetServerProperties: TSWbemNamedValueSetProperties;
  1873. {$ENDIF}
  1874.     function      GetDefaultInterface: ISWbemNamedValueSet;
  1875.   protected
  1876.     procedure InitServerData; override;
  1877.     function Get_Count: Integer;
  1878.   public
  1879.     constructor Create(AOwner: TComponent); override;
  1880.     destructor  Destroy; override;
  1881.     procedure Connect; override;
  1882.     procedure ConnectTo(svrIntf: ISWbemNamedValueSet);
  1883.     procedure Disconnect; override;
  1884.     function Item(const strName: WideString; iFlags: Integer): ISWbemNamedValue;
  1885.     function Add(const strName: WideString; var varValue: OleVariant; iFlags: Integer): ISWbemNamedValue;
  1886.     procedure Remove(const strName: WideString; iFlags: Integer);
  1887.     function Clone: ISWbemNamedValueSet;
  1888.     procedure DeleteAll;
  1889.     property DefaultInterface: ISWbemNamedValueSet read GetDefaultInterface;
  1890.     property Count: Integer read Get_Count;
  1891.   published
  1892. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  1893.     property Server: TSWbemNamedValueSetProperties read GetServerProperties;
  1894. {$ENDIF}
  1895.   end;
  1896.  
  1897. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  1898. // *********************************************************************//
  1899. // OLE Server Properties Proxy Class
  1900. // Server Object    : TSWbemNamedValueSet
  1901. // (This object is used by the IDE's Property Inspector to allow editing
  1902. //  of the properties of this server)
  1903. // *********************************************************************//
  1904.  TSWbemNamedValueSetProperties = class(TPersistent)
  1905.   private
  1906.     FServer:    TSWbemNamedValueSet;
  1907.     function    GetDefaultInterface: ISWbemNamedValueSet;
  1908.     constructor Create(AServer: TSWbemNamedValueSet);
  1909.   protected
  1910.     function Get_Count: Integer;
  1911.   public
  1912.     property DefaultInterface: ISWbemNamedValueSet read GetDefaultInterface;
  1913.   published
  1914.   end;
  1915. {$ENDIF}
  1916.  
  1917.  
  1918. // *********************************************************************//
  1919. // The Class CoSWbemObjectPath provides a Create and CreateRemote method to
  1920. // create instances of the default interface ISWbemObjectPath exposed by
  1921. // the CoClass SWbemObjectPath. The functions are intended to be used by
  1922. // clients wishing to automate the CoClass objects exposed by the
  1923. // server of this typelibrary.
  1924. // *********************************************************************//
  1925.   CoSWbemObjectPath = class
  1926.     class function Create: ISWbemObjectPath;
  1927.     class function CreateRemote(const MachineName: string): ISWbemObjectPath;
  1928.   end;
  1929.  
  1930.  
  1931. // *********************************************************************//
  1932. // OLE Server Proxy class declaration
  1933. // Server Object    : TSWbemObjectPath
  1934. // Help String      : Object Path
  1935. // Default Interface: ISWbemObjectPath
  1936. // Def. Intf. DISP? : No
  1937. // Event   Interface:
  1938. // TypeFlags        : (2) CanCreate
  1939. // *********************************************************************//
  1940. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  1941.   TSWbemObjectPathProperties= class;
  1942. {$ENDIF}
  1943.   TSWbemObjectPath = class(TOleServer)
  1944.   private
  1945.     FIntf:        ISWbemObjectPath;
  1946. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  1947.     FProps:       TSWbemObjectPathProperties;
  1948.     function      GetServerProperties: TSWbemObjectPathProperties;
  1949. {$ENDIF}
  1950.     function      GetDefaultInterface: ISWbemObjectPath;
  1951.   protected
  1952.     procedure InitServerData; override;
  1953.     function Get_Path: WideString;
  1954.     procedure Set_Path(const strPath: WideString);
  1955.     function Get_RelPath: WideString;
  1956.     procedure Set_RelPath(const strRelPath: WideString);
  1957.     function Get_Server: WideString;
  1958.     procedure Set_Server(const strServer: WideString);
  1959.     function Get_Namespace: WideString;
  1960.     procedure Set_Namespace(const strNamespace: WideString);
  1961.     function Get_ParentNamespace: WideString;
  1962.     function Get_DisplayName: WideString;
  1963.     procedure Set_DisplayName(const strDisplayName: WideString);
  1964.     function Get_Class_: WideString;
  1965.     procedure Set_Class_(const strClass: WideString);
  1966.     function Get_IsClass: WordBool;
  1967.     function Get_IsSingleton: WordBool;
  1968.     function Get_Keys: ISWbemNamedValueSet;
  1969.     function Get_Security_: ISWbemSecurity;
  1970.     function Get_Locale: WideString;
  1971.     procedure Set_Locale(const strLocale: WideString);
  1972.     function Get_Authority: WideString;
  1973.     procedure Set_Authority(const strAuthority: WideString);
  1974.   public
  1975.     constructor Create(AOwner: TComponent); override;
  1976.     destructor  Destroy; override;
  1977.     procedure Connect; override;
  1978.     procedure ConnectTo(svrIntf: ISWbemObjectPath);
  1979.     procedure Disconnect; override;
  1980.     procedure SetAsClass;
  1981.     procedure SetAsSingleton;
  1982.     property DefaultInterface: ISWbemObjectPath read GetDefaultInterface;
  1983.     property ParentNamespace: WideString read Get_ParentNamespace;
  1984.     property IsClass: WordBool read Get_IsClass;
  1985.     property IsSingleton: WordBool read Get_IsSingleton;
  1986.     property Keys: ISWbemNamedValueSet read Get_Keys;
  1987.     property Security_: ISWbemSecurity read Get_Security_;
  1988.     property Path: WideString read Get_Path write Set_Path;
  1989.     property RelPath: WideString read Get_RelPath write Set_RelPath;
  1990.     property Server: WideString read Get_Server write Set_Server;
  1991.     property Namespace: WideString read Get_Namespace write Set_Namespace;
  1992.     property DisplayName: WideString read Get_DisplayName write Set_DisplayName;
  1993.     property Class_: WideString read Get_Class_ write Set_Class_;
  1994.     property Locale: WideString read Get_Locale write Set_Locale;
  1995.     property Authority: WideString read Get_Authority write Set_Authority;
  1996.   published
  1997. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  1998.     property Server: TSWbemObjectPathProperties read GetServerProperties;
  1999. {$ENDIF}
  2000.   end;
  2001.  
  2002. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  2003. // *********************************************************************//
  2004. // OLE Server Properties Proxy Class
  2005. // Server Object    : TSWbemObjectPath
  2006. // (This object is used by the IDE's Property Inspector to allow editing
  2007. //  of the properties of this server)
  2008. // *********************************************************************//
  2009.  TSWbemObjectPathProperties = class(TPersistent)
  2010.   private
  2011.     FServer:    TSWbemObjectPath;
  2012.     function    GetDefaultInterface: ISWbemObjectPath;
  2013.     constructor Create(AServer: TSWbemObjectPath);
  2014.   protected
  2015.     function Get_Path: WideString;
  2016.     procedure Set_Path(const strPath: WideString);
  2017.     function Get_RelPath: WideString;
  2018.     procedure Set_RelPath(const strRelPath: WideString);
  2019.     function Get_Server: WideString;
  2020.     procedure Set_Server(const strServer: WideString);
  2021.     function Get_Namespace: WideString;
  2022.     procedure Set_Namespace(const strNamespace: WideString);
  2023.     function Get_ParentNamespace: WideString;
  2024.     function Get_DisplayName: WideString;
  2025.     procedure Set_DisplayName(const strDisplayName: WideString);
  2026.     function Get_Class_: WideString;
  2027.     procedure Set_Class_(const strClass: WideString);
  2028.     function Get_IsClass: WordBool;
  2029.     function Get_IsSingleton: WordBool;
  2030.     function Get_Keys: ISWbemNamedValueSet;
  2031.     function Get_Security_: ISWbemSecurity;
  2032.     function Get_Locale: WideString;
  2033.     procedure Set_Locale(const strLocale: WideString);
  2034.     function Get_Authority: WideString;
  2035.     procedure Set_Authority(const strAuthority: WideString);
  2036.   public
  2037.     property DefaultInterface: ISWbemObjectPath read GetDefaultInterface;
  2038.   published
  2039.     property Path: WideString read Get_Path write Set_Path;
  2040.     property RelPath: WideString read Get_RelPath write Set_RelPath;
  2041.     property Server: WideString read Get_Server write Set_Server;
  2042.     property Namespace: WideString read Get_Namespace write Set_Namespace;
  2043.     property DisplayName: WideString read Get_DisplayName write Set_DisplayName;
  2044.     property Class_: WideString read Get_Class_ write Set_Class_;
  2045.     property Locale: WideString read Get_Locale write Set_Locale;
  2046.     property Authority: WideString read Get_Authority write Set_Authority;
  2047.   end;
  2048. {$ENDIF}
  2049.  
  2050.  
  2051. // *********************************************************************//
  2052. // The Class CoSWbemLastError provides a Create and CreateRemote method to
  2053. // create instances of the default interface ISWbemLastError exposed by
  2054. // the CoClass SWbemLastError. The functions are intended to be used by
  2055. // clients wishing to automate the CoClass objects exposed by the
  2056. // server of this typelibrary.
  2057. // *********************************************************************//
  2058.   CoSWbemLastError = class
  2059.     class function Create: ISWbemLastError;
  2060.     class function CreateRemote(const MachineName: string): ISWbemLastError;
  2061.   end;
  2062.  
  2063.  
  2064. // *********************************************************************//
  2065. // OLE Server Proxy class declaration
  2066. // Server Object    : TSWbemLastError
  2067. // Help String      : The last error on the current thread
  2068. // Default Interface: ISWbemLastError
  2069. // Def. Intf. DISP? : No
  2070. // Event   Interface:
  2071. // TypeFlags        : (2) CanCreate
  2072. // *********************************************************************//
  2073. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  2074.   TSWbemLastErrorProperties= class;
  2075. {$ENDIF}
  2076.   TSWbemLastError = class(TOleServer)
  2077.   private
  2078.     FIntf:        ISWbemLastError;
  2079. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  2080.     FProps:       TSWbemLastErrorProperties;
  2081.     function      GetServerProperties: TSWbemLastErrorProperties;
  2082. {$ENDIF}
  2083.     function      GetDefaultInterface: ISWbemLastError;
  2084.   protected
  2085.     procedure InitServerData; override;
  2086.     function Get_Qualifiers_: ISWbemQualifierSet;
  2087.     function Get_Properties_: ISWbemPropertySet;
  2088.     function Get_Methods_: ISWbemMethodSet;
  2089.     function Get_Derivation_: OleVariant;
  2090.     function Get_Path_: ISWbemObjectPath;
  2091.     function Get_Security_: ISWbemSecurity;
  2092.   public
  2093.     constructor Create(AOwner: TComponent); override;
  2094.     destructor  Destroy; override;
  2095.     procedure Connect; override;
  2096.     procedure ConnectTo(svrIntf: ISWbemLastError);
  2097.     procedure Disconnect; override;
  2098.     function Put_(iFlags: Integer; const objWbemNamedValueSet: IDispatch): ISWbemObjectPath;
  2099.     procedure PutAsync_(const objWbemSink: IDispatch; iFlags: Integer;
  2100.                         const objWbemNamedValueSet: IDispatch; const objWbemAsyncContext: IDispatch);
  2101.     procedure Delete_(iFlags: Integer; const objWbemNamedValueSet: IDispatch);
  2102.     procedure DeleteAsync_(const objWbemSink: IDispatch; iFlags: Integer;
  2103.                            const objWbemNamedValueSet: IDispatch;
  2104.                            const objWbemAsyncContext: IDispatch);
  2105.     function Instances_(iFlags: Integer; const objWbemNamedValueSet: IDispatch): ISWbemObjectSet;
  2106.     procedure InstancesAsync_(const objWbemSink: IDispatch; iFlags: Integer;
  2107.                               const objWbemNamedValueSet: IDispatch;
  2108.                               const objWbemAsyncContext: IDispatch);
  2109.     function Subclasses_(iFlags: Integer; const objWbemNamedValueSet: IDispatch): ISWbemObjectSet;
  2110.     procedure SubclassesAsync_(const objWbemSink: IDispatch; iFlags: Integer;
  2111.                                const objWbemNamedValueSet: IDispatch;
  2112.                                const objWbemAsyncContext: IDispatch);
  2113.     function Associators_(const strAssocClass: WideString; const strResultClass: WideString;
  2114.                           const strResultRole: WideString; const strRole: WideString;
  2115.                           bClassesOnly: WordBool; bSchemaOnly: WordBool;
  2116.                           const strRequiredAssocQualifier: WideString;
  2117.                           const strRequiredQualifier: WideString; iFlags: Integer;
  2118.                           const objWbemNamedValueSet: IDispatch): ISWbemObjectSet;
  2119.     procedure AssociatorsAsync_(const objWbemSink: IDispatch; const strAssocClass: WideString;
  2120.                                 const strResultClass: WideString; const strResultRole: WideString;
  2121.                                 const strRole: WideString; bClassesOnly: WordBool;
  2122.                                 bSchemaOnly: WordBool; const strRequiredAssocQualifier: WideString;
  2123.                                 const strRequiredQualifier: WideString; iFlags: Integer;
  2124.                                 const objWbemNamedValueSet: IDispatch;
  2125.                                 const objWbemAsyncContext: IDispatch);
  2126.     function References_(const strResultClass: WideString; const strRole: WideString;
  2127.                          bClassesOnly: WordBool; bSchemaOnly: WordBool;
  2128.                          const strRequiredQualifier: WideString; iFlags: Integer;
  2129.                          const objWbemNamedValueSet: IDispatch): ISWbemObjectSet;
  2130.     procedure ReferencesAsync_(const objWbemSink: IDispatch; const strResultClass: WideString;
  2131.                                const strRole: WideString; bClassesOnly: WordBool;
  2132.                                bSchemaOnly: WordBool; const strRequiredQualifier: WideString;
  2133.                                iFlags: Integer; const objWbemNamedValueSet: IDispatch;
  2134.                                const objWbemAsyncContext: IDispatch);
  2135.     function ExecMethod_(const strMethodName: WideString; const objWbemInParameters: IDispatch;
  2136.                          iFlags: Integer; const objWbemNamedValueSet: IDispatch): ISWbemObject;
  2137.     procedure ExecMethodAsync_(const objWbemSink: IDispatch; const strMethodName: WideString;
  2138.                                const objWbemInParameters: IDispatch; iFlags: Integer;
  2139.                                const objWbemNamedValueSet: IDispatch;
  2140.                                const objWbemAsyncContext: IDispatch);
  2141.     function Clone_: ISWbemObject;
  2142.     function GetObjectText_(iFlags: Integer): WideString;
  2143.     function SpawnDerivedClass_(iFlags: Integer): ISWbemObject;
  2144.     function SpawnInstance_(iFlags: Integer): ISWbemObject;
  2145.     function CompareTo_(const objWbemObject: IDispatch; iFlags: Integer): WordBool;
  2146.     property DefaultInterface: ISWbemLastError read GetDefaultInterface;
  2147.     property Qualifiers_: ISWbemQualifierSet read Get_Qualifiers_;
  2148.     property Properties_: ISWbemPropertySet read Get_Properties_;
  2149.     property Methods_: ISWbemMethodSet read Get_Methods_;
  2150.     property Derivation_: OleVariant read Get_Derivation_;
  2151.     property Path_: ISWbemObjectPath read Get_Path_;
  2152.     property Security_: ISWbemSecurity read Get_Security_;
  2153.   published
  2154. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  2155.     property Server: TSWbemLastErrorProperties read GetServerProperties;
  2156. {$ENDIF}
  2157.   end;
  2158.  
  2159. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  2160. // *********************************************************************//
  2161. // OLE Server Properties Proxy Class
  2162. // Server Object    : TSWbemLastError
  2163. // (This object is used by the IDE's Property Inspector to allow editing
  2164. //  of the properties of this server)
  2165. // *********************************************************************//
  2166.  TSWbemLastErrorProperties = class(TPersistent)
  2167.   private
  2168.     FServer:    TSWbemLastError;
  2169.     function    GetDefaultInterface: ISWbemLastError;
  2170.     constructor Create(AServer: TSWbemLastError);
  2171.   protected
  2172.     function Get_Qualifiers_: ISWbemQualifierSet;
  2173.     function Get_Properties_: ISWbemPropertySet;
  2174.     function Get_Methods_: ISWbemMethodSet;
  2175.     function Get_Derivation_: OleVariant;
  2176.     function Get_Path_: ISWbemObjectPath;
  2177.     function Get_Security_: ISWbemSecurity;
  2178.   public
  2179.     property DefaultInterface: ISWbemLastError read GetDefaultInterface;
  2180.   published
  2181.   end;
  2182. {$ENDIF}
  2183.  
  2184.  
  2185. // *********************************************************************//
  2186. // The Class CoSWbemSink provides a Create and CreateRemote method to
  2187. // create instances of the default interface ISWbemSink exposed by
  2188. // the CoClass SWbemSink. The functions are intended to be used by
  2189. // clients wishing to automate the CoClass objects exposed by the
  2190. // server of this typelibrary.
  2191. // *********************************************************************//
  2192.   CoSWbemSink = class
  2193.     class function Create: ISWbemSink;
  2194.     class function CreateRemote(const MachineName: string): ISWbemSink;
  2195.   end;
  2196.  
  2197.   TSWbemSinkOnObjectReady = procedure(Sender: TObject; var objWbemObject: OleVariant;
  2198.                                                        var objWbemAsyncContext: OleVariant) of object;
  2199.   TSWbemSinkOnCompleted = procedure(Sender: TObject; iHResult: WbemErrorEnum;
  2200.                                                      var objWbemErrorObject: OleVariant;
  2201.                                                      var objWbemAsyncContext: OleVariant) of object;
  2202.   TSWbemSinkOnProgress = procedure(Sender: TObject; iUpperBound: Integer; iCurrent: Integer;
  2203.                                                     var strMessage: OleVariant;
  2204.                                                     var objWbemAsyncContext: OleVariant) of object;
  2205.   TSWbemSinkOnObjectPut = procedure(Sender: TObject; var objWbemObjectPath: OleVariant;
  2206.                                                      var objWbemAsyncContext: OleVariant) of object;
  2207.  
  2208.  
  2209. // *********************************************************************//
  2210. // OLE Server Proxy class declaration
  2211. // Server Object    : TSWbemSink
  2212. // Help String      : A sink for events arising from asynchronous operations
  2213. // Default Interface: ISWbemSink
  2214. // Def. Intf. DISP? : No
  2215. // Event   Interface: ISWbemSinkEvents
  2216. // TypeFlags        : (2) CanCreate
  2217. // *********************************************************************//
  2218. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  2219.   TSWbemSinkProperties= class;
  2220. {$ENDIF}
  2221.   TSWbemSink = class(TOleServer)
  2222.   private
  2223.     FOnObjectReady: TSWbemSinkOnObjectReady;
  2224.     FOnCompleted: TSWbemSinkOnCompleted;
  2225.     FOnProgress: TSWbemSinkOnProgress;
  2226.     FOnObjectPut: TSWbemSinkOnObjectPut;
  2227.     FIntf:        ISWbemSink;
  2228. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  2229.     FProps:       TSWbemSinkProperties;
  2230.     function      GetServerProperties: TSWbemSinkProperties;
  2231. {$ENDIF}
  2232.     function      GetDefaultInterface: ISWbemSink;
  2233.   protected
  2234.     procedure InitServerData; override;
  2235.     procedure InvokeEvent(DispID: TDispID; var Params: TVariantArray); override;
  2236.   public
  2237.     constructor Create(AOwner: TComponent); override;
  2238.     destructor  Destroy; override;
  2239.     procedure Connect; override;
  2240.     procedure ConnectTo(svrIntf: ISWbemSink);
  2241.     procedure Disconnect; override;
  2242.     procedure Cancel;
  2243.     property DefaultInterface: ISWbemSink read GetDefaultInterface;
  2244.   published
  2245. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  2246.     property Server: TSWbemSinkProperties read GetServerProperties;
  2247. {$ENDIF}
  2248.     property OnObjectReady: TSWbemSinkOnObjectReady read FOnObjectReady write FOnObjectReady;
  2249.     property OnCompleted: TSWbemSinkOnCompleted read FOnCompleted write FOnCompleted;
  2250.     property OnProgress: TSWbemSinkOnProgress read FOnProgress write FOnProgress;
  2251.     property OnObjectPut: TSWbemSinkOnObjectPut read FOnObjectPut write FOnObjectPut;
  2252.   end;
  2253.  
  2254. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  2255. // *********************************************************************//
  2256. // OLE Server Properties Proxy Class
  2257. // Server Object    : TSWbemSink
  2258. // (This object is used by the IDE's Property Inspector to allow editing
  2259. //  of the properties of this server)
  2260. // *********************************************************************//
  2261.  TSWbemSinkProperties = class(TPersistent)
  2262.   private
  2263.     FServer:    TSWbemSink;
  2264.     function    GetDefaultInterface: ISWbemSink;
  2265.     constructor Create(AServer: TSWbemSink);
  2266.   protected
  2267.   public
  2268.     property DefaultInterface: ISWbemSink read GetDefaultInterface;
  2269.   published
  2270.   end;
  2271. {$ENDIF}
  2272.  
  2273.  
  2274. // *********************************************************************//
  2275. // The Class CoSWbemDateTime provides a Create and CreateRemote method to
  2276. // create instances of the default interface ISWbemDateTime exposed by
  2277. // the CoClass SWbemDateTime. The functions are intended to be used by
  2278. // clients wishing to automate the CoClass objects exposed by the
  2279. // server of this typelibrary.
  2280. // *********************************************************************//
  2281.   CoSWbemDateTime = class
  2282.     class function Create: ISWbemDateTime;
  2283.     class function CreateRemote(const MachineName: string): ISWbemDateTime;
  2284.   end;
  2285.  
  2286.  
  2287. // *********************************************************************//
  2288. // OLE Server Proxy class declaration
  2289. // Server Object    : TSWbemDateTime
  2290. // Help String      : Date & Time
  2291. // Default Interface: ISWbemDateTime
  2292. // Def. Intf. DISP? : No
  2293. // Event   Interface:
  2294. // TypeFlags        : (2) CanCreate
  2295. // *********************************************************************//
  2296. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  2297.   TSWbemDateTimeProperties= class;
  2298. {$ENDIF}
  2299.   TSWbemDateTime = class(TOleServer)
  2300.   private
  2301.     FIntf:        ISWbemDateTime;
  2302. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  2303.     FProps:       TSWbemDateTimeProperties;
  2304.     function      GetServerProperties: TSWbemDateTimeProperties;
  2305. {$ENDIF}
  2306.     function      GetDefaultInterface: ISWbemDateTime;
  2307.   protected
  2308.     procedure InitServerData; override;
  2309.     function Get_Value: WideString;
  2310.     procedure Set_Value(const strValue: WideString);
  2311.     function Get_Year: Integer;
  2312.     procedure Set_Year(iYear: Integer);
  2313.     function Get_YearSpecified: WordBool;
  2314.     procedure Set_YearSpecified(bYearSpecified: WordBool);
  2315.     function Get_Month: Integer;
  2316.     procedure Set_Month(iMonth: Integer);
  2317.     function Get_MonthSpecified: WordBool;
  2318.     procedure Set_MonthSpecified(bMonthSpecified: WordBool);
  2319.     function Get_Day: Integer;
  2320.     procedure Set_Day(iDay: Integer);
  2321.     function Get_DaySpecified: WordBool;
  2322.     procedure Set_DaySpecified(bDaySpecified: WordBool);
  2323.     function Get_Hours: Integer;
  2324.     procedure Set_Hours(iHours: Integer);
  2325.     function Get_HoursSpecified: WordBool;
  2326.     procedure Set_HoursSpecified(bHoursSpecified: WordBool);
  2327.     function Get_Minutes: Integer;
  2328.     procedure Set_Minutes(iMinutes: Integer);
  2329.     function Get_MinutesSpecified: WordBool;
  2330.     procedure Set_MinutesSpecified(bMinutesSpecified: WordBool);
  2331.     function Get_Seconds: Integer;
  2332.     procedure Set_Seconds(iSeconds: Integer);
  2333.     function Get_SecondsSpecified: WordBool;
  2334.     procedure Set_SecondsSpecified(bSecondsSpecified: WordBool);
  2335.     function Get_Microseconds: Integer;
  2336.     procedure Set_Microseconds(iMicroseconds: Integer);
  2337.     function Get_MicrosecondsSpecified: WordBool;
  2338.     procedure Set_MicrosecondsSpecified(bMicrosecondsSpecified: WordBool);
  2339.     function Get_UTC: Integer;
  2340.     procedure Set_UTC(iUTC: Integer);
  2341.     function Get_UTCSpecified: WordBool;
  2342.     procedure Set_UTCSpecified(bUTCSpecified: WordBool);
  2343.     function Get_IsInterval: WordBool;
  2344.     procedure Set_IsInterval(bIsInterval: WordBool);
  2345.   public
  2346.     constructor Create(AOwner: TComponent); override;
  2347.     destructor  Destroy; override;
  2348.     procedure Connect; override;
  2349.     procedure ConnectTo(svrIntf: ISWbemDateTime);
  2350.     procedure Disconnect; override;
  2351.     function GetVarDate(bIsLocal: WordBool): TDateTime;
  2352.     procedure SetVarDate(dVarDate: TDateTime; bIsLocal: WordBool);
  2353.     function GetFileTime(bIsLocal: WordBool): WideString;
  2354.     procedure SetFileTime(const strFileTime: WideString; bIsLocal: WordBool);
  2355.     property DefaultInterface: ISWbemDateTime read GetDefaultInterface;
  2356.     property Value: WideString read Get_Value write Set_Value;
  2357.     property Year: Integer read Get_Year write Set_Year;
  2358.     property YearSpecified: WordBool read Get_YearSpecified write Set_YearSpecified;
  2359.     property Month: Integer read Get_Month write Set_Month;
  2360.     property MonthSpecified: WordBool read Get_MonthSpecified write Set_MonthSpecified;
  2361.     property Day: Integer read Get_Day write Set_Day;
  2362.     property DaySpecified: WordBool read Get_DaySpecified write Set_DaySpecified;
  2363.     property Hours: Integer read Get_Hours write Set_Hours;
  2364.     property HoursSpecified: WordBool read Get_HoursSpecified write Set_HoursSpecified;
  2365.     property Minutes: Integer read Get_Minutes write Set_Minutes;
  2366.     property MinutesSpecified: WordBool read Get_MinutesSpecified write Set_MinutesSpecified;
  2367.     property Seconds: Integer read Get_Seconds write Set_Seconds;
  2368.     property SecondsSpecified: WordBool read Get_SecondsSpecified write Set_SecondsSpecified;
  2369.     property Microseconds: Integer read Get_Microseconds write Set_Microseconds;
  2370.     property MicrosecondsSpecified: WordBool read Get_MicrosecondsSpecified write Set_MicrosecondsSpecified;
  2371.     property UTC: Integer read Get_UTC write Set_UTC;
  2372.     property UTCSpecified: WordBool read Get_UTCSpecified write Set_UTCSpecified;
  2373.     property IsInterval: WordBool read Get_IsInterval write Set_IsInterval;
  2374.   published
  2375. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  2376.     property Server: TSWbemDateTimeProperties read GetServerProperties;
  2377. {$ENDIF}
  2378.   end;
  2379.  
  2380. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  2381. // *********************************************************************//
  2382. // OLE Server Properties Proxy Class
  2383. // Server Object    : TSWbemDateTime
  2384. // (This object is used by the IDE's Property Inspector to allow editing
  2385. //  of the properties of this server)
  2386. // *********************************************************************//
  2387.  TSWbemDateTimeProperties = class(TPersistent)
  2388.   private
  2389.     FServer:    TSWbemDateTime;
  2390.     function    GetDefaultInterface: ISWbemDateTime;
  2391.     constructor Create(AServer: TSWbemDateTime);
  2392.   protected
  2393.     function Get_Value: WideString;
  2394.     procedure Set_Value(const strValue: WideString);
  2395.     function Get_Year: Integer;
  2396.     procedure Set_Year(iYear: Integer);
  2397.     function Get_YearSpecified: WordBool;
  2398.     procedure Set_YearSpecified(bYearSpecified: WordBool);
  2399.     function Get_Month: Integer;
  2400.     procedure Set_Month(iMonth: Integer);
  2401.     function Get_MonthSpecified: WordBool;
  2402.     procedure Set_MonthSpecified(bMonthSpecified: WordBool);
  2403.     function Get_Day: Integer;
  2404.     procedure Set_Day(iDay: Integer);
  2405.     function Get_DaySpecified: WordBool;
  2406.     procedure Set_DaySpecified(bDaySpecified: WordBool);
  2407.     function Get_Hours: Integer;
  2408.     procedure Set_Hours(iHours: Integer);
  2409.     function Get_HoursSpecified: WordBool;
  2410.     procedure Set_HoursSpecified(bHoursSpecified: WordBool);
  2411.     function Get_Minutes: Integer;
  2412.     procedure Set_Minutes(iMinutes: Integer);
  2413.     function Get_MinutesSpecified: WordBool;
  2414.     procedure Set_MinutesSpecified(bMinutesSpecified: WordBool);
  2415.     function Get_Seconds: Integer;
  2416.     procedure Set_Seconds(iSeconds: Integer);
  2417.     function Get_SecondsSpecified: WordBool;
  2418.     procedure Set_SecondsSpecified(bSecondsSpecified: WordBool);
  2419.     function Get_Microseconds: Integer;
  2420.     procedure Set_Microseconds(iMicroseconds: Integer);
  2421.     function Get_MicrosecondsSpecified: WordBool;
  2422.     procedure Set_MicrosecondsSpecified(bMicrosecondsSpecified: WordBool);
  2423.     function Get_UTC: Integer;
  2424.     procedure Set_UTC(iUTC: Integer);
  2425.     function Get_UTCSpecified: WordBool;
  2426.     procedure Set_UTCSpecified(bUTCSpecified: WordBool);
  2427.     function Get_IsInterval: WordBool;
  2428.     procedure Set_IsInterval(bIsInterval: WordBool);
  2429.   public
  2430.     property DefaultInterface: ISWbemDateTime read GetDefaultInterface;
  2431.   published
  2432.     property Value: WideString read Get_Value write Set_Value;
  2433.     property Year: Integer read Get_Year write Set_Year;
  2434.     property YearSpecified: WordBool read Get_YearSpecified write Set_YearSpecified;
  2435.     property Month: Integer read Get_Month write Set_Month;
  2436.     property MonthSpecified: WordBool read Get_MonthSpecified write Set_MonthSpecified;
  2437.     property Day: Integer read Get_Day write Set_Day;
  2438.     property DaySpecified: WordBool read Get_DaySpecified write Set_DaySpecified;
  2439.     property Hours: Integer read Get_Hours write Set_Hours;
  2440.     property HoursSpecified: WordBool read Get_HoursSpecified write Set_HoursSpecified;
  2441.     property Minutes: Integer read Get_Minutes write Set_Minutes;
  2442.     property MinutesSpecified: WordBool read Get_MinutesSpecified write Set_MinutesSpecified;
  2443.     property Seconds: Integer read Get_Seconds write Set_Seconds;
  2444.     property SecondsSpecified: WordBool read Get_SecondsSpecified write Set_SecondsSpecified;
  2445.     property Microseconds: Integer read Get_Microseconds write Set_Microseconds;
  2446.     property MicrosecondsSpecified: WordBool read Get_MicrosecondsSpecified write Set_MicrosecondsSpecified;
  2447.     property UTC: Integer read Get_UTC write Set_UTC;
  2448.     property UTCSpecified: WordBool read Get_UTCSpecified write Set_UTCSpecified;
  2449.     property IsInterval: WordBool read Get_IsInterval write Set_IsInterval;
  2450.   end;
  2451. {$ENDIF}
  2452.  
  2453.  
  2454. // *********************************************************************//
  2455. // The Class CoSWbemRefresher provides a Create and CreateRemote method to
  2456. // create instances of the default interface ISWbemRefresher exposed by
  2457. // the CoClass SWbemRefresher. The functions are intended to be used by
  2458. // clients wishing to automate the CoClass objects exposed by the
  2459. // server of this typelibrary.
  2460. // *********************************************************************//
  2461.   CoSWbemRefresher = class
  2462.     class function Create: ISWbemRefresher;
  2463.     class function CreateRemote(const MachineName: string): ISWbemRefresher;
  2464.   end;
  2465.  
  2466.  
  2467. // *********************************************************************//
  2468. // OLE Server Proxy class declaration
  2469. // Server Object    : TSWbemRefresher
  2470. // Help String      : Refresher
  2471. // Default Interface: ISWbemRefresher
  2472. // Def. Intf. DISP? : No
  2473. // Event   Interface:
  2474. // TypeFlags        : (2) CanCreate
  2475. // *********************************************************************//
  2476. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  2477.   TSWbemRefresherProperties= class;
  2478. {$ENDIF}
  2479.   TSWbemRefresher = class(TOleServer)
  2480.   private
  2481.     FIntf:        ISWbemRefresher;
  2482. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  2483.     FProps:       TSWbemRefresherProperties;
  2484.     function      GetServerProperties: TSWbemRefresherProperties;
  2485. {$ENDIF}
  2486.     function      GetDefaultInterface: ISWbemRefresher;
  2487.   protected
  2488.     procedure InitServerData; override;
  2489.     function Get_Count: Integer;
  2490.     function Get_AutoReconnect: WordBool;
  2491.     procedure Set_AutoReconnect(bCount: WordBool);
  2492.   public
  2493.     constructor Create(AOwner: TComponent); override;
  2494.     destructor  Destroy; override;
  2495.     procedure Connect; override;
  2496.     procedure ConnectTo(svrIntf: ISWbemRefresher);
  2497.     procedure Disconnect; override;
  2498.     function Item(iIndex: Integer): ISWbemRefreshableItem;
  2499.     function Add(const objWbemServices: ISWbemServicesEx; const bsInstancePath: WideString;
  2500.                  iFlags: Integer; const objWbemNamedValueSet: IDispatch): ISWbemRefreshableItem;
  2501.     function AddEnum(const objWbemServices: ISWbemServicesEx; const bsClassName: WideString;
  2502.                      iFlags: Integer; const objWbemNamedValueSet: IDispatch): ISWbemRefreshableItem;
  2503.     procedure Remove(iIndex: Integer; iFlags: Integer);
  2504.     procedure Refresh(iFlags: Integer);
  2505.     procedure DeleteAll;
  2506.     property DefaultInterface: ISWbemRefresher read GetDefaultInterface;
  2507.     property Count: Integer read Get_Count;
  2508.     property AutoReconnect: WordBool read Get_AutoReconnect write Set_AutoReconnect;
  2509.   published
  2510. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  2511.     property Server: TSWbemRefresherProperties read GetServerProperties;
  2512. {$ENDIF}
  2513.   end;
  2514.  
  2515. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  2516. // *********************************************************************//
  2517. // OLE Server Properties Proxy Class
  2518. // Server Object    : TSWbemRefresher
  2519. // (This object is used by the IDE's Property Inspector to allow editing
  2520. //  of the properties of this server)
  2521. // *********************************************************************//
  2522.  TSWbemRefresherProperties = class(TPersistent)
  2523.   private
  2524.     FServer:    TSWbemRefresher;
  2525.     function    GetDefaultInterface: ISWbemRefresher;
  2526.     constructor Create(AServer: TSWbemRefresher);
  2527.   protected
  2528.     function Get_Count: Integer;
  2529.     function Get_AutoReconnect: WordBool;
  2530.     procedure Set_AutoReconnect(bCount: WordBool);
  2531.   public
  2532.     property DefaultInterface: ISWbemRefresher read GetDefaultInterface;
  2533.   published
  2534.     property AutoReconnect: WordBool read Get_AutoReconnect write Set_AutoReconnect;
  2535.   end;
  2536. {$ENDIF}
  2537.  
  2538.  
  2539. // *********************************************************************//
  2540. // The Class CoSWbemServices provides a Create and CreateRemote method to
  2541. // create instances of the default interface ISWbemServices exposed by
  2542. // the CoClass SWbemServices. The functions are intended to be used by
  2543. // clients wishing to automate the CoClass objects exposed by the
  2544. // server of this typelibrary.
  2545. // *********************************************************************//
  2546.   CoSWbemServices = class
  2547.     class function Create: ISWbemServices;
  2548.     class function CreateRemote(const MachineName: string): ISWbemServices;
  2549.   end;
  2550.  
  2551. // *********************************************************************//
  2552. // The Class CoSWbemServicesEx provides a Create and CreateRemote method to
  2553. // create instances of the default interface ISWbemServicesEx exposed by
  2554. // the CoClass SWbemServicesEx. The functions are intended to be used by
  2555. // clients wishing to automate the CoClass objects exposed by the
  2556. // server of this typelibrary.
  2557. // *********************************************************************//
  2558.   CoSWbemServicesEx = class
  2559.     class function Create: ISWbemServicesEx;
  2560.     class function CreateRemote(const MachineName: string): ISWbemServicesEx;
  2561.   end;
  2562.  
  2563. // *********************************************************************//
  2564. // The Class CoSWbemObject provides a Create and CreateRemote method to
  2565. // create instances of the default interface ISWbemObject exposed by
  2566. // the CoClass SWbemObject. The functions are intended to be used by
  2567. // clients wishing to automate the CoClass objects exposed by the
  2568. // server of this typelibrary.
  2569. // *********************************************************************//
  2570.   CoSWbemObject = class
  2571.     class function Create: ISWbemObject;
  2572.     class function CreateRemote(const MachineName: string): ISWbemObject;
  2573.   end;
  2574.  
  2575. // *********************************************************************//
  2576. // The Class CoSWbemObjectEx provides a Create and CreateRemote method to
  2577. // create instances of the default interface ISWbemObjectEx exposed by
  2578. // the CoClass SWbemObjectEx. The functions are intended to be used by
  2579. // clients wishing to automate the CoClass objects exposed by the
  2580. // server of this typelibrary.
  2581. // *********************************************************************//
  2582.   CoSWbemObjectEx = class
  2583.     class function Create: ISWbemObjectEx;
  2584.     class function CreateRemote(const MachineName: string): ISWbemObjectEx;
  2585.   end;
  2586.  
  2587. // *********************************************************************//
  2588. // The Class CoSWbemObjectSet provides a Create and CreateRemote method to
  2589. // create instances of the default interface ISWbemObjectSet exposed by
  2590. // the CoClass SWbemObjectSet. The functions are intended to be used by
  2591. // clients wishing to automate the CoClass objects exposed by the
  2592. // server of this typelibrary.
  2593. // *********************************************************************//
  2594.   CoSWbemObjectSet = class
  2595.     class function Create: ISWbemObjectSet;
  2596.     class function CreateRemote(const MachineName: string): ISWbemObjectSet;
  2597.   end;
  2598.  
  2599. // *********************************************************************//
  2600. // The Class CoSWbemNamedValue provides a Create and CreateRemote method to
  2601. // create instances of the default interface ISWbemNamedValue exposed by
  2602. // the CoClass SWbemNamedValue. The functions are intended to be used by
  2603. // clients wishing to automate the CoClass objects exposed by the
  2604. // server of this typelibrary.
  2605. // *********************************************************************//
  2606.   CoSWbemNamedValue = class
  2607.     class function Create: ISWbemNamedValue;
  2608.     class function CreateRemote(const MachineName: string): ISWbemNamedValue;
  2609.   end;
  2610.  
  2611. // *********************************************************************//
  2612. // The Class CoSWbemQualifier provides a Create and CreateRemote method to
  2613. // create instances of the default interface ISWbemQualifier exposed by
  2614. // the CoClass SWbemQualifier. The functions are intended to be used by
  2615. // clients wishing to automate the CoClass objects exposed by the
  2616. // server of this typelibrary.
  2617. // *********************************************************************//
  2618.   CoSWbemQualifier = class
  2619.     class function Create: ISWbemQualifier;
  2620.     class function CreateRemote(const MachineName: string): ISWbemQualifier;
  2621.   end;
  2622.  
  2623. // *********************************************************************//
  2624. // The Class CoSWbemQualifierSet provides a Create and CreateRemote method to
  2625. // create instances of the default interface ISWbemQualifierSet exposed by
  2626. // the CoClass SWbemQualifierSet. The functions are intended to be used by
  2627. // clients wishing to automate the CoClass objects exposed by the
  2628. // server of this typelibrary.
  2629. // *********************************************************************//
  2630.   CoSWbemQualifierSet = class
  2631.     class function Create: ISWbemQualifierSet;
  2632.     class function CreateRemote(const MachineName: string): ISWbemQualifierSet;
  2633.   end;
  2634.  
  2635. // *********************************************************************//
  2636. // The Class CoSWbemProperty provides a Create and CreateRemote method to
  2637. // create instances of the default interface ISWbemProperty exposed by
  2638. // the CoClass SWbemProperty. The functions are intended to be used by
  2639. // clients wishing to automate the CoClass objects exposed by the
  2640. // server of this typelibrary.
  2641. // *********************************************************************//
  2642.   CoSWbemProperty = class
  2643.     class function Create: ISWbemProperty;
  2644.     class function CreateRemote(const MachineName: string): ISWbemProperty;
  2645.   end;
  2646.  
  2647. // *********************************************************************//
  2648. // The Class CoSWbemPropertySet provides a Create and CreateRemote method to
  2649. // create instances of the default interface ISWbemPropertySet exposed by
  2650. // the CoClass SWbemPropertySet. The functions are intended to be used by
  2651. // clients wishing to automate the CoClass objects exposed by the
  2652. // server of this typelibrary.
  2653. // *********************************************************************//
  2654.   CoSWbemPropertySet = class
  2655.     class function Create: ISWbemPropertySet;
  2656.     class function CreateRemote(const MachineName: string): ISWbemPropertySet;
  2657.   end;
  2658.  
  2659. // *********************************************************************//
  2660. // The Class CoSWbemMethod provides a Create and CreateRemote method to
  2661. // create instances of the default interface ISWbemMethod exposed by
  2662. // the CoClass SWbemMethod. The functions are intended to be used by
  2663. // clients wishing to automate the CoClass objects exposed by the
  2664. // server of this typelibrary.
  2665. // *********************************************************************//
  2666.   CoSWbemMethod = class
  2667.     class function Create: ISWbemMethod;
  2668.     class function CreateRemote(const MachineName: string): ISWbemMethod;
  2669.   end;
  2670.  
  2671. // *********************************************************************//
  2672. // The Class CoSWbemMethodSet provides a Create and CreateRemote method to
  2673. // create instances of the default interface ISWbemMethodSet exposed by
  2674. // the CoClass SWbemMethodSet. The functions are intended to be used by
  2675. // clients wishing to automate the CoClass objects exposed by the
  2676. // server of this typelibrary.
  2677. // *********************************************************************//
  2678.   CoSWbemMethodSet = class
  2679.     class function Create: ISWbemMethodSet;
  2680.     class function CreateRemote(const MachineName: string): ISWbemMethodSet;
  2681.   end;
  2682.  
  2683. // *********************************************************************//
  2684. // The Class CoSWbemEventSource provides a Create and CreateRemote method to
  2685. // create instances of the default interface ISWbemEventSource exposed by
  2686. // the CoClass SWbemEventSource. The functions are intended to be used by
  2687. // clients wishing to automate the CoClass objects exposed by the
  2688. // server of this typelibrary.
  2689. // *********************************************************************//
  2690.   CoSWbemEventSource = class
  2691.     class function Create: ISWbemEventSource;
  2692.     class function CreateRemote(const MachineName: string): ISWbemEventSource;
  2693.   end;
  2694.  
  2695. // *********************************************************************//
  2696. // The Class CoSWbemSecurity provides a Create and CreateRemote method to
  2697. // create instances of the default interface ISWbemSecurity exposed by
  2698. // the CoClass SWbemSecurity. The functions are intended to be used by
  2699. // clients wishing to automate the CoClass objects exposed by the
  2700. // server of this typelibrary.
  2701. // *********************************************************************//
  2702.   CoSWbemSecurity = class
  2703.     class function Create: ISWbemSecurity;
  2704.     class function CreateRemote(const MachineName: string): ISWbemSecurity;
  2705.   end;
  2706.  
  2707. // *********************************************************************//
  2708. // The Class CoSWbemPrivilege provides a Create and CreateRemote method to
  2709. // create instances of the default interface ISWbemPrivilege exposed by
  2710. // the CoClass SWbemPrivilege. The functions are intended to be used by
  2711. // clients wishing to automate the CoClass objects exposed by the
  2712. // server of this typelibrary.
  2713. // *********************************************************************//
  2714.   CoSWbemPrivilege = class
  2715.     class function Create: ISWbemPrivilege;
  2716.     class function CreateRemote(const MachineName: string): ISWbemPrivilege;
  2717.   end;
  2718.  
  2719. // *********************************************************************//
  2720. // The Class CoSWbemPrivilegeSet provides a Create and CreateRemote method to
  2721. // create instances of the default interface ISWbemPrivilegeSet exposed by
  2722. // the CoClass SWbemPrivilegeSet. The functions are intended to be used by
  2723. // clients wishing to automate the CoClass objects exposed by the
  2724. // server of this typelibrary.
  2725. // *********************************************************************//
  2726.   CoSWbemPrivilegeSet = class
  2727.     class function Create: ISWbemPrivilegeSet;
  2728.     class function CreateRemote(const MachineName: string): ISWbemPrivilegeSet;
  2729.   end;
  2730.  
  2731. // *********************************************************************//
  2732. // The Class CoSWbemRefreshableItem provides a Create and CreateRemote method to
  2733. // create instances of the default interface ISWbemRefreshableItem exposed by
  2734. // the CoClass SWbemRefreshableItem. The functions are intended to be used by
  2735. // clients wishing to automate the CoClass objects exposed by the
  2736. // server of this typelibrary.
  2737. // *********************************************************************//
  2738.   CoSWbemRefreshableItem = class
  2739.     class function Create: ISWbemRefreshableItem;
  2740.     class function CreateRemote(const MachineName: string): ISWbemRefreshableItem;
  2741.   end;
  2742.  
  2743. procedure Register;
  2744.  
  2745. resourcestring
  2746.   dtlServerPage = 'ActiveX';
  2747.  
  2748. implementation
  2749.  
  2750. uses ComObj;
  2751.  
  2752. class function CoSWbemLocator.Create: ISWbemLocator;
  2753. begin
  2754.   Result := CreateComObject(CLASS_SWbemLocator) as ISWbemLocator;
  2755. end;
  2756.  
  2757. class function CoSWbemLocator.CreateRemote(const MachineName: string): ISWbemLocator;
  2758. begin
  2759.   Result := CreateRemoteComObject(MachineName, CLASS_SWbemLocator) as ISWbemLocator;
  2760. end;
  2761.  
  2762. procedure TSWbemLocator.InitServerData;
  2763. const
  2764.   CServerData: TServerData = (
  2765.     ClassID:   '{76A64158-CB41-11D1-8B02-00600806D9B6}';
  2766.     IntfIID:   '{76A6415B-CB41-11D1-8B02-00600806D9B6}';
  2767.     EventIID:  '';
  2768.     LicenseKey: nil;
  2769.     Version: 500);
  2770. begin
  2771.   ServerData := @CServerData;
  2772. end;
  2773.  
  2774. procedure TSWbemLocator.Connect;
  2775. var
  2776.   punk: IUnknown;
  2777. begin
  2778.   if FIntf = nil then
  2779.   begin
  2780.     punk := GetServer;
  2781.     Fintf:= punk as ISWbemLocator;
  2782.   end;
  2783. end;
  2784.  
  2785. procedure TSWbemLocator.ConnectTo(svrIntf: ISWbemLocator);
  2786. begin
  2787.   Disconnect;
  2788.   FIntf := svrIntf;
  2789. end;
  2790.  
  2791. procedure TSWbemLocator.DisConnect;
  2792. begin
  2793.   if Fintf <> nil then
  2794.   begin
  2795.     FIntf := nil;
  2796.   end;
  2797. end;
  2798.  
  2799. function TSWbemLocator.GetDefaultInterface: ISWbemLocator;
  2800. begin
  2801.   if FIntf = nil then
  2802.     Connect;
  2803.   Assert(FIntf <> nil, 'DefaultInterface is NULL. Component is not connected to Server. You must call ''Connect'' or ''ConnectTo'' before this operation');
  2804.   Result := FIntf;
  2805. end;
  2806.  
  2807. constructor TSWbemLocator.Create(AOwner: TComponent);
  2808. begin
  2809.   inherited Create(AOwner);
  2810. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  2811.   FProps := TSWbemLocatorProperties.Create(Self);
  2812. {$ENDIF}
  2813. end;
  2814.  
  2815. destructor TSWbemLocator.Destroy;
  2816. begin
  2817. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  2818.   FProps.Free;
  2819. {$ENDIF}
  2820.   inherited Destroy;
  2821. end;
  2822.  
  2823. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  2824. function TSWbemLocator.GetServerProperties: TSWbemLocatorProperties;
  2825. begin
  2826.   Result := FProps;
  2827. end;
  2828. {$ENDIF}
  2829.  
  2830. function TSWbemLocator.Get_Security_: ISWbemSecurity;
  2831. begin
  2832.     Result := DefaultInterface.Security_;
  2833. end;
  2834.  
  2835. function TSWbemLocator.ConnectServer(const strServer: WideString; const strNamespace: WideString;
  2836.                                      const strUser: WideString; const strPassword: WideString;
  2837.                                      const strLocale: WideString; const strAuthority: WideString;
  2838.                                      iSecurityFlags: Integer; const objWbemNamedValueSet: IDispatch): ISWbemServices;
  2839. begin
  2840.   Result := DefaultInterface.ConnectServer(strServer, strNamespace, strUser, strPassword,
  2841.                                            strLocale, strAuthority, iSecurityFlags,
  2842.                                            objWbemNamedValueSet);
  2843. end;
  2844.  
  2845. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  2846. constructor TSWbemLocatorProperties.Create(AServer: TSWbemLocator);
  2847. begin
  2848.   inherited Create;
  2849.   FServer := AServer;
  2850. end;
  2851.  
  2852. function TSWbemLocatorProperties.GetDefaultInterface: ISWbemLocator;
  2853. begin
  2854.   Result := FServer.DefaultInterface;
  2855. end;
  2856.  
  2857. function TSWbemLocatorProperties.Get_Security_: ISWbemSecurity;
  2858. begin
  2859.     Result := DefaultInterface.Security_;
  2860. end;
  2861.  
  2862. {$ENDIF}
  2863.  
  2864. class function CoSWbemNamedValueSet.Create: ISWbemNamedValueSet;
  2865. begin
  2866.   Result := CreateComObject(CLASS_SWbemNamedValueSet) as ISWbemNamedValueSet;
  2867. end;
  2868.  
  2869. class function CoSWbemNamedValueSet.CreateRemote(const MachineName: string): ISWbemNamedValueSet;
  2870. begin
  2871.   Result := CreateRemoteComObject(MachineName, CLASS_SWbemNamedValueSet) as ISWbemNamedValueSet;
  2872. end;
  2873.  
  2874. procedure TSWbemNamedValueSet.InitServerData;
  2875. const
  2876.   CServerData: TServerData = (
  2877.     ClassID:   '{9AED384E-CE8B-11D1-8B05-00600806D9B6}';
  2878.     IntfIID:   '{CF2376EA-CE8C-11D1-8B05-00600806D9B6}';
  2879.     EventIID:  '';
  2880.     LicenseKey: nil;
  2881.     Version: 500);
  2882. begin
  2883.   ServerData := @CServerData;
  2884. end;
  2885.  
  2886. procedure TSWbemNamedValueSet.Connect;
  2887. var
  2888.   punk: IUnknown;
  2889. begin
  2890.   if FIntf = nil then
  2891.   begin
  2892.     punk := GetServer;
  2893.     Fintf:= punk as ISWbemNamedValueSet;
  2894.   end;
  2895. end;
  2896.  
  2897. procedure TSWbemNamedValueSet.ConnectTo(svrIntf: ISWbemNamedValueSet);
  2898. begin
  2899.   Disconnect;
  2900.   FIntf := svrIntf;
  2901. end;
  2902.  
  2903. procedure TSWbemNamedValueSet.DisConnect;
  2904. begin
  2905.   if Fintf <> nil then
  2906.   begin
  2907.     FIntf := nil;
  2908.   end;
  2909. end;
  2910.  
  2911. function TSWbemNamedValueSet.GetDefaultInterface: ISWbemNamedValueSet;
  2912. begin
  2913.   if FIntf = nil then
  2914.     Connect;
  2915.   Assert(FIntf <> nil, 'DefaultInterface is NULL. Component is not connected to Server. You must call ''Connect'' or ''ConnectTo'' before this operation');
  2916.   Result := FIntf;
  2917. end;
  2918.  
  2919. constructor TSWbemNamedValueSet.Create(AOwner: TComponent);
  2920. begin
  2921.   inherited Create(AOwner);
  2922. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  2923.   FProps := TSWbemNamedValueSetProperties.Create(Self);
  2924. {$ENDIF}
  2925. end;
  2926.  
  2927. destructor TSWbemNamedValueSet.Destroy;
  2928. begin
  2929. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  2930.   FProps.Free;
  2931. {$ENDIF}
  2932.   inherited Destroy;
  2933. end;
  2934.  
  2935. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  2936. function TSWbemNamedValueSet.GetServerProperties: TSWbemNamedValueSetProperties;
  2937. begin
  2938.   Result := FProps;
  2939. end;
  2940. {$ENDIF}
  2941.  
  2942. function TSWbemNamedValueSet.Get_Count: Integer;
  2943. begin
  2944.     Result := DefaultInterface.Count;
  2945. end;
  2946.  
  2947. function TSWbemNamedValueSet.Item(const strName: WideString; iFlags: Integer): ISWbemNamedValue;
  2948. begin
  2949.   Result := DefaultInterface.Item(strName, iFlags);
  2950. end;
  2951.  
  2952. function TSWbemNamedValueSet.Add(const strName: WideString; var varValue: OleVariant;
  2953.                                  iFlags: Integer): ISWbemNamedValue;
  2954. begin
  2955.   Result := DefaultInterface.Add(strName, varValue, iFlags);
  2956. end;
  2957.  
  2958. procedure TSWbemNamedValueSet.Remove(const strName: WideString; iFlags: Integer);
  2959. begin
  2960.   DefaultInterface.Remove(strName, iFlags);
  2961. end;
  2962.  
  2963. function TSWbemNamedValueSet.Clone: ISWbemNamedValueSet;
  2964. begin
  2965.   Result := DefaultInterface.Clone;
  2966. end;
  2967.  
  2968. procedure TSWbemNamedValueSet.DeleteAll;
  2969. begin
  2970.   DefaultInterface.DeleteAll;
  2971. end;
  2972.  
  2973. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  2974. constructor TSWbemNamedValueSetProperties.Create(AServer: TSWbemNamedValueSet);
  2975. begin
  2976.   inherited Create;
  2977.   FServer := AServer;
  2978. end;
  2979.  
  2980. function TSWbemNamedValueSetProperties.GetDefaultInterface: ISWbemNamedValueSet;
  2981. begin
  2982.   Result := FServer.DefaultInterface;
  2983. end;
  2984.  
  2985. function TSWbemNamedValueSetProperties.Get_Count: Integer;
  2986. begin
  2987.     Result := DefaultInterface.Count;
  2988. end;
  2989.  
  2990. {$ENDIF}
  2991.  
  2992. class function CoSWbemObjectPath.Create: ISWbemObjectPath;
  2993. begin
  2994.   Result := CreateComObject(CLASS_SWbemObjectPath) as ISWbemObjectPath;
  2995. end;
  2996.  
  2997. class function CoSWbemObjectPath.CreateRemote(const MachineName: string): ISWbemObjectPath;
  2998. begin
  2999.   Result := CreateRemoteComObject(MachineName, CLASS_SWbemObjectPath) as ISWbemObjectPath;
  3000. end;
  3001.  
  3002. procedure TSWbemObjectPath.InitServerData;
  3003. const
  3004.   CServerData: TServerData = (
  3005.     ClassID:   '{5791BC26-CE9C-11D1-97BF-0000F81E849C}';
  3006.     IntfIID:   '{5791BC27-CE9C-11D1-97BF-0000F81E849C}';
  3007.     EventIID:  '';
  3008.     LicenseKey: nil;
  3009.     Version: 500);
  3010. begin
  3011.   ServerData := @CServerData;
  3012. end;
  3013.  
  3014. procedure TSWbemObjectPath.Connect;
  3015. var
  3016.   punk: IUnknown;
  3017. begin
  3018.   if FIntf = nil then
  3019.   begin
  3020.     punk := GetServer;
  3021.     Fintf:= punk as ISWbemObjectPath;
  3022.   end;
  3023. end;
  3024.  
  3025. procedure TSWbemObjectPath.ConnectTo(svrIntf: ISWbemObjectPath);
  3026. begin
  3027.   Disconnect;
  3028.   FIntf := svrIntf;
  3029. end;
  3030.  
  3031. procedure TSWbemObjectPath.DisConnect;
  3032. begin
  3033.   if Fintf <> nil then
  3034.   begin
  3035.     FIntf := nil;
  3036.   end;
  3037. end;
  3038.  
  3039. function TSWbemObjectPath.GetDefaultInterface: ISWbemObjectPath;
  3040. begin
  3041.   if FIntf = nil then
  3042.     Connect;
  3043.   Assert(FIntf <> nil, 'DefaultInterface is NULL. Component is not connected to Server. You must call ''Connect'' or ''ConnectTo'' before this operation');
  3044.   Result := FIntf;
  3045. end;
  3046.  
  3047. constructor TSWbemObjectPath.Create(AOwner: TComponent);
  3048. begin
  3049.   inherited Create(AOwner);
  3050. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  3051.   FProps := TSWbemObjectPathProperties.Create(Self);
  3052. {$ENDIF}
  3053. end;
  3054.  
  3055. destructor TSWbemObjectPath.Destroy;
  3056. begin
  3057. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  3058.   FProps.Free;
  3059. {$ENDIF}
  3060.   inherited Destroy;
  3061. end;
  3062.  
  3063. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  3064. function TSWbemObjectPath.GetServerProperties: TSWbemObjectPathProperties;
  3065. begin
  3066.   Result := FProps;
  3067. end;
  3068. {$ENDIF}
  3069.  
  3070. function TSWbemObjectPath.Get_Path: WideString;
  3071. begin
  3072.     Result := DefaultInterface.Path;
  3073. end;
  3074.  
  3075. procedure TSWbemObjectPath.Set_Path(const strPath: WideString);
  3076.   { Warning: The property Path has a setter and a getter whose
  3077.   types do not match. Delphi was unable to generate a property of
  3078.   this sort and so is using a Variant to set the property instead. }
  3079. var
  3080.   InterfaceVariant: OleVariant;
  3081. begin
  3082.   InterfaceVariant := DefaultInterface;
  3083.   InterfaceVariant.Path := strPath;
  3084. end;
  3085.  
  3086. function TSWbemObjectPath.Get_RelPath: WideString;
  3087. begin
  3088.     Result := DefaultInterface.RelPath;
  3089. end;
  3090.  
  3091. procedure TSWbemObjectPath.Set_RelPath(const strRelPath: WideString);
  3092.   { Warning: The property RelPath has a setter and a getter whose
  3093.   types do not match. Delphi was unable to generate a property of
  3094.   this sort and so is using a Variant to set the property instead. }
  3095. var
  3096.   InterfaceVariant: OleVariant;
  3097. begin
  3098.   InterfaceVariant := DefaultInterface;
  3099.   InterfaceVariant.RelPath := strRelPath;
  3100. end;
  3101.  
  3102. function TSWbemObjectPath.Get_Server: WideString;
  3103. begin
  3104.     Result := DefaultInterface.Server;
  3105. end;
  3106.  
  3107. procedure TSWbemObjectPath.Set_Server(const strServer: WideString);
  3108.   { Warning: The property Server has a setter and a getter whose
  3109.   types do not match. Delphi was unable to generate a property of
  3110.   this sort and so is using a Variant to set the property instead. }
  3111. var
  3112.   InterfaceVariant: OleVariant;
  3113. begin
  3114.   InterfaceVariant := DefaultInterface;
  3115.   InterfaceVariant.Server := strServer;
  3116. end;
  3117.  
  3118. function TSWbemObjectPath.Get_Namespace: WideString;
  3119. begin
  3120.     Result := DefaultInterface.Namespace;
  3121. end;
  3122.  
  3123. procedure TSWbemObjectPath.Set_Namespace(const strNamespace: WideString);
  3124.   { Warning: The property Namespace has a setter and a getter whose
  3125.   types do not match. Delphi was unable to generate a property of
  3126.   this sort and so is using a Variant to set the property instead. }
  3127. var
  3128.   InterfaceVariant: OleVariant;
  3129. begin
  3130.   InterfaceVariant := DefaultInterface;
  3131.   InterfaceVariant.Namespace := strNamespace;
  3132. end;
  3133.  
  3134. function TSWbemObjectPath.Get_ParentNamespace: WideString;
  3135. begin
  3136.     Result := DefaultInterface.ParentNamespace;
  3137. end;
  3138.  
  3139. function TSWbemObjectPath.Get_DisplayName: WideString;
  3140. begin
  3141.     Result := DefaultInterface.DisplayName;
  3142. end;
  3143.  
  3144. procedure TSWbemObjectPath.Set_DisplayName(const strDisplayName: WideString);
  3145.   { Warning: The property DisplayName has a setter and a getter whose
  3146.   types do not match. Delphi was unable to generate a property of
  3147.   this sort and so is using a Variant to set the property instead. }
  3148. var
  3149.   InterfaceVariant: OleVariant;
  3150. begin
  3151.   InterfaceVariant := DefaultInterface;
  3152.   InterfaceVariant.DisplayName := strDisplayName;
  3153. end;
  3154.  
  3155. function TSWbemObjectPath.Get_Class_: WideString;
  3156. begin
  3157.     Result := DefaultInterface.Class_;
  3158. end;
  3159.  
  3160. procedure TSWbemObjectPath.Set_Class_(const strClass: WideString);
  3161.   { Warning: The property Class_ has a setter and a getter whose
  3162.   types do not match. Delphi was unable to generate a property of
  3163.   this sort and so is using a Variant to set the property instead. }
  3164. var
  3165.   InterfaceVariant: OleVariant;
  3166. begin
  3167.   InterfaceVariant := DefaultInterface;
  3168.   InterfaceVariant.Class_ := strClass;
  3169. end;
  3170.  
  3171. function TSWbemObjectPath.Get_IsClass: WordBool;
  3172. begin
  3173.     Result := DefaultInterface.IsClass;
  3174. end;
  3175.  
  3176. function TSWbemObjectPath.Get_IsSingleton: WordBool;
  3177. begin
  3178.     Result := DefaultInterface.IsSingleton;
  3179. end;
  3180.  
  3181. function TSWbemObjectPath.Get_Keys: ISWbemNamedValueSet;
  3182. begin
  3183.     Result := DefaultInterface.Keys;
  3184. end;
  3185.  
  3186. function TSWbemObjectPath.Get_Security_: ISWbemSecurity;
  3187. begin
  3188.     Result := DefaultInterface.Security_;
  3189. end;
  3190.  
  3191. function TSWbemObjectPath.Get_Locale: WideString;
  3192. begin
  3193.     Result := DefaultInterface.Locale;
  3194. end;
  3195.  
  3196. procedure TSWbemObjectPath.Set_Locale(const strLocale: WideString);
  3197.   { Warning: The property Locale has a setter and a getter whose
  3198.   types do not match. Delphi was unable to generate a property of
  3199.   this sort and so is using a Variant to set the property instead. }
  3200. var
  3201.   InterfaceVariant: OleVariant;
  3202. begin
  3203.   InterfaceVariant := DefaultInterface;
  3204.   InterfaceVariant.Locale := strLocale;
  3205. end;
  3206.  
  3207. function TSWbemObjectPath.Get_Authority: WideString;
  3208. begin
  3209.     Result := DefaultInterface.Authority;
  3210. end;
  3211.  
  3212. procedure TSWbemObjectPath.Set_Authority(const strAuthority: WideString);
  3213.   { Warning: The property Authority has a setter and a getter whose
  3214.   types do not match. Delphi was unable to generate a property of
  3215.   this sort and so is using a Variant to set the property instead. }
  3216. var
  3217.   InterfaceVariant: OleVariant;
  3218. begin
  3219.   InterfaceVariant := DefaultInterface;
  3220.   InterfaceVariant.Authority := strAuthority;
  3221. end;
  3222.  
  3223. procedure TSWbemObjectPath.SetAsClass;
  3224. begin
  3225.   DefaultInterface.SetAsClass;
  3226. end;
  3227.  
  3228. procedure TSWbemObjectPath.SetAsSingleton;
  3229. begin
  3230.   DefaultInterface.SetAsSingleton;
  3231. end;
  3232.  
  3233. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  3234. constructor TSWbemObjectPathProperties.Create(AServer: TSWbemObjectPath);
  3235. begin
  3236.   inherited Create;
  3237.   FServer := AServer;
  3238. end;
  3239.  
  3240. function TSWbemObjectPathProperties.GetDefaultInterface: ISWbemObjectPath;
  3241. begin
  3242.   Result := FServer.DefaultInterface;
  3243. end;
  3244.  
  3245. function TSWbemObjectPathProperties.Get_Path: WideString;
  3246. begin
  3247.     Result := DefaultInterface.Path;
  3248. end;
  3249.  
  3250. procedure TSWbemObjectPathProperties.Set_Path(const strPath: WideString);
  3251.   { Warning: The property Path has a setter and a getter whose
  3252.   types do not match. Delphi was unable to generate a property of
  3253.   this sort and so is using a Variant to set the property instead. }
  3254. var
  3255.   InterfaceVariant: OleVariant;
  3256. begin
  3257.   InterfaceVariant := DefaultInterface;
  3258.   InterfaceVariant.Path := strPath;
  3259. end;
  3260.  
  3261. function TSWbemObjectPathProperties.Get_RelPath: WideString;
  3262. begin
  3263.     Result := DefaultInterface.RelPath;
  3264. end;
  3265.  
  3266. procedure TSWbemObjectPathProperties.Set_RelPath(const strRelPath: WideString);
  3267.   { Warning: The property RelPath has a setter and a getter whose
  3268.   types do not match. Delphi was unable to generate a property of
  3269.   this sort and so is using a Variant to set the property instead. }
  3270. var
  3271.   InterfaceVariant: OleVariant;
  3272. begin
  3273.   InterfaceVariant := DefaultInterface;
  3274.   InterfaceVariant.RelPath := strRelPath;
  3275. end;
  3276.  
  3277. function TSWbemObjectPathProperties.Get_Server: WideString;
  3278. begin
  3279.     Result := DefaultInterface.Server;
  3280. end;
  3281.  
  3282. procedure TSWbemObjectPathProperties.Set_Server(const strServer: WideString);
  3283.   { Warning: The property Server has a setter and a getter whose
  3284.   types do not match. Delphi was unable to generate a property of
  3285.   this sort and so is using a Variant to set the property instead. }
  3286. var
  3287.   InterfaceVariant: OleVariant;
  3288. begin
  3289.   InterfaceVariant := DefaultInterface;
  3290.   InterfaceVariant.Server := strServer;
  3291. end;
  3292.  
  3293. function TSWbemObjectPathProperties.Get_Namespace: WideString;
  3294. begin
  3295.     Result := DefaultInterface.Namespace;
  3296. end;
  3297.  
  3298. procedure TSWbemObjectPathProperties.Set_Namespace(const strNamespace: WideString);
  3299.   { Warning: The property Namespace has a setter and a getter whose
  3300.   types do not match. Delphi was unable to generate a property of
  3301.   this sort and so is using a Variant to set the property instead. }
  3302. var
  3303.   InterfaceVariant: OleVariant;
  3304. begin
  3305.   InterfaceVariant := DefaultInterface;
  3306.   InterfaceVariant.Namespace := strNamespace;
  3307. end;
  3308.  
  3309. function TSWbemObjectPathProperties.Get_ParentNamespace: WideString;
  3310. begin
  3311.     Result := DefaultInterface.ParentNamespace;
  3312. end;
  3313.  
  3314. function TSWbemObjectPathProperties.Get_DisplayName: WideString;
  3315. begin
  3316.     Result := DefaultInterface.DisplayName;
  3317. end;
  3318.  
  3319. procedure TSWbemObjectPathProperties.Set_DisplayName(const strDisplayName: WideString);
  3320.   { Warning: The property DisplayName has a setter and a getter whose
  3321.   types do not match. Delphi was unable to generate a property of
  3322.   this sort and so is using a Variant to set the property instead. }
  3323. var
  3324.   InterfaceVariant: OleVariant;
  3325. begin
  3326.   InterfaceVariant := DefaultInterface;
  3327.   InterfaceVariant.DisplayName := strDisplayName;
  3328. end;
  3329.  
  3330. function TSWbemObjectPathProperties.Get_Class_: WideString;
  3331. begin
  3332.     Result := DefaultInterface.Class_;
  3333. end;
  3334.  
  3335. procedure TSWbemObjectPathProperties.Set_Class_(const strClass: WideString);
  3336.   { Warning: The property Class_ has a setter and a getter whose
  3337.   types do not match. Delphi was unable to generate a property of
  3338.   this sort and so is using a Variant to set the property instead. }
  3339. var
  3340.   InterfaceVariant: OleVariant;
  3341. begin
  3342.   InterfaceVariant := DefaultInterface;
  3343.   InterfaceVariant.Class_ := strClass;
  3344. end;
  3345.  
  3346. function TSWbemObjectPathProperties.Get_IsClass: WordBool;
  3347. begin
  3348.     Result := DefaultInterface.IsClass;
  3349. end;
  3350.  
  3351. function TSWbemObjectPathProperties.Get_IsSingleton: WordBool;
  3352. begin
  3353.     Result := DefaultInterface.IsSingleton;
  3354. end;
  3355.  
  3356. function TSWbemObjectPathProperties.Get_Keys: ISWbemNamedValueSet;
  3357. begin
  3358.     Result := DefaultInterface.Keys;
  3359. end;
  3360.  
  3361. function TSWbemObjectPathProperties.Get_Security_: ISWbemSecurity;
  3362. begin
  3363.     Result := DefaultInterface.Security_;
  3364. end;
  3365.  
  3366. function TSWbemObjectPathProperties.Get_Locale: WideString;
  3367. begin
  3368.     Result := DefaultInterface.Locale;
  3369. end;
  3370.  
  3371. procedure TSWbemObjectPathProperties.Set_Locale(const strLocale: WideString);
  3372.   { Warning: The property Locale has a setter and a getter whose
  3373.   types do not match. Delphi was unable to generate a property of
  3374.   this sort and so is using a Variant to set the property instead. }
  3375. var
  3376.   InterfaceVariant: OleVariant;
  3377. begin
  3378.   InterfaceVariant := DefaultInterface;
  3379.   InterfaceVariant.Locale := strLocale;
  3380. end;
  3381.  
  3382. function TSWbemObjectPathProperties.Get_Authority: WideString;
  3383. begin
  3384.     Result := DefaultInterface.Authority;
  3385. end;
  3386.  
  3387. procedure TSWbemObjectPathProperties.Set_Authority(const strAuthority: WideString);
  3388.   { Warning: The property Authority has a setter and a getter whose
  3389.   types do not match. Delphi was unable to generate a property of
  3390.   this sort and so is using a Variant to set the property instead. }
  3391. var
  3392.   InterfaceVariant: OleVariant;
  3393. begin
  3394.   InterfaceVariant := DefaultInterface;
  3395.   InterfaceVariant.Authority := strAuthority;
  3396. end;
  3397.  
  3398. {$ENDIF}
  3399.  
  3400. class function CoSWbemLastError.Create: ISWbemLastError;
  3401. begin
  3402.   Result := CreateComObject(CLASS_SWbemLastError) as ISWbemLastError;
  3403. end;
  3404.  
  3405. class function CoSWbemLastError.CreateRemote(const MachineName: string): ISWbemLastError;
  3406. begin
  3407.   Result := CreateRemoteComObject(MachineName, CLASS_SWbemLastError) as ISWbemLastError;
  3408. end;
  3409.  
  3410. procedure TSWbemLastError.InitServerData;
  3411. const
  3412.   CServerData: TServerData = (
  3413.     ClassID:   '{C2FEEEAC-CFCD-11D1-8B05-00600806D9B6}';
  3414.     IntfIID:   '{D962DB84-D4BB-11D1-8B09-00600806D9B6}';
  3415.     EventIID:  '';
  3416.     LicenseKey: nil;
  3417.     Version: 500);
  3418. begin
  3419.   ServerData := @CServerData;
  3420. end;
  3421.  
  3422. procedure TSWbemLastError.Connect;
  3423. var
  3424.   punk: IUnknown;
  3425. begin
  3426.   if FIntf = nil then
  3427.   begin
  3428.     punk := GetServer;
  3429.     Fintf:= punk as ISWbemLastError;
  3430.   end;
  3431. end;
  3432.  
  3433. procedure TSWbemLastError.ConnectTo(svrIntf: ISWbemLastError);
  3434. begin
  3435.   Disconnect;
  3436.   FIntf := svrIntf;
  3437. end;
  3438.  
  3439. procedure TSWbemLastError.DisConnect;
  3440. begin
  3441.   if Fintf <> nil then
  3442.   begin
  3443.     FIntf := nil;
  3444.   end;
  3445. end;
  3446.  
  3447. function TSWbemLastError.GetDefaultInterface: ISWbemLastError;
  3448. begin
  3449.   if FIntf = nil then
  3450.     Connect;
  3451.   Assert(FIntf <> nil, 'DefaultInterface is NULL. Component is not connected to Server. You must call ''Connect'' or ''ConnectTo'' before this operation');
  3452.   Result := FIntf;
  3453. end;
  3454.  
  3455. constructor TSWbemLastError.Create(AOwner: TComponent);
  3456. begin
  3457.   inherited Create(AOwner);
  3458. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  3459.   FProps := TSWbemLastErrorProperties.Create(Self);
  3460. {$ENDIF}
  3461. end;
  3462.  
  3463. destructor TSWbemLastError.Destroy;
  3464. begin
  3465. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  3466.   FProps.Free;
  3467. {$ENDIF}
  3468.   inherited Destroy;
  3469. end;
  3470.  
  3471. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  3472. function TSWbemLastError.GetServerProperties: TSWbemLastErrorProperties;
  3473. begin
  3474.   Result := FProps;
  3475. end;
  3476. {$ENDIF}
  3477.  
  3478. function TSWbemLastError.Get_Qualifiers_: ISWbemQualifierSet;
  3479. begin
  3480.     Result := DefaultInterface.Qualifiers_;
  3481. end;
  3482.  
  3483. function TSWbemLastError.Get_Properties_: ISWbemPropertySet;
  3484. begin
  3485.     Result := DefaultInterface.Properties_;
  3486. end;
  3487.  
  3488. function TSWbemLastError.Get_Methods_: ISWbemMethodSet;
  3489. begin
  3490.     Result := DefaultInterface.Methods_;
  3491. end;
  3492.  
  3493. function TSWbemLastError.Get_Derivation_: OleVariant;
  3494. var
  3495.   InterfaceVariant : OleVariant;
  3496. begin
  3497.   InterfaceVariant := DefaultInterface;
  3498.   Result := InterfaceVariant.Derivation_;
  3499. end;
  3500.  
  3501. function TSWbemLastError.Get_Path_: ISWbemObjectPath;
  3502. begin
  3503.     Result := DefaultInterface.Path_;
  3504. end;
  3505.  
  3506. function TSWbemLastError.Get_Security_: ISWbemSecurity;
  3507. begin
  3508.     Result := DefaultInterface.Security_;
  3509. end;
  3510.  
  3511. function TSWbemLastError.Put_(iFlags: Integer; const objWbemNamedValueSet: IDispatch): ISWbemObjectPath;
  3512. begin
  3513.   Result := DefaultInterface.Put_(iFlags, objWbemNamedValueSet);
  3514. end;
  3515.  
  3516. procedure TSWbemLastError.PutAsync_(const objWbemSink: IDispatch; iFlags: Integer;
  3517.                                     const objWbemNamedValueSet: IDispatch;
  3518.                                     const objWbemAsyncContext: IDispatch);
  3519. begin
  3520.   DefaultInterface.PutAsync_(objWbemSink, iFlags, objWbemNamedValueSet, objWbemAsyncContext);
  3521. end;
  3522.  
  3523. procedure TSWbemLastError.Delete_(iFlags: Integer; const objWbemNamedValueSet: IDispatch);
  3524. begin
  3525.   DefaultInterface.Delete_(iFlags, objWbemNamedValueSet);
  3526. end;
  3527.  
  3528. procedure TSWbemLastError.DeleteAsync_(const objWbemSink: IDispatch; iFlags: Integer;
  3529.                                        const objWbemNamedValueSet: IDispatch;
  3530.                                        const objWbemAsyncContext: IDispatch);
  3531. begin
  3532.   DefaultInterface.DeleteAsync_(objWbemSink, iFlags, objWbemNamedValueSet, objWbemAsyncContext);
  3533. end;
  3534.  
  3535. function TSWbemLastError.Instances_(iFlags: Integer; const objWbemNamedValueSet: IDispatch): ISWbemObjectSet;
  3536. begin
  3537.   Result := DefaultInterface.Instances_(iFlags, objWbemNamedValueSet);
  3538. end;
  3539.  
  3540. procedure TSWbemLastError.InstancesAsync_(const objWbemSink: IDispatch; iFlags: Integer;
  3541.                                           const objWbemNamedValueSet: IDispatch;
  3542.                                           const objWbemAsyncContext: IDispatch);
  3543. begin
  3544.   DefaultInterface.InstancesAsync_(objWbemSink, iFlags, objWbemNamedValueSet, objWbemAsyncContext);
  3545. end;
  3546.  
  3547. function TSWbemLastError.Subclasses_(iFlags: Integer; const objWbemNamedValueSet: IDispatch): ISWbemObjectSet;
  3548. begin
  3549.   Result := DefaultInterface.Subclasses_(iFlags, objWbemNamedValueSet);
  3550. end;
  3551.  
  3552. procedure TSWbemLastError.SubclassesAsync_(const objWbemSink: IDispatch; iFlags: Integer;
  3553.                                            const objWbemNamedValueSet: IDispatch;
  3554.                                            const objWbemAsyncContext: IDispatch);
  3555. begin
  3556.   DefaultInterface.SubclassesAsync_(objWbemSink, iFlags, objWbemNamedValueSet, objWbemAsyncContext);
  3557. end;
  3558.  
  3559. function TSWbemLastError.Associators_(const strAssocClass: WideString;
  3560.                                       const strResultClass: WideString;
  3561.                                       const strResultRole: WideString; const strRole: WideString;
  3562.                                       bClassesOnly: WordBool; bSchemaOnly: WordBool;
  3563.                                       const strRequiredAssocQualifier: WideString;
  3564.                                       const strRequiredQualifier: WideString; iFlags: Integer;
  3565.                                       const objWbemNamedValueSet: IDispatch): ISWbemObjectSet;
  3566. begin
  3567.   Result := DefaultInterface.Associators_(strAssocClass, strResultClass, strResultRole, strRole,
  3568.                                           bClassesOnly, bSchemaOnly, strRequiredAssocQualifier,
  3569.                                           strRequiredQualifier, iFlags, objWbemNamedValueSet);
  3570. end;
  3571.  
  3572. procedure TSWbemLastError.AssociatorsAsync_(const objWbemSink: IDispatch;
  3573.                                             const strAssocClass: WideString;
  3574.                                             const strResultClass: WideString;
  3575.                                             const strResultRole: WideString;
  3576.                                             const strRole: WideString; bClassesOnly: WordBool;
  3577.                                             bSchemaOnly: WordBool;
  3578.                                             const strRequiredAssocQualifier: WideString;
  3579.                                             const strRequiredQualifier: WideString;
  3580.                                             iFlags: Integer; const objWbemNamedValueSet: IDispatch;
  3581.                                             const objWbemAsyncContext: IDispatch);
  3582. begin
  3583.   DefaultInterface.AssociatorsAsync_(objWbemSink, strAssocClass, strResultClass, strResultRole,
  3584.                                      strRole, bClassesOnly, bSchemaOnly, strRequiredAssocQualifier,
  3585.                                      strRequiredQualifier, iFlags, objWbemNamedValueSet,
  3586.                                      objWbemAsyncContext);
  3587. end;
  3588.  
  3589. function TSWbemLastError.References_(const strResultClass: WideString; const strRole: WideString;
  3590.                                      bClassesOnly: WordBool; bSchemaOnly: WordBool;
  3591.                                      const strRequiredQualifier: WideString; iFlags: Integer;
  3592.                                      const objWbemNamedValueSet: IDispatch): ISWbemObjectSet;
  3593. begin
  3594.   Result := DefaultInterface.References_(strResultClass, strRole, bClassesOnly, bSchemaOnly,
  3595.                                          strRequiredQualifier, iFlags, objWbemNamedValueSet);
  3596. end;
  3597.  
  3598. procedure TSWbemLastError.ReferencesAsync_(const objWbemSink: IDispatch;
  3599.                                            const strResultClass: WideString;
  3600.                                            const strRole: WideString; bClassesOnly: WordBool;
  3601.                                            bSchemaOnly: WordBool;
  3602.                                            const strRequiredQualifier: WideString; iFlags: Integer;
  3603.                                            const objWbemNamedValueSet: IDispatch;
  3604.                                            const objWbemAsyncContext: IDispatch);
  3605. begin
  3606.   DefaultInterface.ReferencesAsync_(objWbemSink, strResultClass, strRole, bClassesOnly,
  3607.                                     bSchemaOnly, strRequiredQualifier, iFlags,
  3608.                                     objWbemNamedValueSet, objWbemAsyncContext);
  3609. end;
  3610.  
  3611. function TSWbemLastError.ExecMethod_(const strMethodName: WideString;
  3612.                                      const objWbemInParameters: IDispatch; iFlags: Integer;
  3613.                                      const objWbemNamedValueSet: IDispatch): ISWbemObject;
  3614. begin
  3615.   Result := DefaultInterface.ExecMethod_(strMethodName, objWbemInParameters, iFlags,
  3616.                                          objWbemNamedValueSet);
  3617. end;
  3618.  
  3619. procedure TSWbemLastError.ExecMethodAsync_(const objWbemSink: IDispatch;
  3620.                                            const strMethodName: WideString;
  3621.                                            const objWbemInParameters: IDispatch; iFlags: Integer;
  3622.                                            const objWbemNamedValueSet: IDispatch;
  3623.                                            const objWbemAsyncContext: IDispatch);
  3624. begin
  3625.   DefaultInterface.ExecMethodAsync_(objWbemSink, strMethodName, objWbemInParameters, iFlags,
  3626.                                     objWbemNamedValueSet, objWbemAsyncContext);
  3627. end;
  3628.  
  3629. function TSWbemLastError.Clone_: ISWbemObject;
  3630. begin
  3631.   Result := DefaultInterface.Clone_;
  3632. end;
  3633.  
  3634. function TSWbemLastError.GetObjectText_(iFlags: Integer): WideString;
  3635. begin
  3636.   Result := DefaultInterface.GetObjectText_(iFlags);
  3637. end;
  3638.  
  3639. function TSWbemLastError.SpawnDerivedClass_(iFlags: Integer): ISWbemObject;
  3640. begin
  3641.   Result := DefaultInterface.SpawnDerivedClass_(iFlags);
  3642. end;
  3643.  
  3644. function TSWbemLastError.SpawnInstance_(iFlags: Integer): ISWbemObject;
  3645. begin
  3646.   Result := DefaultInterface.SpawnInstance_(iFlags);
  3647. end;
  3648.  
  3649. function TSWbemLastError.CompareTo_(const objWbemObject: IDispatch; iFlags: Integer): WordBool;
  3650. begin
  3651.   Result := DefaultInterface.CompareTo_(objWbemObject, iFlags);
  3652. end;
  3653.  
  3654. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  3655. constructor TSWbemLastErrorProperties.Create(AServer: TSWbemLastError);
  3656. begin
  3657.   inherited Create;
  3658.   FServer := AServer;
  3659. end;
  3660.  
  3661. function TSWbemLastErrorProperties.GetDefaultInterface: ISWbemLastError;
  3662. begin
  3663.   Result := FServer.DefaultInterface;
  3664. end;
  3665.  
  3666. function TSWbemLastErrorProperties.Get_Qualifiers_: ISWbemQualifierSet;
  3667. begin
  3668.     Result := DefaultInterface.Qualifiers_;
  3669. end;
  3670.  
  3671. function TSWbemLastErrorProperties.Get_Properties_: ISWbemPropertySet;
  3672. begin
  3673.     Result := DefaultInterface.Properties_;
  3674. end;
  3675.  
  3676. function TSWbemLastErrorProperties.Get_Methods_: ISWbemMethodSet;
  3677. begin
  3678.     Result := DefaultInterface.Methods_;
  3679. end;
  3680.  
  3681. function TSWbemLastErrorProperties.Get_Derivation_: OleVariant;
  3682. var
  3683.   InterfaceVariant : OleVariant;
  3684. begin
  3685.   InterfaceVariant := DefaultInterface;
  3686.   Result := InterfaceVariant.Derivation_;
  3687. end;
  3688.  
  3689. function TSWbemLastErrorProperties.Get_Path_: ISWbemObjectPath;
  3690. begin
  3691.     Result := DefaultInterface.Path_;
  3692. end;
  3693.  
  3694. function TSWbemLastErrorProperties.Get_Security_: ISWbemSecurity;
  3695. begin
  3696.     Result := DefaultInterface.Security_;
  3697. end;
  3698.  
  3699. {$ENDIF}
  3700.  
  3701. class function CoSWbemSink.Create: ISWbemSink;
  3702. begin
  3703.   Result := CreateComObject(CLASS_SWbemSink) as ISWbemSink;
  3704. end;
  3705.  
  3706. class function CoSWbemSink.CreateRemote(const MachineName: string): ISWbemSink;
  3707. begin
  3708.   Result := CreateRemoteComObject(MachineName, CLASS_SWbemSink) as ISWbemSink;
  3709. end;
  3710.  
  3711. procedure TSWbemSink.InitServerData;
  3712. const
  3713.   CServerData: TServerData = (
  3714.     ClassID:   '{75718C9A-F029-11D1-A1AC-00C04FB6C223}';
  3715.     IntfIID:   '{75718C9F-F029-11D1-A1AC-00C04FB6C223}';
  3716.     EventIID:  '{75718CA0-F029-11D1-A1AC-00C04FB6C223}';
  3717.     LicenseKey: nil;
  3718.     Version: 500);
  3719. begin
  3720.   ServerData := @CServerData;
  3721. end;
  3722.  
  3723. procedure TSWbemSink.Connect;
  3724. var
  3725.   punk: IUnknown;
  3726. begin
  3727.   if FIntf = nil then
  3728.   begin
  3729.     punk := GetServer;
  3730.     ConnectEvents(punk);
  3731.     Fintf:= punk as ISWbemSink;
  3732.   end;
  3733. end;
  3734.  
  3735. procedure TSWbemSink.ConnectTo(svrIntf: ISWbemSink);
  3736. begin
  3737.   Disconnect;
  3738.   FIntf := svrIntf;
  3739.   ConnectEvents(FIntf);
  3740. end;
  3741.  
  3742. procedure TSWbemSink.DisConnect;
  3743. begin
  3744.   if Fintf <> nil then
  3745.   begin
  3746.     DisconnectEvents(FIntf);
  3747.     FIntf := nil;
  3748.   end;
  3749. end;
  3750.  
  3751. function TSWbemSink.GetDefaultInterface: ISWbemSink;
  3752. begin
  3753.   if FIntf = nil then
  3754.     Connect;
  3755.   Assert(FIntf <> nil, 'DefaultInterface is NULL. Component is not connected to Server. You must call ''Connect'' or ''ConnectTo'' before this operation');
  3756.   Result := FIntf;
  3757. end;
  3758.  
  3759. constructor TSWbemSink.Create(AOwner: TComponent);
  3760. begin
  3761.   inherited Create(AOwner);
  3762. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  3763.   FProps := TSWbemSinkProperties.Create(Self);
  3764. {$ENDIF}
  3765. end;
  3766.  
  3767. destructor TSWbemSink.Destroy;
  3768. begin
  3769. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  3770.   FProps.Free;
  3771. {$ENDIF}
  3772.   inherited Destroy;
  3773. end;
  3774.  
  3775. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  3776. function TSWbemSink.GetServerProperties: TSWbemSinkProperties;
  3777. begin
  3778.   Result := FProps;
  3779. end;
  3780. {$ENDIF}
  3781.  
  3782. procedure TSWbemSink.InvokeEvent(DispID: TDispID; var Params: TVariantArray);
  3783. begin
  3784.   case DispID of
  3785.     -1: Exit;  // DISPID_UNKNOWN
  3786.    1: if Assigned(FOnObjectReady) then
  3787.             FOnObjectReady(Self, Params[1] {const ISWbemNamedValueSet}, Params[0] {const ISWbemObject});
  3788.    2: if Assigned(FOnCompleted) then
  3789.             FOnCompleted(Self, Params[2] {const ISWbemNamedValueSet}, Params[1] {const ISWbemObject}, Params[0] {WbemErrorEnum});
  3790.    3: if Assigned(FOnProgress) then
  3791.             FOnProgress(Self, Params[3] {const ISWbemNamedValueSet}, Params[2] {const WideString}, Params[1] {Integer}, Params[0] {Integer});
  3792.    4: if Assigned(FOnObjectPut) then
  3793.             FOnObjectPut(Self, Params[1] {const ISWbemNamedValueSet}, Params[0] {const ISWbemObjectPath});
  3794.   end; {case DispID}
  3795. end;
  3796.  
  3797. procedure TSWbemSink.Cancel;
  3798. begin
  3799.   DefaultInterface.Cancel;
  3800. end;
  3801.  
  3802. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  3803. constructor TSWbemSinkProperties.Create(AServer: TSWbemSink);
  3804. begin
  3805.   inherited Create;
  3806.   FServer := AServer;
  3807. end;
  3808.  
  3809. function TSWbemSinkProperties.GetDefaultInterface: ISWbemSink;
  3810. begin
  3811.   Result := FServer.DefaultInterface;
  3812. end;
  3813.  
  3814. {$ENDIF}
  3815.  
  3816. class function CoSWbemDateTime.Create: ISWbemDateTime;
  3817. begin
  3818.   Result := CreateComObject(CLASS_SWbemDateTime) as ISWbemDateTime;
  3819. end;
  3820.  
  3821. class function CoSWbemDateTime.CreateRemote(const MachineName: string): ISWbemDateTime;
  3822. begin
  3823.   Result := CreateRemoteComObject(MachineName, CLASS_SWbemDateTime) as ISWbemDateTime;
  3824. end;
  3825.  
  3826. procedure TSWbemDateTime.InitServerData;
  3827. const
  3828.   CServerData: TServerData = (
  3829.     ClassID:   '{47DFBE54-CF76-11D3-B38F-00105A1F473A}';
  3830.     IntfIID:   '{5E97458A-CF77-11D3-B38F-00105A1F473A}';
  3831.     EventIID:  '';
  3832.     LicenseKey: nil;
  3833.     Version: 500);
  3834. begin
  3835.   ServerData := @CServerData;
  3836. end;
  3837.  
  3838. procedure TSWbemDateTime.Connect;
  3839. var
  3840.   punk: IUnknown;
  3841. begin
  3842.   if FIntf = nil then
  3843.   begin
  3844.     punk := GetServer;
  3845.     Fintf:= punk as ISWbemDateTime;
  3846.   end;
  3847. end;
  3848.  
  3849. procedure TSWbemDateTime.ConnectTo(svrIntf: ISWbemDateTime);
  3850. begin
  3851.   Disconnect;
  3852.   FIntf := svrIntf;
  3853. end;
  3854.  
  3855. procedure TSWbemDateTime.DisConnect;
  3856. begin
  3857.   if Fintf <> nil then
  3858.   begin
  3859.     FIntf := nil;
  3860.   end;
  3861. end;
  3862.  
  3863. function TSWbemDateTime.GetDefaultInterface: ISWbemDateTime;
  3864. begin
  3865.   if FIntf = nil then
  3866.     Connect;
  3867.   Assert(FIntf <> nil, 'DefaultInterface is NULL. Component is not connected to Server. You must call ''Connect'' or ''ConnectTo'' before this operation');
  3868.   Result := FIntf;
  3869. end;
  3870.  
  3871. constructor TSWbemDateTime.Create(AOwner: TComponent);
  3872. begin
  3873.   inherited Create(AOwner);
  3874. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  3875.   FProps := TSWbemDateTimeProperties.Create(Self);
  3876. {$ENDIF}
  3877. end;
  3878.  
  3879. destructor TSWbemDateTime.Destroy;
  3880. begin
  3881. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  3882.   FProps.Free;
  3883. {$ENDIF}
  3884.   inherited Destroy;
  3885. end;
  3886.  
  3887. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  3888. function TSWbemDateTime.GetServerProperties: TSWbemDateTimeProperties;
  3889. begin
  3890.   Result := FProps;
  3891. end;
  3892. {$ENDIF}
  3893.  
  3894. function TSWbemDateTime.Get_Value: WideString;
  3895. begin
  3896.     Result := DefaultInterface.Value;
  3897. end;
  3898.  
  3899. procedure TSWbemDateTime.Set_Value(const strValue: WideString);
  3900.   { Warning: The property Value has a setter and a getter whose
  3901.   types do not match. Delphi was unable to generate a property of
  3902.   this sort and so is using a Variant to set the property instead. }
  3903. var
  3904.   InterfaceVariant: OleVariant;
  3905. begin
  3906.   InterfaceVariant := DefaultInterface;
  3907.   InterfaceVariant.Value := strValue;
  3908. end;
  3909.  
  3910. function TSWbemDateTime.Get_Year: Integer;
  3911. begin
  3912.     Result := DefaultInterface.Year;
  3913. end;
  3914.  
  3915. procedure TSWbemDateTime.Set_Year(iYear: Integer);
  3916. begin
  3917.   Exit;
  3918. end;
  3919.  
  3920. function TSWbemDateTime.Get_YearSpecified: WordBool;
  3921. begin
  3922.     Result := DefaultInterface.YearSpecified;
  3923. end;
  3924.  
  3925. procedure TSWbemDateTime.Set_YearSpecified(bYearSpecified: WordBool);
  3926. begin
  3927.   Exit;
  3928. end;
  3929.  
  3930. function TSWbemDateTime.Get_Month: Integer;
  3931. begin
  3932.     Result := DefaultInterface.Month;
  3933. end;
  3934.  
  3935. procedure TSWbemDateTime.Set_Month(iMonth: Integer);
  3936. begin
  3937.   Exit;
  3938. end;
  3939.  
  3940. function TSWbemDateTime.Get_MonthSpecified: WordBool;
  3941. begin
  3942.     Result := DefaultInterface.MonthSpecified;
  3943. end;
  3944.  
  3945. procedure TSWbemDateTime.Set_MonthSpecified(bMonthSpecified: WordBool);
  3946. begin
  3947.   Exit;
  3948. end;
  3949.  
  3950. function TSWbemDateTime.Get_Day: Integer;
  3951. begin
  3952.     Result := DefaultInterface.Day;
  3953. end;
  3954.  
  3955. procedure TSWbemDateTime.Set_Day(iDay: Integer);
  3956. begin
  3957.   Exit;
  3958. end;
  3959.  
  3960. function TSWbemDateTime.Get_DaySpecified: WordBool;
  3961. begin
  3962.     Result := DefaultInterface.DaySpecified;
  3963. end;
  3964.  
  3965. procedure TSWbemDateTime.Set_DaySpecified(bDaySpecified: WordBool);
  3966. begin
  3967.   Exit;
  3968. end;
  3969.  
  3970. function TSWbemDateTime.Get_Hours: Integer;
  3971. begin
  3972.     Result := DefaultInterface.Hours;
  3973. end;
  3974.  
  3975. procedure TSWbemDateTime.Set_Hours(iHours: Integer);
  3976. begin
  3977.   Exit;
  3978. end;
  3979.  
  3980. function TSWbemDateTime.Get_HoursSpecified: WordBool;
  3981. begin
  3982.     Result := DefaultInterface.HoursSpecified;
  3983. end;
  3984.  
  3985. procedure TSWbemDateTime.Set_HoursSpecified(bHoursSpecified: WordBool);
  3986. begin
  3987.   Exit;
  3988. end;
  3989.  
  3990. function TSWbemDateTime.Get_Minutes: Integer;
  3991. begin
  3992.     Result := DefaultInterface.Minutes;
  3993. end;
  3994.  
  3995. procedure TSWbemDateTime.Set_Minutes(iMinutes: Integer);
  3996. begin
  3997.   Exit;
  3998. end;
  3999.  
  4000. function TSWbemDateTime.Get_MinutesSpecified: WordBool;
  4001. begin
  4002.     Result := DefaultInterface.MinutesSpecified;
  4003. end;
  4004.  
  4005. procedure TSWbemDateTime.Set_MinutesSpecified(bMinutesSpecified: WordBool);
  4006. begin
  4007.   Exit;
  4008. end;
  4009.  
  4010. function TSWbemDateTime.Get_Seconds: Integer;
  4011. begin
  4012.     Result := DefaultInterface.Seconds;
  4013. end;
  4014.  
  4015. procedure TSWbemDateTime.Set_Seconds(iSeconds: Integer);
  4016. begin
  4017.   Exit;
  4018. end;
  4019.  
  4020. function TSWbemDateTime.Get_SecondsSpecified: WordBool;
  4021. begin
  4022.     Result := DefaultInterface.SecondsSpecified;
  4023. end;
  4024.  
  4025. procedure TSWbemDateTime.Set_SecondsSpecified(bSecondsSpecified: WordBool);
  4026. begin
  4027.   Exit;
  4028. end;
  4029.  
  4030. function TSWbemDateTime.Get_Microseconds: Integer;
  4031. begin
  4032.     Result := DefaultInterface.Microseconds;
  4033. end;
  4034.  
  4035. procedure TSWbemDateTime.Set_Microseconds(iMicroseconds: Integer);
  4036. begin
  4037.   Exit;
  4038. end;
  4039.  
  4040. function TSWbemDateTime.Get_MicrosecondsSpecified: WordBool;
  4041. begin
  4042.     Result := DefaultInterface.MicrosecondsSpecified;
  4043. end;
  4044.  
  4045. procedure TSWbemDateTime.Set_MicrosecondsSpecified(bMicrosecondsSpecified: WordBool);
  4046. begin
  4047.   Exit;
  4048. end;
  4049.  
  4050. function TSWbemDateTime.Get_UTC: Integer;
  4051. begin
  4052.     Result := DefaultInterface.UTC;
  4053. end;
  4054.  
  4055. procedure TSWbemDateTime.Set_UTC(iUTC: Integer);
  4056. begin
  4057.   Exit;
  4058. end;
  4059.  
  4060. function TSWbemDateTime.Get_UTCSpecified: WordBool;
  4061. begin
  4062.     Result := DefaultInterface.UTCSpecified;
  4063. end;
  4064.  
  4065. procedure TSWbemDateTime.Set_UTCSpecified(bUTCSpecified: WordBool);
  4066. begin
  4067.   Exit;
  4068. end;
  4069.  
  4070. function TSWbemDateTime.Get_IsInterval: WordBool;
  4071. begin
  4072.     Result := DefaultInterface.IsInterval;
  4073. end;
  4074.  
  4075. procedure TSWbemDateTime.Set_IsInterval(bIsInterval: WordBool);
  4076. begin
  4077.   Exit;
  4078. end;
  4079.  
  4080. function TSWbemDateTime.GetVarDate(bIsLocal: WordBool): TDateTime;
  4081. begin
  4082.   Result := DefaultInterface.GetVarDate(bIsLocal);
  4083. end;
  4084.  
  4085. procedure TSWbemDateTime.SetVarDate(dVarDate: TDateTime; bIsLocal: WordBool);
  4086. begin
  4087.   DefaultInterface.SetVarDate(dVarDate, bIsLocal);
  4088. end;
  4089.  
  4090. function TSWbemDateTime.GetFileTime(bIsLocal: WordBool): WideString;
  4091. begin
  4092.   Result := DefaultInterface.GetFileTime(bIsLocal);
  4093. end;
  4094.  
  4095. procedure TSWbemDateTime.SetFileTime(const strFileTime: WideString; bIsLocal: WordBool);
  4096. begin
  4097.   DefaultInterface.SetFileTime(strFileTime, bIsLocal);
  4098. end;
  4099.  
  4100. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  4101. constructor TSWbemDateTimeProperties.Create(AServer: TSWbemDateTime);
  4102. begin
  4103.   inherited Create;
  4104.   FServer := AServer;
  4105. end;
  4106.  
  4107. function TSWbemDateTimeProperties.GetDefaultInterface: ISWbemDateTime;
  4108. begin
  4109.   Result := FServer.DefaultInterface;
  4110. end;
  4111.  
  4112. function TSWbemDateTimeProperties.Get_Value: WideString;
  4113. begin
  4114.     Result := DefaultInterface.Value;
  4115. end;
  4116.  
  4117. procedure TSWbemDateTimeProperties.Set_Value(const strValue: WideString);
  4118.   { Warning: The property Value has a setter and a getter whose
  4119.   types do not match. Delphi was unable to generate a property of
  4120.   this sort and so is using a Variant to set the property instead. }
  4121. var
  4122.   InterfaceVariant: OleVariant;
  4123. begin
  4124.   InterfaceVariant := DefaultInterface;
  4125.   InterfaceVariant.Value := strValue;
  4126. end;
  4127.  
  4128. function TSWbemDateTimeProperties.Get_Year: Integer;
  4129. begin
  4130.     Result := DefaultInterface.Year;
  4131. end;
  4132.  
  4133. procedure TSWbemDateTimeProperties.Set_Year(iYear: Integer);
  4134. begin
  4135.   Exit;
  4136. end;
  4137.  
  4138. function TSWbemDateTimeProperties.Get_YearSpecified: WordBool;
  4139. begin
  4140.     Result := DefaultInterface.YearSpecified;
  4141. end;
  4142.  
  4143. procedure TSWbemDateTimeProperties.Set_YearSpecified(bYearSpecified: WordBool);
  4144. begin
  4145.   Exit;
  4146. end;
  4147.  
  4148. function TSWbemDateTimeProperties.Get_Month: Integer;
  4149. begin
  4150.     Result := DefaultInterface.Month;
  4151. end;
  4152.  
  4153. procedure TSWbemDateTimeProperties.Set_Month(iMonth: Integer);
  4154. begin
  4155.   Exit;
  4156. end;
  4157.  
  4158. function TSWbemDateTimeProperties.Get_MonthSpecified: WordBool;
  4159. begin
  4160.     Result := DefaultInterface.MonthSpecified;
  4161. end;
  4162.  
  4163. procedure TSWbemDateTimeProperties.Set_MonthSpecified(bMonthSpecified: WordBool);
  4164. begin
  4165.   Exit;
  4166. end;
  4167.  
  4168. function TSWbemDateTimeProperties.Get_Day: Integer;
  4169. begin
  4170.     Result := DefaultInterface.Day;
  4171. end;
  4172.  
  4173. procedure TSWbemDateTimeProperties.Set_Day(iDay: Integer);
  4174. begin
  4175.   Exit;
  4176. end;
  4177.  
  4178. function TSWbemDateTimeProperties.Get_DaySpecified: WordBool;
  4179. begin
  4180.     Result := DefaultInterface.DaySpecified;
  4181. end;
  4182.  
  4183. procedure TSWbemDateTimeProperties.Set_DaySpecified(bDaySpecified: WordBool);
  4184. begin
  4185.   Exit;
  4186. end;
  4187.  
  4188. function TSWbemDateTimeProperties.Get_Hours: Integer;
  4189. begin
  4190.     Result := DefaultInterface.Hours;
  4191. end;
  4192.  
  4193. procedure TSWbemDateTimeProperties.Set_Hours(iHours: Integer);
  4194. begin
  4195.   Exit;
  4196. end;
  4197.  
  4198. function TSWbemDateTimeProperties.Get_HoursSpecified: WordBool;
  4199. begin
  4200.     Result := DefaultInterface.HoursSpecified;
  4201. end;
  4202.  
  4203. procedure TSWbemDateTimeProperties.Set_HoursSpecified(bHoursSpecified: WordBool);
  4204. begin
  4205.   Exit;
  4206. end;
  4207.  
  4208. function TSWbemDateTimeProperties.Get_Minutes: Integer;
  4209. begin
  4210.     Result := DefaultInterface.Minutes;
  4211. end;
  4212.  
  4213. procedure TSWbemDateTimeProperties.Set_Minutes(iMinutes: Integer);
  4214. begin
  4215.   Exit;
  4216. end;
  4217.  
  4218. function TSWbemDateTimeProperties.Get_MinutesSpecified: WordBool;
  4219. begin
  4220.     Result := DefaultInterface.MinutesSpecified;
  4221. end;
  4222.  
  4223. procedure TSWbemDateTimeProperties.Set_MinutesSpecified(bMinutesSpecified: WordBool);
  4224. begin
  4225.   Exit;
  4226. end;
  4227.  
  4228. function TSWbemDateTimeProperties.Get_Seconds: Integer;
  4229. begin
  4230.     Result := DefaultInterface.Seconds;
  4231. end;
  4232.  
  4233. procedure TSWbemDateTimeProperties.Set_Seconds(iSeconds: Integer);
  4234. begin
  4235.   Exit;
  4236. end;
  4237.  
  4238. function TSWbemDateTimeProperties.Get_SecondsSpecified: WordBool;
  4239. begin
  4240.     Result := DefaultInterface.SecondsSpecified;
  4241. end;
  4242.  
  4243. procedure TSWbemDateTimeProperties.Set_SecondsSpecified(bSecondsSpecified: WordBool);
  4244. begin
  4245.   Exit;
  4246. end;
  4247.  
  4248. function TSWbemDateTimeProperties.Get_Microseconds: Integer;
  4249. begin
  4250.     Result := DefaultInterface.Microseconds;
  4251. end;
  4252.  
  4253. procedure TSWbemDateTimeProperties.Set_Microseconds(iMicroseconds: Integer);
  4254. begin
  4255.   Exit;
  4256. end;
  4257.  
  4258. function TSWbemDateTimeProperties.Get_MicrosecondsSpecified: WordBool;
  4259. begin
  4260.     Result := DefaultInterface.MicrosecondsSpecified;
  4261. end;
  4262.  
  4263. procedure TSWbemDateTimeProperties.Set_MicrosecondsSpecified(bMicrosecondsSpecified: WordBool);
  4264. begin
  4265.   Exit;
  4266. end;
  4267.  
  4268. function TSWbemDateTimeProperties.Get_UTC: Integer;
  4269. begin
  4270.     Result := DefaultInterface.UTC;
  4271. end;
  4272.  
  4273. procedure TSWbemDateTimeProperties.Set_UTC(iUTC: Integer);
  4274. begin
  4275.   Exit;
  4276. end;
  4277.  
  4278. function TSWbemDateTimeProperties.Get_UTCSpecified: WordBool;
  4279. begin
  4280.     Result := DefaultInterface.UTCSpecified;
  4281. end;
  4282.  
  4283. procedure TSWbemDateTimeProperties.Set_UTCSpecified(bUTCSpecified: WordBool);
  4284. begin
  4285.   Exit;
  4286. end;
  4287.  
  4288. function TSWbemDateTimeProperties.Get_IsInterval: WordBool;
  4289. begin
  4290.     Result := DefaultInterface.IsInterval;
  4291. end;
  4292.  
  4293. procedure TSWbemDateTimeProperties.Set_IsInterval(bIsInterval: WordBool);
  4294. begin
  4295.   Exit;
  4296. end;
  4297.  
  4298. {$ENDIF}
  4299.  
  4300. class function CoSWbemRefresher.Create: ISWbemRefresher;
  4301. begin
  4302.   Result := CreateComObject(CLASS_SWbemRefresher) as ISWbemRefresher;
  4303. end;
  4304.  
  4305. class function CoSWbemRefresher.CreateRemote(const MachineName: string): ISWbemRefresher;
  4306. begin
  4307.   Result := CreateRemoteComObject(MachineName, CLASS_SWbemRefresher) as ISWbemRefresher;
  4308. end;
  4309.  
  4310. procedure TSWbemRefresher.InitServerData;
  4311. const
  4312.   CServerData: TServerData = (
  4313.     ClassID:   '{D269BF5C-D9C1-11D3-B38F-00105A1F473A}';
  4314.     IntfIID:   '{14D8250E-D9C2-11D3-B38F-00105A1F473A}';
  4315.     EventIID:  '';
  4316.     LicenseKey: nil;
  4317.     Version: 500);
  4318. begin
  4319.   ServerData := @CServerData;
  4320. end;
  4321.  
  4322. procedure TSWbemRefresher.Connect;
  4323. var
  4324.   punk: IUnknown;
  4325. begin
  4326.   if FIntf = nil then
  4327.   begin
  4328.     punk := GetServer;
  4329.     Fintf:= punk as ISWbemRefresher;
  4330.   end;
  4331. end;
  4332.  
  4333. procedure TSWbemRefresher.ConnectTo(svrIntf: ISWbemRefresher);
  4334. begin
  4335.   Disconnect;
  4336.   FIntf := svrIntf;
  4337. end;
  4338.  
  4339. procedure TSWbemRefresher.DisConnect;
  4340. begin
  4341.   if Fintf <> nil then
  4342.   begin
  4343.     FIntf := nil;
  4344.   end;
  4345. end;
  4346.  
  4347. function TSWbemRefresher.GetDefaultInterface: ISWbemRefresher;
  4348. begin
  4349.   if FIntf = nil then
  4350.     Connect;
  4351.   Assert(FIntf <> nil, 'DefaultInterface is NULL. Component is not connected to Server. You must call ''Connect'' or ''ConnectTo'' before this operation');
  4352.   Result := FIntf;
  4353. end;
  4354.  
  4355. constructor TSWbemRefresher.Create(AOwner: TComponent);
  4356. begin
  4357.   inherited Create(AOwner);
  4358. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  4359.   FProps := TSWbemRefresherProperties.Create(Self);
  4360. {$ENDIF}
  4361. end;
  4362.  
  4363. destructor TSWbemRefresher.Destroy;
  4364. begin
  4365. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  4366.   FProps.Free;
  4367. {$ENDIF}
  4368.   inherited Destroy;
  4369. end;
  4370.  
  4371. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  4372. function TSWbemRefresher.GetServerProperties: TSWbemRefresherProperties;
  4373. begin
  4374.   Result := FProps;
  4375. end;
  4376. {$ENDIF}
  4377.  
  4378. function TSWbemRefresher.Get_Count: Integer;
  4379. begin
  4380.     Result := DefaultInterface.Count;
  4381. end;
  4382.  
  4383. function TSWbemRefresher.Get_AutoReconnect: WordBool;
  4384. begin
  4385.     Result := DefaultInterface.AutoReconnect;
  4386. end;
  4387.  
  4388. procedure TSWbemRefresher.Set_AutoReconnect(bCount: WordBool);
  4389. begin
  4390.   Exit;
  4391. end;
  4392.  
  4393. function TSWbemRefresher.Item(iIndex: Integer): ISWbemRefreshableItem;
  4394. begin
  4395.   Result := DefaultInterface.Item(iIndex);
  4396. end;
  4397.  
  4398. function TSWbemRefresher.Add(const objWbemServices: ISWbemServicesEx;
  4399.                              const bsInstancePath: WideString; iFlags: Integer;
  4400.                              const objWbemNamedValueSet: IDispatch): ISWbemRefreshableItem;
  4401. begin
  4402.   Result := DefaultInterface.Add(objWbemServices, bsInstancePath, iFlags, objWbemNamedValueSet);
  4403. end;
  4404.  
  4405. function TSWbemRefresher.AddEnum(const objWbemServices: ISWbemServicesEx;
  4406.                                  const bsClassName: WideString; iFlags: Integer;
  4407.                                  const objWbemNamedValueSet: IDispatch): ISWbemRefreshableItem;
  4408. begin
  4409.   Result := DefaultInterface.AddEnum(objWbemServices, bsClassName, iFlags, objWbemNamedValueSet);
  4410. end;
  4411.  
  4412. procedure TSWbemRefresher.Remove(iIndex: Integer; iFlags: Integer);
  4413. begin
  4414.   DefaultInterface.Remove(iIndex, iFlags);
  4415. end;
  4416.  
  4417. procedure TSWbemRefresher.Refresh(iFlags: Integer);
  4418. begin
  4419.   DefaultInterface.Refresh(iFlags);
  4420. end;
  4421.  
  4422. procedure TSWbemRefresher.DeleteAll;
  4423. begin
  4424.   DefaultInterface.DeleteAll;
  4425. end;
  4426.  
  4427. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  4428. constructor TSWbemRefresherProperties.Create(AServer: TSWbemRefresher);
  4429. begin
  4430.   inherited Create;
  4431.   FServer := AServer;
  4432. end;
  4433.  
  4434. function TSWbemRefresherProperties.GetDefaultInterface: ISWbemRefresher;
  4435. begin
  4436.   Result := FServer.DefaultInterface;
  4437. end;
  4438.  
  4439. function TSWbemRefresherProperties.Get_Count: Integer;
  4440. begin
  4441.     Result := DefaultInterface.Count;
  4442. end;
  4443.  
  4444. function TSWbemRefresherProperties.Get_AutoReconnect: WordBool;
  4445. begin
  4446.     Result := DefaultInterface.AutoReconnect;
  4447. end;
  4448.  
  4449. procedure TSWbemRefresherProperties.Set_AutoReconnect(bCount: WordBool);
  4450. begin
  4451.   Exit;
  4452. end;
  4453.  
  4454. {$ENDIF}
  4455.  
  4456. class function CoSWbemServices.Create: ISWbemServices;
  4457. begin
  4458.   Result := CreateComObject(CLASS_SWbemServices) as ISWbemServices;
  4459. end;
  4460.  
  4461. class function CoSWbemServices.CreateRemote(const MachineName: string): ISWbemServices;
  4462. begin
  4463.   Result := CreateRemoteComObject(MachineName, CLASS_SWbemServices) as ISWbemServices;
  4464. end;
  4465.  
  4466. class function CoSWbemServicesEx.Create: ISWbemServicesEx;
  4467. begin
  4468.   Result := CreateComObject(CLASS_SWbemServicesEx) as ISWbemServicesEx;
  4469. end;
  4470.  
  4471. class function CoSWbemServicesEx.CreateRemote(const MachineName: string): ISWbemServicesEx;
  4472. begin
  4473.   Result := CreateRemoteComObject(MachineName, CLASS_SWbemServicesEx) as ISWbemServicesEx;
  4474. end;
  4475.  
  4476. class function CoSWbemObject.Create: ISWbemObject;
  4477. begin
  4478.   Result := CreateComObject(CLASS_SWbemObject) as ISWbemObject;
  4479. end;
  4480.  
  4481. class function CoSWbemObject.CreateRemote(const MachineName: string): ISWbemObject;
  4482. begin
  4483.   Result := CreateRemoteComObject(MachineName, CLASS_SWbemObject) as ISWbemObject;
  4484. end;
  4485.  
  4486. class function CoSWbemObjectEx.Create: ISWbemObjectEx;
  4487. begin
  4488.   Result := CreateComObject(CLASS_SWbemObjectEx) as ISWbemObjectEx;
  4489. end;
  4490.  
  4491. class function CoSWbemObjectEx.CreateRemote(const MachineName: string): ISWbemObjectEx;
  4492. begin
  4493.   Result := CreateRemoteComObject(MachineName, CLASS_SWbemObjectEx) as ISWbemObjectEx;
  4494. end;
  4495.  
  4496. class function CoSWbemObjectSet.Create: ISWbemObjectSet;
  4497. begin
  4498.   Result := CreateComObject(CLASS_SWbemObjectSet) as ISWbemObjectSet;
  4499. end;
  4500.  
  4501. class function CoSWbemObjectSet.CreateRemote(const MachineName: string): ISWbemObjectSet;
  4502. begin
  4503.   Result := CreateRemoteComObject(MachineName, CLASS_SWbemObjectSet) as ISWbemObjectSet;
  4504. end;
  4505.  
  4506. class function CoSWbemNamedValue.Create: ISWbemNamedValue;
  4507. begin
  4508.   Result := CreateComObject(CLASS_SWbemNamedValue) as ISWbemNamedValue;
  4509. end;
  4510.  
  4511. class function CoSWbemNamedValue.CreateRemote(const MachineName: string): ISWbemNamedValue;
  4512. begin
  4513.   Result := CreateRemoteComObject(MachineName, CLASS_SWbemNamedValue) as ISWbemNamedValue;
  4514. end;
  4515.  
  4516. class function CoSWbemQualifier.Create: ISWbemQualifier;
  4517. begin
  4518.   Result := CreateComObject(CLASS_SWbemQualifier) as ISWbemQualifier;
  4519. end;
  4520.  
  4521. class function CoSWbemQualifier.CreateRemote(const MachineName: string): ISWbemQualifier;
  4522. begin
  4523.   Result := CreateRemoteComObject(MachineName, CLASS_SWbemQualifier) as ISWbemQualifier;
  4524. end;
  4525.  
  4526. class function CoSWbemQualifierSet.Create: ISWbemQualifierSet;
  4527. begin
  4528.   Result := CreateComObject(CLASS_SWbemQualifierSet) as ISWbemQualifierSet;
  4529. end;
  4530.  
  4531. class function CoSWbemQualifierSet.CreateRemote(const MachineName: string): ISWbemQualifierSet;
  4532. begin
  4533.   Result := CreateRemoteComObject(MachineName, CLASS_SWbemQualifierSet) as ISWbemQualifierSet;
  4534. end;
  4535.  
  4536. class function CoSWbemProperty.Create: ISWbemProperty;
  4537. begin
  4538.   Result := CreateComObject(CLASS_SWbemProperty) as ISWbemProperty;
  4539. end;
  4540.  
  4541. class function CoSWbemProperty.CreateRemote(const MachineName: string): ISWbemProperty;
  4542. begin
  4543.   Result := CreateRemoteComObject(MachineName, CLASS_SWbemProperty) as ISWbemProperty;
  4544. end;
  4545.  
  4546. class function CoSWbemPropertySet.Create: ISWbemPropertySet;
  4547. begin
  4548.   Result := CreateComObject(CLASS_SWbemPropertySet) as ISWbemPropertySet;
  4549. end;
  4550.  
  4551. class function CoSWbemPropertySet.CreateRemote(const MachineName: string): ISWbemPropertySet;
  4552. begin
  4553.   Result := CreateRemoteComObject(MachineName, CLASS_SWbemPropertySet) as ISWbemPropertySet;
  4554. end;
  4555.  
  4556. class function CoSWbemMethod.Create: ISWbemMethod;
  4557. begin
  4558.   Result := CreateComObject(CLASS_SWbemMethod) as ISWbemMethod;
  4559. end;
  4560.  
  4561. class function CoSWbemMethod.CreateRemote(const MachineName: string): ISWbemMethod;
  4562. begin
  4563.   Result := CreateRemoteComObject(MachineName, CLASS_SWbemMethod) as ISWbemMethod;
  4564. end;
  4565.  
  4566. class function CoSWbemMethodSet.Create: ISWbemMethodSet;
  4567. begin
  4568.   Result := CreateComObject(CLASS_SWbemMethodSet) as ISWbemMethodSet;
  4569. end;
  4570.  
  4571. class function CoSWbemMethodSet.CreateRemote(const MachineName: string): ISWbemMethodSet;
  4572. begin
  4573.   Result := CreateRemoteComObject(MachineName, CLASS_SWbemMethodSet) as ISWbemMethodSet;
  4574. end;
  4575.  
  4576. class function CoSWbemEventSource.Create: ISWbemEventSource;
  4577. begin
  4578.   Result := CreateComObject(CLASS_SWbemEventSource) as ISWbemEventSource;
  4579. end;
  4580.  
  4581. class function CoSWbemEventSource.CreateRemote(const MachineName: string): ISWbemEventSource;
  4582. begin
  4583.   Result := CreateRemoteComObject(MachineName, CLASS_SWbemEventSource) as ISWbemEventSource;
  4584. end;
  4585.  
  4586. class function CoSWbemSecurity.Create: ISWbemSecurity;
  4587. begin
  4588.   Result := CreateComObject(CLASS_SWbemSecurity) as ISWbemSecurity;
  4589. end;
  4590.  
  4591. class function CoSWbemSecurity.CreateRemote(const MachineName: string): ISWbemSecurity;
  4592. begin
  4593.   Result := CreateRemoteComObject(MachineName, CLASS_SWbemSecurity) as ISWbemSecurity;
  4594. end;
  4595.  
  4596. class function CoSWbemPrivilege.Create: ISWbemPrivilege;
  4597. begin
  4598.   Result := CreateComObject(CLASS_SWbemPrivilege) as ISWbemPrivilege;
  4599. end;
  4600.  
  4601. class function CoSWbemPrivilege.CreateRemote(const MachineName: string): ISWbemPrivilege;
  4602. begin
  4603.   Result := CreateRemoteComObject(MachineName, CLASS_SWbemPrivilege) as ISWbemPrivilege;
  4604. end;
  4605.  
  4606. class function CoSWbemPrivilegeSet.Create: ISWbemPrivilegeSet;
  4607. begin
  4608.   Result := CreateComObject(CLASS_SWbemPrivilegeSet) as ISWbemPrivilegeSet;
  4609. end;
  4610.  
  4611. class function CoSWbemPrivilegeSet.CreateRemote(const MachineName: string): ISWbemPrivilegeSet;
  4612. begin
  4613.   Result := CreateRemoteComObject(MachineName, CLASS_SWbemPrivilegeSet) as ISWbemPrivilegeSet;
  4614. end;
  4615.  
  4616. class function CoSWbemRefreshableItem.Create: ISWbemRefreshableItem;
  4617. begin
  4618.   Result := CreateComObject(CLASS_SWbemRefreshableItem) as ISWbemRefreshableItem;
  4619. end;
  4620.  
  4621. class function CoSWbemRefreshableItem.CreateRemote(const MachineName: string): ISWbemRefreshableItem;
  4622. begin
  4623.   Result := CreateRemoteComObject(MachineName, CLASS_SWbemRefreshableItem) as ISWbemRefreshableItem;
  4624. end;
  4625.  
  4626. procedure Register;
  4627. begin
  4628.   RegisterComponents(dtlServerPage, [TSWbemLocator, TSWbemNamedValueSet, TSWbemObjectPath, TSWbemLastError,
  4629.     TSWbemSink, TSWbemDateTime, TSWbemRefresher]);
  4630. end;
  4631.  
  4632. function MagWmiGetPropStr (wmiProp: ISWbemProperty): string ;
  4633. var
  4634.     I: integer ;
  4635. begin
  4636.     result := '';
  4637.     if VarIsNull(wmiProp.Get_Value) then
  4638.         result := 'NULL'
  4639.     else
  4640.     begin
  4641.         case wmiProp.CIMType of
  4642.             wbemCimtypeSint8, wbemCimtypeUint8, wbemCimtypeSint16,
  4643.             wbemCimtypeUint16, wbemCimtypeSint32, wbemCimtypeUint32,
  4644.             wbemCimtypeSint64:
  4645.                 if VarIsArray(wmiProp.Get_Value) then
  4646.                 begin
  4647.                     for I := 0 to VarArrayHighBound (wmiProp.Get_Value, 1) do
  4648.                     begin
  4649.                         if I > 0 then result := result + '|' ;
  4650.                         result := result + IntToStr (wmiProp.Get_Value [I]) ;
  4651.                     end ;
  4652.                 end
  4653.                 else
  4654.                     result := IntToStr (wmiProp.Get_Value);
  4655.  
  4656.             wbemCimtypeReal32, wbemCimtypeReal64:
  4657.                 result := FloatToStr (wmiProp.Get_Value);
  4658.  
  4659.             wbemCimtypeBoolean:
  4660.                 if wmiProp.Get_Value then result := 'True' else result := 'False';
  4661.  
  4662.             wbemCimtypeString, wbemCimtypeUint64:
  4663.                 if VarIsArray(wmiProp.Get_Value) then
  4664.                 begin
  4665.                     for I := 0 to VarArrayHighBound (wmiProp.Get_Value, 1) do
  4666.                     begin
  4667.                         if I > 0 then result := result + '|' ;
  4668.                         result := result + wmiProp.Get_Value [I] ;
  4669.                     end ;
  4670.                 end
  4671.                 else
  4672.                     result := wmiProp.Get_Value;
  4673.  
  4674.             wbemCimtypeDatetime:
  4675.                 result := wmiProp.Get_Value;
  4676.  
  4677.             wbemCimtypeReference:
  4678.             begin
  4679.                 result := wmiProp.Get_Value ;
  4680.             // Services.Get(result, 0, nil).GetObjectText_(0));  another query
  4681.             end;
  4682.  
  4683.             wbemCimtypeChar16:
  4684.                 result := '<16-bit character>';
  4685.  
  4686.             wbemCimtypeObject:
  4687.                 result := '<CIM Object>';
  4688.         end ;
  4689.     end;
  4690. end ;
  4691.  
  4692. function GetExceptMess (ExceptObject: TObject): string;
  4693. var
  4694.   MsgPtr: PChar;
  4695.   MsgEnd: PChar;
  4696.   MsgLen: Integer;
  4697.   MessEnd: String ;
  4698. begin
  4699.   MsgPtr := '';
  4700.   MsgEnd := '';
  4701.   if ExceptObject is Exception then
  4702.   begin
  4703.     MsgPtr := PChar(Exception(ExceptObject).Message);
  4704.     MsgLen := StrLen(MsgPtr);
  4705.     if (MsgLen <> 0) and (MsgPtr[MsgLen - 1] <> '.') then MsgEnd := '.';
  4706.   end;
  4707.   result := Trim (MsgPtr) ;
  4708.   MessEnd := Trim (MsgEnd) ;
  4709.   if Length (MessEnd) > 5 then result := result + ' - ' + MessEnd ;
  4710. end;
  4711.  
  4712. function MagWmiGetInfoEx (const Comp, NameSpace, User, Pass, Arg: string ;
  4713.       var WmiResults: T2DimStrArray; var instances: integer; var errinfo: string): integer ;
  4714. var
  4715.     wmiLocator: TSWbemLocator;
  4716.     wmiServices: ISWbemServices;
  4717.     wmiObjectSet: ISWbemObjectSet;
  4718.     wmiObject: ISWbemObject;
  4719.     propSet: ISWbemPropertySet;
  4720.     wmiProp: ISWbemProperty;
  4721.     propEnum, Enum: IEnumVariant;
  4722.     ovVar1, ovVar2: OleVariant;  // 5.2
  4723.     lwValue: LongWord;
  4724.     sValue: String;
  4725.     inst, row: integer ;
  4726.     dimmed: boolean ;
  4727. begin
  4728.     result := 0 ;
  4729.     errinfo := '' ;
  4730.     Instances := 0 ;
  4731.     SetLength (WmiResults, 0, 0) ;
  4732.     dimmed := false ;
  4733.     VarClear (ovVar1) ;   // 5.2
  4734.     VarClear (ovVar2) ;   // 5.2
  4735.     wmiLocator := TSWbemLocator.Create (Nil) ;
  4736.     try
  4737.     try
  4738.         wmiServices := wmiLocator.ConnectServer (Comp, Namespace, User, Pass,
  4739.                                                                         '', '', 0, nil) ;
  4740.         if Pos ('SELECT', Arg) = 1 then
  4741.             wmiObjectSet := wmiServices.ExecQuery (Arg, 'WQL', wbemFlagReturnImmediately, nil)
  4742.         else
  4743.             wmiObjectSet := wmiServices.InstancesOf (Arg, wbemFlagReturnImmediately or
  4744.                                                              wbemQueryFlagShallow, nil) ;
  4745.         Instances := wmiObjectSet.Count ;
  4746.         if Instances = 0 then exit ;
  4747.  
  4748.         // Replicate VBScript's "for each" construct
  4749.         Enum := (wmiObjectSet._NewEnum) as IEnumVariant;
  4750.         inst := 0 ;
  4751.         while (Enum.Next (1, ovVar1, lwValue) = S_OK) do    // 5.2
  4752.         begin
  4753.             wmiObject := IUnknown(ovVar1) as SWBemObject;   // 5.2
  4754.             propSet := wmiObject.Properties_;
  4755.             result := propSet.Count ;
  4756.             if NOT dimmed then
  4757.             begin
  4758.                 SetLength (WmiResults, Instances + 1, result + 1) ;
  4759.                 WmiResults [0, 0] := 'Instance' ;
  4760.                 dimmed := true ;
  4761.             end ;
  4762.             propEnum := (propSet._NewEnum) as IEnumVariant;
  4763.             inc (inst) ;
  4764.             row := 1 ;
  4765.             WmiResults [inst, 0] := IntToStr (inst) ;
  4766.  
  4767.        // Replicate VBScript's "for each" construct
  4768.             while (propEnum.Next (1, ovVar2, lwValue) = S_OK) do  // 5.2
  4769.             begin
  4770.                 wmiProp := IUnknown(ovVar2) as SWBemProperty;     // 5.2
  4771.                 sValue := MagWmiGetPropStr (wmiProp) ;
  4772.                 if inst = 1 then WmiResults [0, row] := wmiProp.Name ;
  4773.                 WmiResults [inst, row] := sValue ;
  4774.                 inc (row) ;
  4775.                 VarClear (ovVar2); // 5.2 whomp them mem leaks
  4776.             end;
  4777.             VarClear (ovVar1); // 5.5 clear for each interation, not just once
  4778.         end;
  4779.     except
  4780.         VarClear (ovVar1) ;   // 5.2
  4781.         VarClear (ovVar2) ;   // 5.2
  4782.         result := -1 ;
  4783.         errinfo := GetExceptMess (ExceptObject) ;   // 5.2
  4784.     end ;
  4785.     finally
  4786.         wmiLocator.Free;
  4787.     end;
  4788. end;
  4789.  
  4790. function MagWmiGetInfo (const Comp, NameSpace, User, Pass, Arg: string ;
  4791.      var WmiResults: T2DimStrArray; var Instances: integer): integer ;
  4792. var
  4793.   errinfo: string ;
  4794. begin
  4795.   result := MagWmiGetInfoEx (Comp, NameSpace, User, Pass, Arg, WmiResults, instances, errinfo) ;
  4796. end ;
  4797.  
  4798. function MagWmiSearchIdx (const WmiResults: T2DimStrArray; const Prop: string): integer ;
  4799. var
  4800.     I: integer ;
  4801. begin
  4802.     result := 0 ;
  4803.     for I := 1 to High (WmiResults [0]) do
  4804.     begin
  4805.         if WmiResults [0, I] = Prop then
  4806.         begin
  4807.             result := I ;
  4808.             exit ;
  4809.         end ;
  4810.     end ;
  4811. end ;
  4812.  
  4813. function MagWmiSearch1 (const WmiResults: T2DimStrArray; const Prop: string): string ;
  4814. var
  4815.     I: integer ;
  4816. begin
  4817.     result := '' ;
  4818.     I := MagWmiSearchIdx (WmiResults, Prop) ;
  4819.     if I >= 1 then result := WmiResults [1, I] ;
  4820. end ;
  4821.  
  4822. function MagWmiGetBaseBoard: AnsiString;
  4823. var
  4824.     rows, instances: integer ;
  4825.     WmiResults: T2DimStrArray ;
  4826. begin
  4827.     result := '' ;
  4828.     try
  4829.         rows := MagWmiGetInfo ('', RootNameSpace, '', '',
  4830.             'SELECT Product, Manufacturer, SerialNumber FROM Win32_BaseBoard', WmiResults, instances) ;
  4831.         if (instances = 1) and (rows > 1) then
  4832.             result := Trim(UpperCase(MagWmiSearch1 (WmiResults, 'Manufacturer'))) +
  4833.                       Trim(MagWmiSearch1 (WmiResults, 'Product')) +
  4834.                       Trim(MagWmiSearch1 (WmiResults, 'SerialNumber'));
  4835.             Result:= StringReplace(result   ,' ','',[rfReplaceAll]);
  4836.     finally
  4837.         WmiResults := Nil ;
  4838.     end ;
  4839. end ;
  4840.  
  4841. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement