WbemScripting_TLB.pas
上传用户:lyghuaxia
上传日期:2022-06-27
资源大小:659k
文件大小:200k
源码类别:
Delphi控件源码
开发平台:
Delphi
- procedure Set_DaySpecified(bDaySpecified: WordBool);
- function Get_Hours: Integer;
- procedure Set_Hours(iHours: Integer);
- function Get_HoursSpecified: WordBool;
- procedure Set_HoursSpecified(bHoursSpecified: WordBool);
- function Get_Minutes: Integer;
- procedure Set_Minutes(iMinutes: Integer);
- function Get_MinutesSpecified: WordBool;
- procedure Set_MinutesSpecified(bMinutesSpecified: WordBool);
- function Get_Seconds: Integer;
- procedure Set_Seconds(iSeconds: Integer);
- function Get_SecondsSpecified: WordBool;
- procedure Set_SecondsSpecified(bSecondsSpecified: WordBool);
- function Get_Microseconds: Integer;
- procedure Set_Microseconds(iMicroseconds: Integer);
- function Get_MicrosecondsSpecified: WordBool;
- procedure Set_MicrosecondsSpecified(bMicrosecondsSpecified: WordBool);
- function Get_UTC: Integer;
- procedure Set_UTC(iUTC: Integer);
- function Get_UTCSpecified: WordBool;
- procedure Set_UTCSpecified(bUTCSpecified: WordBool);
- function Get_IsInterval: WordBool;
- procedure Set_IsInterval(bIsInterval: WordBool);
- public
- constructor Create(AOwner: TComponent); override;
- destructor Destroy; override;
- procedure Connect; override;
- procedure ConnectTo(svrIntf: ISWbemDateTime);
- procedure Disconnect; override;
- function GetVarDate(bIsLocal: WordBool): TDateTime;
- procedure SetVarDate(dVarDate: TDateTime; bIsLocal: WordBool);
- function GetFileTime(bIsLocal: WordBool): WideString;
- procedure SetFileTime(const strFileTime: WideString; bIsLocal: WordBool);
- property DefaultInterface: ISWbemDateTime read GetDefaultInterface;
- property Value: WideString read Get_Value write Set_Value;
- property Year: Integer read Get_Year write Set_Year;
- property YearSpecified: WordBool read Get_YearSpecified write Set_YearSpecified;
- property Month: Integer read Get_Month write Set_Month;
- property MonthSpecified: WordBool read Get_MonthSpecified write Set_MonthSpecified;
- property Day: Integer read Get_Day write Set_Day;
- property DaySpecified: WordBool read Get_DaySpecified write Set_DaySpecified;
- property Hours: Integer read Get_Hours write Set_Hours;
- property HoursSpecified: WordBool read Get_HoursSpecified write Set_HoursSpecified;
- property Minutes: Integer read Get_Minutes write Set_Minutes;
- property MinutesSpecified: WordBool read Get_MinutesSpecified write Set_MinutesSpecified;
- property Seconds: Integer read Get_Seconds write Set_Seconds;
- property SecondsSpecified: WordBool read Get_SecondsSpecified write Set_SecondsSpecified;
- property Microseconds: Integer read Get_Microseconds write Set_Microseconds;
- property MicrosecondsSpecified: WordBool read Get_MicrosecondsSpecified write Set_MicrosecondsSpecified;
- property UTC: Integer read Get_UTC write Set_UTC;
- property UTCSpecified: WordBool read Get_UTCSpecified write Set_UTCSpecified;
- property IsInterval: WordBool read Get_IsInterval write Set_IsInterval;
- published
- {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
- property Server: TSWbemDateTimeProperties read GetServerProperties;
- {$ENDIF}
- end;
- {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
- // *********************************************************************//
- // OLE Server Properties Proxy Class
- // Server Object : TSWbemDateTime
- // (This object is used by the IDE's Property Inspector to allow editing
- // of the properties of this server)
- // *********************************************************************//
- TSWbemDateTimeProperties = class(TPersistent)
- private
- FServer: TSWbemDateTime;
- function GetDefaultInterface: ISWbemDateTime;
- constructor Create(AServer: TSWbemDateTime);
- protected
- function Get_Value: WideString;
- procedure Set_Value(const strValue: WideString);
- function Get_Year: Integer;
- procedure Set_Year(iYear: Integer);
- function Get_YearSpecified: WordBool;
- procedure Set_YearSpecified(bYearSpecified: WordBool);
- function Get_Month: Integer;
- procedure Set_Month(iMonth: Integer);
- function Get_MonthSpecified: WordBool;
- procedure Set_MonthSpecified(bMonthSpecified: WordBool);
- function Get_Day: Integer;
- procedure Set_Day(iDay: Integer);
- function Get_DaySpecified: WordBool;
- procedure Set_DaySpecified(bDaySpecified: WordBool);
- function Get_Hours: Integer;
- procedure Set_Hours(iHours: Integer);
- function Get_HoursSpecified: WordBool;
- procedure Set_HoursSpecified(bHoursSpecified: WordBool);
- function Get_Minutes: Integer;
- procedure Set_Minutes(iMinutes: Integer);
- function Get_MinutesSpecified: WordBool;
- procedure Set_MinutesSpecified(bMinutesSpecified: WordBool);
- function Get_Seconds: Integer;
- procedure Set_Seconds(iSeconds: Integer);
- function Get_SecondsSpecified: WordBool;
- procedure Set_SecondsSpecified(bSecondsSpecified: WordBool);
- function Get_Microseconds: Integer;
- procedure Set_Microseconds(iMicroseconds: Integer);
- function Get_MicrosecondsSpecified: WordBool;
- procedure Set_MicrosecondsSpecified(bMicrosecondsSpecified: WordBool);
- function Get_UTC: Integer;
- procedure Set_UTC(iUTC: Integer);
- function Get_UTCSpecified: WordBool;
- procedure Set_UTCSpecified(bUTCSpecified: WordBool);
- function Get_IsInterval: WordBool;
- procedure Set_IsInterval(bIsInterval: WordBool);
- public
- property DefaultInterface: ISWbemDateTime read GetDefaultInterface;
- published
- property Value: WideString read Get_Value write Set_Value;
- property Year: Integer read Get_Year write Set_Year;
- property YearSpecified: WordBool read Get_YearSpecified write Set_YearSpecified;
- property Month: Integer read Get_Month write Set_Month;
- property MonthSpecified: WordBool read Get_MonthSpecified write Set_MonthSpecified;
- property Day: Integer read Get_Day write Set_Day;
- property DaySpecified: WordBool read Get_DaySpecified write Set_DaySpecified;
- property Hours: Integer read Get_Hours write Set_Hours;
- property HoursSpecified: WordBool read Get_HoursSpecified write Set_HoursSpecified;
- property Minutes: Integer read Get_Minutes write Set_Minutes;
- property MinutesSpecified: WordBool read Get_MinutesSpecified write Set_MinutesSpecified;
- property Seconds: Integer read Get_Seconds write Set_Seconds;
- property SecondsSpecified: WordBool read Get_SecondsSpecified write Set_SecondsSpecified;
- property Microseconds: Integer read Get_Microseconds write Set_Microseconds;
- property MicrosecondsSpecified: WordBool read Get_MicrosecondsSpecified write Set_MicrosecondsSpecified;
- property UTC: Integer read Get_UTC write Set_UTC;
- property UTCSpecified: WordBool read Get_UTCSpecified write Set_UTCSpecified;
- property IsInterval: WordBool read Get_IsInterval write Set_IsInterval;
- end;
- {$ENDIF}
- // *********************************************************************//
- // The Class CoSWbemRefresher provides a Create and CreateRemote method to
- // create instances of the default interface ISWbemRefresher exposed by
- // the CoClass SWbemRefresher. The functions are intended to be used by
- // clients wishing to automate the CoClass objects exposed by the
- // server of this typelibrary.
- // *********************************************************************//
- CoSWbemRefresher = class
- class function Create: ISWbemRefresher;
- class function CreateRemote(const MachineName: string): ISWbemRefresher;
- end;
- // *********************************************************************//
- // OLE Server Proxy class declaration
- // Server Object : TSWbemRefresher
- // Help String : Refresher
- // Default Interface: ISWbemRefresher
- // Def. Intf. DISP? : No
- // Event Interface:
- // TypeFlags : (2) CanCreate
- // *********************************************************************//
- {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
- TSWbemRefresherProperties= class;
- {$ENDIF}
- TSWbemRefresher = class(TOleServer)
- private
- FIntf: ISWbemRefresher;
- {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
- FProps: TSWbemRefresherProperties;
- function GetServerProperties: TSWbemRefresherProperties;
- {$ENDIF}
- function GetDefaultInterface: ISWbemRefresher;
- protected
- procedure InitServerData; override;
- function Get_Count: Integer;
- function Get_AutoReconnect: WordBool;
- procedure Set_AutoReconnect(bCount: WordBool);
- public
- constructor Create(AOwner: TComponent); override;
- destructor Destroy; override;
- procedure Connect; override;
- procedure ConnectTo(svrIntf: ISWbemRefresher);
- procedure Disconnect; override;
- function Item(iIndex: Integer): ISWbemRefreshableItem;
- function Add(const objWbemServices: ISWbemServicesEx; const bsInstancePath: WideString;
- iFlags: Integer; const objWbemNamedValueSet: IDispatch): ISWbemRefreshableItem;
- function AddEnum(const objWbemServices: ISWbemServicesEx; const bsClassName: WideString;
- iFlags: Integer; const objWbemNamedValueSet: IDispatch): ISWbemRefreshableItem;
- procedure Remove(iIndex: Integer; iFlags: Integer);
- procedure Refresh(iFlags: Integer);
- procedure DeleteAll;
- property DefaultInterface: ISWbemRefresher read GetDefaultInterface;
- property Count: Integer read Get_Count;
- property AutoReconnect: WordBool read Get_AutoReconnect write Set_AutoReconnect;
- published
- {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
- property Server: TSWbemRefresherProperties read GetServerProperties;
- {$ENDIF}
- end;
- {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
- // *********************************************************************//
- // OLE Server Properties Proxy Class
- // Server Object : TSWbemRefresher
- // (This object is used by the IDE's Property Inspector to allow editing
- // of the properties of this server)
- // *********************************************************************//
- TSWbemRefresherProperties = class(TPersistent)
- private
- FServer: TSWbemRefresher;
- function GetDefaultInterface: ISWbemRefresher;
- constructor Create(AServer: TSWbemRefresher);
- protected
- function Get_Count: Integer;
- function Get_AutoReconnect: WordBool;
- procedure Set_AutoReconnect(bCount: WordBool);
- public
- property DefaultInterface: ISWbemRefresher read GetDefaultInterface;
- published
- property AutoReconnect: WordBool read Get_AutoReconnect write Set_AutoReconnect;
- end;
- {$ENDIF}
- // *********************************************************************//
- // The Class CoSWbemServices provides a Create and CreateRemote method to
- // create instances of the default interface ISWbemServices exposed by
- // the CoClass SWbemServices. The functions are intended to be used by
- // clients wishing to automate the CoClass objects exposed by the
- // server of this typelibrary.
- // *********************************************************************//
- CoSWbemServices = class
- class function Create: ISWbemServices;
- class function CreateRemote(const MachineName: string): ISWbemServices;
- end;
- // *********************************************************************//
- // The Class CoSWbemServicesEx provides a Create and CreateRemote method to
- // create instances of the default interface ISWbemServicesEx exposed by
- // the CoClass SWbemServicesEx. The functions are intended to be used by
- // clients wishing to automate the CoClass objects exposed by the
- // server of this typelibrary.
- // *********************************************************************//
- CoSWbemServicesEx = class
- class function Create: ISWbemServicesEx;
- class function CreateRemote(const MachineName: string): ISWbemServicesEx;
- end;
- // *********************************************************************//
- // The Class CoSWbemObject provides a Create and CreateRemote method to
- // create instances of the default interface ISWbemObject exposed by
- // the CoClass SWbemObject. The functions are intended to be used by
- // clients wishing to automate the CoClass objects exposed by the
- // server of this typelibrary.
- // *********************************************************************//
- CoSWbemObject = class
- class function Create: ISWbemObject;
- class function CreateRemote(const MachineName: string): ISWbemObject;
- end;
- // *********************************************************************//
- // The Class CoSWbemObjectEx provides a Create and CreateRemote method to
- // create instances of the default interface ISWbemObjectEx exposed by
- // the CoClass SWbemObjectEx. The functions are intended to be used by
- // clients wishing to automate the CoClass objects exposed by the
- // server of this typelibrary.
- // *********************************************************************//
- CoSWbemObjectEx = class
- class function Create: ISWbemObjectEx;
- class function CreateRemote(const MachineName: string): ISWbemObjectEx;
- end;
- // *********************************************************************//
- // The Class CoSWbemObjectSet provides a Create and CreateRemote method to
- // create instances of the default interface ISWbemObjectSet exposed by
- // the CoClass SWbemObjectSet. The functions are intended to be used by
- // clients wishing to automate the CoClass objects exposed by the
- // server of this typelibrary.
- // *********************************************************************//
- CoSWbemObjectSet = class
- class function Create: ISWbemObjectSet;
- class function CreateRemote(const MachineName: string): ISWbemObjectSet;
- end;
- // *********************************************************************//
- // The Class CoSWbemNamedValue provides a Create and CreateRemote method to
- // create instances of the default interface ISWbemNamedValue exposed by
- // the CoClass SWbemNamedValue. The functions are intended to be used by
- // clients wishing to automate the CoClass objects exposed by the
- // server of this typelibrary.
- // *********************************************************************//
- CoSWbemNamedValue = class
- class function Create: ISWbemNamedValue;
- class function CreateRemote(const MachineName: string): ISWbemNamedValue;
- end;
- // *********************************************************************//
- // The Class CoSWbemQualifier provides a Create and CreateRemote method to
- // create instances of the default interface ISWbemQualifier exposed by
- // the CoClass SWbemQualifier. The functions are intended to be used by
- // clients wishing to automate the CoClass objects exposed by the
- // server of this typelibrary.
- // *********************************************************************//
- CoSWbemQualifier = class
- class function Create: ISWbemQualifier;
- class function CreateRemote(const MachineName: string): ISWbemQualifier;
- end;
- // *********************************************************************//
- // The Class CoSWbemQualifierSet provides a Create and CreateRemote method to
- // create instances of the default interface ISWbemQualifierSet exposed by
- // the CoClass SWbemQualifierSet. The functions are intended to be used by
- // clients wishing to automate the CoClass objects exposed by the
- // server of this typelibrary.
- // *********************************************************************//
- CoSWbemQualifierSet = class
- class function Create: ISWbemQualifierSet;
- class function CreateRemote(const MachineName: string): ISWbemQualifierSet;
- end;
- // *********************************************************************//
- // The Class CoSWbemProperty provides a Create and CreateRemote method to
- // create instances of the default interface ISWbemProperty exposed by
- // the CoClass SWbemProperty. The functions are intended to be used by
- // clients wishing to automate the CoClass objects exposed by the
- // server of this typelibrary.
- // *********************************************************************//
- CoSWbemProperty = class
- class function Create: ISWbemProperty;
- class function CreateRemote(const MachineName: string): ISWbemProperty;
- end;
- // *********************************************************************//
- // The Class CoSWbemPropertySet provides a Create and CreateRemote method to
- // create instances of the default interface ISWbemPropertySet exposed by
- // the CoClass SWbemPropertySet. The functions are intended to be used by
- // clients wishing to automate the CoClass objects exposed by the
- // server of this typelibrary.
- // *********************************************************************//
- CoSWbemPropertySet = class
- class function Create: ISWbemPropertySet;
- class function CreateRemote(const MachineName: string): ISWbemPropertySet;
- end;
- // *********************************************************************//
- // The Class CoSWbemMethod provides a Create and CreateRemote method to
- // create instances of the default interface ISWbemMethod exposed by
- // the CoClass SWbemMethod. The functions are intended to be used by
- // clients wishing to automate the CoClass objects exposed by the
- // server of this typelibrary.
- // *********************************************************************//
- CoSWbemMethod = class
- class function Create: ISWbemMethod;
- class function CreateRemote(const MachineName: string): ISWbemMethod;
- end;
- // *********************************************************************//
- // The Class CoSWbemMethodSet provides a Create and CreateRemote method to
- // create instances of the default interface ISWbemMethodSet exposed by
- // the CoClass SWbemMethodSet. The functions are intended to be used by
- // clients wishing to automate the CoClass objects exposed by the
- // server of this typelibrary.
- // *********************************************************************//
- CoSWbemMethodSet = class
- class function Create: ISWbemMethodSet;
- class function CreateRemote(const MachineName: string): ISWbemMethodSet;
- end;
- // *********************************************************************//
- // The Class CoSWbemEventSource provides a Create and CreateRemote method to
- // create instances of the default interface ISWbemEventSource exposed by
- // the CoClass SWbemEventSource. The functions are intended to be used by
- // clients wishing to automate the CoClass objects exposed by the
- // server of this typelibrary.
- // *********************************************************************//
- CoSWbemEventSource = class
- class function Create: ISWbemEventSource;
- class function CreateRemote(const MachineName: string): ISWbemEventSource;
- end;
- // *********************************************************************//
- // The Class CoSWbemSecurity provides a Create and CreateRemote method to
- // create instances of the default interface ISWbemSecurity exposed by
- // the CoClass SWbemSecurity. The functions are intended to be used by
- // clients wishing to automate the CoClass objects exposed by the
- // server of this typelibrary.
- // *********************************************************************//
- CoSWbemSecurity = class
- class function Create: ISWbemSecurity;
- class function CreateRemote(const MachineName: string): ISWbemSecurity;
- end;
- // *********************************************************************//
- // The Class CoSWbemPrivilege provides a Create and CreateRemote method to
- // create instances of the default interface ISWbemPrivilege exposed by
- // the CoClass SWbemPrivilege. The functions are intended to be used by
- // clients wishing to automate the CoClass objects exposed by the
- // server of this typelibrary.
- // *********************************************************************//
- CoSWbemPrivilege = class
- class function Create: ISWbemPrivilege;
- class function CreateRemote(const MachineName: string): ISWbemPrivilege;
- end;
- // *********************************************************************//
- // The Class CoSWbemPrivilegeSet provides a Create and CreateRemote method to
- // create instances of the default interface ISWbemPrivilegeSet exposed by
- // the CoClass SWbemPrivilegeSet. The functions are intended to be used by
- // clients wishing to automate the CoClass objects exposed by the
- // server of this typelibrary.
- // *********************************************************************//
- CoSWbemPrivilegeSet = class
- class function Create: ISWbemPrivilegeSet;
- class function CreateRemote(const MachineName: string): ISWbemPrivilegeSet;
- end;
- // *********************************************************************//
- // The Class CoSWbemRefreshableItem provides a Create and CreateRemote method to
- // create instances of the default interface ISWbemRefreshableItem exposed by
- // the CoClass SWbemRefreshableItem. The functions are intended to be used by
- // clients wishing to automate the CoClass objects exposed by the
- // server of this typelibrary.
- // *********************************************************************//
- CoSWbemRefreshableItem = class
- class function Create: ISWbemRefreshableItem;
- class function CreateRemote(const MachineName: string): ISWbemRefreshableItem;
- end;
- procedure Register;
- resourcestring
- dtlServerPage = 'ActiveX';
- implementation
- uses ComObj;
- class function CoSWbemLocator.Create: ISWbemLocator;
- begin
- Result := CreateComObject(CLASS_SWbemLocator) as ISWbemLocator;
- end;
- class function CoSWbemLocator.CreateRemote(const MachineName: string): ISWbemLocator;
- begin
- Result := CreateRemoteComObject(MachineName, CLASS_SWbemLocator) as ISWbemLocator;
- end;
- procedure TSWbemLocator.InitServerData;
- const
- CServerData: TServerData = (
- ClassID: '{76A64158-CB41-11D1-8B02-00600806D9B6}';
- IntfIID: '{76A6415B-CB41-11D1-8B02-00600806D9B6}';
- EventIID: '';
- LicenseKey: nil;
- Version: 500);
- begin
- ServerData := @CServerData;
- end;
- procedure TSWbemLocator.Connect;
- var
- punk: IUnknown;
- begin
- if FIntf = nil then
- begin
- punk := GetServer;
- Fintf:= punk as ISWbemLocator;
- end;
- end;
- procedure TSWbemLocator.ConnectTo(svrIntf: ISWbemLocator);
- begin
- Disconnect;
- FIntf := svrIntf;
- end;
- procedure TSWbemLocator.DisConnect;
- begin
- if Fintf <> nil then
- begin
- FIntf := nil;
- end;
- end;
- function TSWbemLocator.GetDefaultInterface: ISWbemLocator;
- begin
- if FIntf = nil then
- Connect;
- Assert(FIntf <> nil, 'DefaultInterface is NULL. Component is not connected to Server. You must call ''Connect'' or ''ConnectTo'' before this operation');
- Result := FIntf;
- end;
- constructor TSWbemLocator.Create(AOwner: TComponent);
- begin
- inherited Create(AOwner);
- {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
- FProps := TSWbemLocatorProperties.Create(Self);
- {$ENDIF}
- end;
- destructor TSWbemLocator.Destroy;
- begin
- {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
- FProps.Free;
- {$ENDIF}
- inherited Destroy;
- end;
- {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
- function TSWbemLocator.GetServerProperties: TSWbemLocatorProperties;
- begin
- Result := FProps;
- end;
- {$ENDIF}
- function TSWbemLocator.Get_Security_: ISWbemSecurity;
- begin
- Result := DefaultInterface.Security_;
- end;
- function TSWbemLocator.ConnectServer(const strServer: WideString; const strNamespace: WideString;
- const strUser: WideString; const strPassword: WideString;
- const strLocale: WideString; const strAuthority: WideString;
- iSecurityFlags: Integer; const objWbemNamedValueSet: IDispatch): ISWbemServices;
- begin
- Result := DefaultInterface.ConnectServer(strServer, strNamespace, strUser, strPassword,
- strLocale, strAuthority, iSecurityFlags,
- objWbemNamedValueSet);
- end;
- {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
- constructor TSWbemLocatorProperties.Create(AServer: TSWbemLocator);
- begin
- inherited Create;
- FServer := AServer;
- end;
- function TSWbemLocatorProperties.GetDefaultInterface: ISWbemLocator;
- begin
- Result := FServer.DefaultInterface;
- end;
- function TSWbemLocatorProperties.Get_Security_: ISWbemSecurity;
- begin
- Result := DefaultInterface.Security_;
- end;
- {$ENDIF}
- class function CoSWbemNamedValueSet.Create: ISWbemNamedValueSet;
- begin
- Result := CreateComObject(CLASS_SWbemNamedValueSet) as ISWbemNamedValueSet;
- end;
- class function CoSWbemNamedValueSet.CreateRemote(const MachineName: string): ISWbemNamedValueSet;
- begin
- Result := CreateRemoteComObject(MachineName, CLASS_SWbemNamedValueSet) as ISWbemNamedValueSet;
- end;
- procedure TSWbemNamedValueSet.InitServerData;
- const
- CServerData: TServerData = (
- ClassID: '{9AED384E-CE8B-11D1-8B05-00600806D9B6}';
- IntfIID: '{CF2376EA-CE8C-11D1-8B05-00600806D9B6}';
- EventIID: '';
- LicenseKey: nil;
- Version: 500);
- begin
- ServerData := @CServerData;
- end;
- procedure TSWbemNamedValueSet.Connect;
- var
- punk: IUnknown;
- begin
- if FIntf = nil then
- begin
- punk := GetServer;
- Fintf:= punk as ISWbemNamedValueSet;
- end;
- end;
- procedure TSWbemNamedValueSet.ConnectTo(svrIntf: ISWbemNamedValueSet);
- begin
- Disconnect;
- FIntf := svrIntf;
- end;
- procedure TSWbemNamedValueSet.DisConnect;
- begin
- if Fintf <> nil then
- begin
- FIntf := nil;
- end;
- end;
- function TSWbemNamedValueSet.GetDefaultInterface: ISWbemNamedValueSet;
- begin
- if FIntf = nil then
- Connect;
- Assert(FIntf <> nil, 'DefaultInterface is NULL. Component is not connected to Server. You must call ''Connect'' or ''ConnectTo'' before this operation');
- Result := FIntf;
- end;
- constructor TSWbemNamedValueSet.Create(AOwner: TComponent);
- begin
- inherited Create(AOwner);
- {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
- FProps := TSWbemNamedValueSetProperties.Create(Self);
- {$ENDIF}
- end;
- destructor TSWbemNamedValueSet.Destroy;
- begin
- {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
- FProps.Free;
- {$ENDIF}
- inherited Destroy;
- end;
- {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
- function TSWbemNamedValueSet.GetServerProperties: TSWbemNamedValueSetProperties;
- begin
- Result := FProps;
- end;
- {$ENDIF}
- function TSWbemNamedValueSet.Get_Count: Integer;
- begin
- Result := DefaultInterface.Count;
- end;
- function TSWbemNamedValueSet.Item(const strName: WideString; iFlags: Integer): ISWbemNamedValue;
- begin
- Result := DefaultInterface.Item(strName, iFlags);
- end;
- function TSWbemNamedValueSet.Add(const strName: WideString; var varValue: OleVariant;
- iFlags: Integer): ISWbemNamedValue;
- begin
- Result := DefaultInterface.Add(strName, varValue, iFlags);
- end;
- procedure TSWbemNamedValueSet.Remove(const strName: WideString; iFlags: Integer);
- begin
- DefaultInterface.Remove(strName, iFlags);
- end;
- function TSWbemNamedValueSet.Clone: ISWbemNamedValueSet;
- begin
- Result := DefaultInterface.Clone;
- end;
- procedure TSWbemNamedValueSet.DeleteAll;
- begin
- DefaultInterface.DeleteAll;
- end;
- {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
- constructor TSWbemNamedValueSetProperties.Create(AServer: TSWbemNamedValueSet);
- begin
- inherited Create;
- FServer := AServer;
- end;
- function TSWbemNamedValueSetProperties.GetDefaultInterface: ISWbemNamedValueSet;
- begin
- Result := FServer.DefaultInterface;
- end;
- function TSWbemNamedValueSetProperties.Get_Count: Integer;
- begin
- Result := DefaultInterface.Count;
- end;
- {$ENDIF}
- class function CoSWbemObjectPath.Create: ISWbemObjectPath;
- begin
- Result := CreateComObject(CLASS_SWbemObjectPath) as ISWbemObjectPath;
- end;
- class function CoSWbemObjectPath.CreateRemote(const MachineName: string): ISWbemObjectPath;
- begin
- Result := CreateRemoteComObject(MachineName, CLASS_SWbemObjectPath) as ISWbemObjectPath;
- end;
- procedure TSWbemObjectPath.InitServerData;
- const
- CServerData: TServerData = (
- ClassID: '{5791BC26-CE9C-11D1-97BF-0000F81E849C}';
- IntfIID: '{5791BC27-CE9C-11D1-97BF-0000F81E849C}';
- EventIID: '';
- LicenseKey: nil;
- Version: 500);
- begin
- ServerData := @CServerData;
- end;
- procedure TSWbemObjectPath.Connect;
- var
- punk: IUnknown;
- begin
- if FIntf = nil then
- begin
- punk := GetServer;
- Fintf:= punk as ISWbemObjectPath;
- end;
- end;
- procedure TSWbemObjectPath.ConnectTo(svrIntf: ISWbemObjectPath);
- begin
- Disconnect;
- FIntf := svrIntf;
- end;
- procedure TSWbemObjectPath.DisConnect;
- begin
- if Fintf <> nil then
- begin
- FIntf := nil;
- end;
- end;
- function TSWbemObjectPath.GetDefaultInterface: ISWbemObjectPath;
- begin
- if FIntf = nil then
- Connect;
- Assert(FIntf <> nil, 'DefaultInterface is NULL. Component is not connected to Server. You must call ''Connect'' or ''ConnectTo'' before this operation');
- Result := FIntf;
- end;
- constructor TSWbemObjectPath.Create(AOwner: TComponent);
- begin
- inherited Create(AOwner);
- {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
- FProps := TSWbemObjectPathProperties.Create(Self);
- {$ENDIF}
- end;
- destructor TSWbemObjectPath.Destroy;
- begin
- {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
- FProps.Free;
- {$ENDIF}
- inherited Destroy;
- end;
- {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
- function TSWbemObjectPath.GetServerProperties: TSWbemObjectPathProperties;
- begin
- Result := FProps;
- end;
- {$ENDIF}
- function TSWbemObjectPath.Get_Path: WideString;
- begin
- Result := DefaultInterface.Path;
- end;
- procedure TSWbemObjectPath.Set_Path(const strPath: WideString);
- { Warning: The property Path has a setter and a getter whose
- types do not match. Delphi was unable to generate a property of
- this sort and so is using a Variant to set the property instead. }
- var
- InterfaceVariant: OleVariant;
- begin
- InterfaceVariant := DefaultInterface;
- InterfaceVariant.Path := strPath;
- end;
- function TSWbemObjectPath.Get_RelPath: WideString;
- begin
- Result := DefaultInterface.RelPath;
- end;
- procedure TSWbemObjectPath.Set_RelPath(const strRelPath: WideString);
- { Warning: The property RelPath has a setter and a getter whose
- types do not match. Delphi was unable to generate a property of
- this sort and so is using a Variant to set the property instead. }
- var
- InterfaceVariant: OleVariant;
- begin
- InterfaceVariant := DefaultInterface;
- InterfaceVariant.RelPath := strRelPath;
- end;
- function TSWbemObjectPath.Get_Server: WideString;
- begin
- Result := DefaultInterface.Server;
- end;
- procedure TSWbemObjectPath.Set_Server(const strServer: WideString);
- { Warning: The property Server has a setter and a getter whose
- types do not match. Delphi was unable to generate a property of
- this sort and so is using a Variant to set the property instead. }
- var
- InterfaceVariant: OleVariant;
- begin
- InterfaceVariant := DefaultInterface;
- InterfaceVariant.Server := strServer;
- end;
- function TSWbemObjectPath.Get_Namespace: WideString;
- begin
- Result := DefaultInterface.Namespace;
- end;
- procedure TSWbemObjectPath.Set_Namespace(const strNamespace: WideString);
- { Warning: The property Namespace has a setter and a getter whose
- types do not match. Delphi was unable to generate a property of
- this sort and so is using a Variant to set the property instead. }
- var
- InterfaceVariant: OleVariant;
- begin
- InterfaceVariant := DefaultInterface;
- InterfaceVariant.Namespace := strNamespace;
- end;
- function TSWbemObjectPath.Get_ParentNamespace: WideString;
- begin
- Result := DefaultInterface.ParentNamespace;
- end;
- function TSWbemObjectPath.Get_DisplayName: WideString;
- begin
- Result := DefaultInterface.DisplayName;
- end;
- procedure TSWbemObjectPath.Set_DisplayName(const strDisplayName: WideString);
- { Warning: The property DisplayName has a setter and a getter whose
- types do not match. Delphi was unable to generate a property of
- this sort and so is using a Variant to set the property instead. }
- var
- InterfaceVariant: OleVariant;
- begin
- InterfaceVariant := DefaultInterface;
- InterfaceVariant.DisplayName := strDisplayName;
- end;
- function TSWbemObjectPath.Get_Class_: WideString;
- begin
- Result := DefaultInterface.Class_;
- end;
- procedure TSWbemObjectPath.Set_Class_(const strClass: WideString);
- { Warning: The property Class_ has a setter and a getter whose
- types do not match. Delphi was unable to generate a property of
- this sort and so is using a Variant to set the property instead. }
- var
- InterfaceVariant: OleVariant;
- begin
- InterfaceVariant := DefaultInterface;
- InterfaceVariant.Class_ := strClass;
- end;
- function TSWbemObjectPath.Get_IsClass: WordBool;
- begin
- Result := DefaultInterface.IsClass;
- end;
- function TSWbemObjectPath.Get_IsSingleton: WordBool;
- begin
- Result := DefaultInterface.IsSingleton;
- end;
- function TSWbemObjectPath.Get_Keys: ISWbemNamedValueSet;
- begin
- Result := DefaultInterface.Keys;
- end;
- function TSWbemObjectPath.Get_Security_: ISWbemSecurity;
- begin
- Result := DefaultInterface.Security_;
- end;
- function TSWbemObjectPath.Get_Locale: WideString;
- begin
- Result := DefaultInterface.Locale;
- end;
- procedure TSWbemObjectPath.Set_Locale(const strLocale: WideString);
- { Warning: The property Locale has a setter and a getter whose
- types do not match. Delphi was unable to generate a property of
- this sort and so is using a Variant to set the property instead. }
- var
- InterfaceVariant: OleVariant;
- begin
- InterfaceVariant := DefaultInterface;
- InterfaceVariant.Locale := strLocale;
- end;
- function TSWbemObjectPath.Get_Authority: WideString;
- begin
- Result := DefaultInterface.Authority;
- end;
- procedure TSWbemObjectPath.Set_Authority(const strAuthority: WideString);
- { Warning: The property Authority has a setter and a getter whose
- types do not match. Delphi was unable to generate a property of
- this sort and so is using a Variant to set the property instead. }
- var
- InterfaceVariant: OleVariant;
- begin
- InterfaceVariant := DefaultInterface;
- InterfaceVariant.Authority := strAuthority;
- end;
- procedure TSWbemObjectPath.SetAsClass;
- begin
- DefaultInterface.SetAsClass;
- end;
- procedure TSWbemObjectPath.SetAsSingleton;
- begin
- DefaultInterface.SetAsSingleton;
- end;
- {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
- constructor TSWbemObjectPathProperties.Create(AServer: TSWbemObjectPath);
- begin
- inherited Create;
- FServer := AServer;
- end;
- function TSWbemObjectPathProperties.GetDefaultInterface: ISWbemObjectPath;
- begin
- Result := FServer.DefaultInterface;
- end;
- function TSWbemObjectPathProperties.Get_Path: WideString;
- begin
- Result := DefaultInterface.Path;
- end;
- procedure TSWbemObjectPathProperties.Set_Path(const strPath: WideString);
- { Warning: The property Path has a setter and a getter whose
- types do not match. Delphi was unable to generate a property of
- this sort and so is using a Variant to set the property instead. }
- var
- InterfaceVariant: OleVariant;
- begin
- InterfaceVariant := DefaultInterface;
- InterfaceVariant.Path := strPath;
- end;
- function TSWbemObjectPathProperties.Get_RelPath: WideString;
- begin
- Result := DefaultInterface.RelPath;
- end;
- procedure TSWbemObjectPathProperties.Set_RelPath(const strRelPath: WideString);
- { Warning: The property RelPath has a setter and a getter whose
- types do not match. Delphi was unable to generate a property of
- this sort and so is using a Variant to set the property instead. }
- var
- InterfaceVariant: OleVariant;
- begin
- InterfaceVariant := DefaultInterface;
- InterfaceVariant.RelPath := strRelPath;
- end;
- function TSWbemObjectPathProperties.Get_Server: WideString;
- begin
- Result := DefaultInterface.Server;
- end;
- procedure TSWbemObjectPathProperties.Set_Server(const strServer: WideString);
- { Warning: The property Server has a setter and a getter whose
- types do not match. Delphi was unable to generate a property of
- this sort and so is using a Variant to set the property instead. }
- var
- InterfaceVariant: OleVariant;
- begin
- InterfaceVariant := DefaultInterface;
- InterfaceVariant.Server := strServer;
- end;
- function TSWbemObjectPathProperties.Get_Namespace: WideString;
- begin
- Result := DefaultInterface.Namespace;
- end;
- procedure TSWbemObjectPathProperties.Set_Namespace(const strNamespace: WideString);
- { Warning: The property Namespace has a setter and a getter whose
- types do not match. Delphi was unable to generate a property of
- this sort and so is using a Variant to set the property instead. }
- var
- InterfaceVariant: OleVariant;
- begin
- InterfaceVariant := DefaultInterface;
- InterfaceVariant.Namespace := strNamespace;
- end;
- function TSWbemObjectPathProperties.Get_ParentNamespace: WideString;
- begin
- Result := DefaultInterface.ParentNamespace;
- end;
- function TSWbemObjectPathProperties.Get_DisplayName: WideString;
- begin
- Result := DefaultInterface.DisplayName;
- end;
- procedure TSWbemObjectPathProperties.Set_DisplayName(const strDisplayName: WideString);
- { Warning: The property DisplayName has a setter and a getter whose
- types do not match. Delphi was unable to generate a property of
- this sort and so is using a Variant to set the property instead. }
- var
- InterfaceVariant: OleVariant;
- begin
- InterfaceVariant := DefaultInterface;
- InterfaceVariant.DisplayName := strDisplayName;
- end;
- function TSWbemObjectPathProperties.Get_Class_: WideString;
- begin
- Result := DefaultInterface.Class_;
- end;
- procedure TSWbemObjectPathProperties.Set_Class_(const strClass: WideString);
- { Warning: The property Class_ has a setter and a getter whose
- types do not match. Delphi was unable to generate a property of
- this sort and so is using a Variant to set the property instead. }
- var
- InterfaceVariant: OleVariant;
- begin
- InterfaceVariant := DefaultInterface;
- InterfaceVariant.Class_ := strClass;
- end;
- function TSWbemObjectPathProperties.Get_IsClass: WordBool;
- begin
- Result := DefaultInterface.IsClass;
- end;
- function TSWbemObjectPathProperties.Get_IsSingleton: WordBool;
- begin
- Result := DefaultInterface.IsSingleton;
- end;
- function TSWbemObjectPathProperties.Get_Keys: ISWbemNamedValueSet;
- begin
- Result := DefaultInterface.Keys;
- end;
- function TSWbemObjectPathProperties.Get_Security_: ISWbemSecurity;
- begin
- Result := DefaultInterface.Security_;
- end;
- function TSWbemObjectPathProperties.Get_Locale: WideString;
- begin
- Result := DefaultInterface.Locale;
- end;
- procedure TSWbemObjectPathProperties.Set_Locale(const strLocale: WideString);
- { Warning: The property Locale has a setter and a getter whose
- types do not match. Delphi was unable to generate a property of
- this sort and so is using a Variant to set the property instead. }
- var
- InterfaceVariant: OleVariant;
- begin
- InterfaceVariant := DefaultInterface;
- InterfaceVariant.Locale := strLocale;
- end;
- function TSWbemObjectPathProperties.Get_Authority: WideString;
- begin
- Result := DefaultInterface.Authority;
- end;
- procedure TSWbemObjectPathProperties.Set_Authority(const strAuthority: WideString);
- { Warning: The property Authority has a setter and a getter whose
- types do not match. Delphi was unable to generate a property of
- this sort and so is using a Variant to set the property instead. }
- var
- InterfaceVariant: OleVariant;
- begin
- InterfaceVariant := DefaultInterface;
- InterfaceVariant.Authority := strAuthority;
- end;
- {$ENDIF}
- class function CoSWbemLastError.Create: ISWbemLastError;
- begin
- Result := CreateComObject(CLASS_SWbemLastError) as ISWbemLastError;
- end;
- class function CoSWbemLastError.CreateRemote(const MachineName: string): ISWbemLastError;
- begin
- Result := CreateRemoteComObject(MachineName, CLASS_SWbemLastError) as ISWbemLastError;
- end;
- procedure TSWbemLastError.InitServerData;
- const
- CServerData: TServerData = (
- ClassID: '{C2FEEEAC-CFCD-11D1-8B05-00600806D9B6}';
- IntfIID: '{D962DB84-D4BB-11D1-8B09-00600806D9B6}';
- EventIID: '';
- LicenseKey: nil;
- Version: 500);
- begin
- ServerData := @CServerData;
- end;
- procedure TSWbemLastError.Connect;
- var
- punk: IUnknown;
- begin
- if FIntf = nil then
- begin
- punk := GetServer;
- Fintf:= punk as ISWbemLastError;
- end;
- end;
- procedure TSWbemLastError.ConnectTo(svrIntf: ISWbemLastError);
- begin
- Disconnect;
- FIntf := svrIntf;
- end;
- procedure TSWbemLastError.DisConnect;
- begin
- if Fintf <> nil then
- begin
- FIntf := nil;
- end;
- end;
- function TSWbemLastError.GetDefaultInterface: ISWbemLastError;
- begin
- if FIntf = nil then
- Connect;
- Assert(FIntf <> nil, 'DefaultInterface is NULL. Component is not connected to Server. You must call ''Connect'' or ''ConnectTo'' before this operation');
- Result := FIntf;
- end;
- constructor TSWbemLastError.Create(AOwner: TComponent);
- begin
- inherited Create(AOwner);
- {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
- FProps := TSWbemLastErrorProperties.Create(Self);
- {$ENDIF}
- end;
- destructor TSWbemLastError.Destroy;
- begin
- {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
- FProps.Free;
- {$ENDIF}
- inherited Destroy;
- end;
- {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
- function TSWbemLastError.GetServerProperties: TSWbemLastErrorProperties;
- begin
- Result := FProps;
- end;
- {$ENDIF}
- function TSWbemLastError.Get_Qualifiers_: ISWbemQualifierSet;
- begin
- Result := DefaultInterface.Qualifiers_;
- end;
- function TSWbemLastError.Get_Properties_: ISWbemPropertySet;
- begin
- Result := DefaultInterface.Properties_;
- end;
- function TSWbemLastError.Get_Methods_: ISWbemMethodSet;
- begin
- Result := DefaultInterface.Methods_;
- end;
- function TSWbemLastError.Get_Derivation_: OleVariant;
- var
- InterfaceVariant : OleVariant;
- begin
- InterfaceVariant := DefaultInterface;
- Result := InterfaceVariant.Derivation_;
- end;
- function TSWbemLastError.Get_Path_: ISWbemObjectPath;
- begin
- Result := DefaultInterface.Path_;
- end;
- function TSWbemLastError.Get_Security_: ISWbemSecurity;
- begin
- Result := DefaultInterface.Security_;
- end;
- function TSWbemLastError.Put_(iFlags: Integer; const objWbemNamedValueSet: IDispatch): ISWbemObjectPath;
- begin
- Result := DefaultInterface.Put_(iFlags, objWbemNamedValueSet);
- end;
- procedure TSWbemLastError.PutAsync_(const objWbemSink: IDispatch; iFlags: Integer;
- const objWbemNamedValueSet: IDispatch;
- const objWbemAsyncContext: IDispatch);
- begin
- DefaultInterface.PutAsync_(objWbemSink, iFlags, objWbemNamedValueSet, objWbemAsyncContext);
- end;
- procedure TSWbemLastError.Delete_(iFlags: Integer; const objWbemNamedValueSet: IDispatch);
- begin
- DefaultInterface.Delete_(iFlags, objWbemNamedValueSet);
- end;
- procedure TSWbemLastError.DeleteAsync_(const objWbemSink: IDispatch; iFlags: Integer;
- const objWbemNamedValueSet: IDispatch;
- const objWbemAsyncContext: IDispatch);
- begin
- DefaultInterface.DeleteAsync_(objWbemSink, iFlags, objWbemNamedValueSet, objWbemAsyncContext);
- end;
- function TSWbemLastError.Instances_(iFlags: Integer; const objWbemNamedValueSet: IDispatch): ISWbemObjectSet;
- begin
- Result := DefaultInterface.Instances_(iFlags, objWbemNamedValueSet);
- end;
- procedure TSWbemLastError.InstancesAsync_(const objWbemSink: IDispatch; iFlags: Integer;
- const objWbemNamedValueSet: IDispatch;
- const objWbemAsyncContext: IDispatch);
- begin
- DefaultInterface.InstancesAsync_(objWbemSink, iFlags, objWbemNamedValueSet, objWbemAsyncContext);
- end;
- function TSWbemLastError.Subclasses_(iFlags: Integer; const objWbemNamedValueSet: IDispatch): ISWbemObjectSet;
- begin
- Result := DefaultInterface.Subclasses_(iFlags, objWbemNamedValueSet);
- end;
- procedure TSWbemLastError.SubclassesAsync_(const objWbemSink: IDispatch; iFlags: Integer;
- const objWbemNamedValueSet: IDispatch;
- const objWbemAsyncContext: IDispatch);
- begin
- DefaultInterface.SubclassesAsync_(objWbemSink, iFlags, objWbemNamedValueSet, objWbemAsyncContext);
- end;
- function TSWbemLastError.Associators_(const strAssocClass: WideString;
- const strResultClass: WideString;
- const strResultRole: WideString; const strRole: WideString;
- bClassesOnly: WordBool; bSchemaOnly: WordBool;
- const strRequiredAssocQualifier: WideString;
- const strRequiredQualifier: WideString; iFlags: Integer;
- const objWbemNamedValueSet: IDispatch): ISWbemObjectSet;
- begin
- Result := DefaultInterface.Associators_(strAssocClass, strResultClass, strResultRole, strRole,
- bClassesOnly, bSchemaOnly, strRequiredAssocQualifier,
- strRequiredQualifier, iFlags, objWbemNamedValueSet);
- end;
- procedure TSWbemLastError.AssociatorsAsync_(const objWbemSink: IDispatch;
- const strAssocClass: WideString;
- const strResultClass: WideString;
- const strResultRole: WideString;
- const strRole: WideString; bClassesOnly: WordBool;
- bSchemaOnly: WordBool;
- const strRequiredAssocQualifier: WideString;
- const strRequiredQualifier: WideString;
- iFlags: Integer; const objWbemNamedValueSet: IDispatch;
- const objWbemAsyncContext: IDispatch);
- begin
- DefaultInterface.AssociatorsAsync_(objWbemSink, strAssocClass, strResultClass, strResultRole,
- strRole, bClassesOnly, bSchemaOnly, strRequiredAssocQualifier,
- strRequiredQualifier, iFlags, objWbemNamedValueSet,
- objWbemAsyncContext);
- end;
- function TSWbemLastError.References_(const strResultClass: WideString; const strRole: WideString;
- bClassesOnly: WordBool; bSchemaOnly: WordBool;
- const strRequiredQualifier: WideString; iFlags: Integer;
- const objWbemNamedValueSet: IDispatch): ISWbemObjectSet;
- begin
- Result := DefaultInterface.References_(strResultClass, strRole, bClassesOnly, bSchemaOnly,
- strRequiredQualifier, iFlags, objWbemNamedValueSet);
- end;
- procedure TSWbemLastError.ReferencesAsync_(const objWbemSink: IDispatch;
- const strResultClass: WideString;
- const strRole: WideString; bClassesOnly: WordBool;
- bSchemaOnly: WordBool;
- const strRequiredQualifier: WideString; iFlags: Integer;
- const objWbemNamedValueSet: IDispatch;
- const objWbemAsyncContext: IDispatch);
- begin
- DefaultInterface.ReferencesAsync_(objWbemSink, strResultClass, strRole, bClassesOnly,
- bSchemaOnly, strRequiredQualifier, iFlags,
- objWbemNamedValueSet, objWbemAsyncContext);
- end;
- function TSWbemLastError.ExecMethod_(const strMethodName: WideString;
- const objWbemInParameters: IDispatch; iFlags: Integer;
- const objWbemNamedValueSet: IDispatch): ISWbemObject;
- begin
- Result := DefaultInterface.ExecMethod_(strMethodName, objWbemInParameters, iFlags,
- objWbemNamedValueSet);
- end;
- procedure TSWbemLastError.ExecMethodAsync_(const objWbemSink: IDispatch;
- const strMethodName: WideString;
- const objWbemInParameters: IDispatch; iFlags: Integer;
- const objWbemNamedValueSet: IDispatch;
- const objWbemAsyncContext: IDispatch);
- begin
- DefaultInterface.ExecMethodAsync_(objWbemSink, strMethodName, objWbemInParameters, iFlags,
- objWbemNamedValueSet, objWbemAsyncContext);
- end;
- function TSWbemLastError.Clone_: ISWbemObject;
- begin
- Result := DefaultInterface.Clone_;
- end;
- function TSWbemLastError.GetObjectText_(iFlags: Integer): WideString;
- begin
- Result := DefaultInterface.GetObjectText_(iFlags);
- end;
- function TSWbemLastError.SpawnDerivedClass_(iFlags: Integer): ISWbemObject;
- begin
- Result := DefaultInterface.SpawnDerivedClass_(iFlags);
- end;
- function TSWbemLastError.SpawnInstance_(iFlags: Integer): ISWbemObject;
- begin
- Result := DefaultInterface.SpawnInstance_(iFlags);
- end;
- function TSWbemLastError.CompareTo_(const objWbemObject: IDispatch; iFlags: Integer): WordBool;
- begin
- Result := DefaultInterface.CompareTo_(objWbemObject, iFlags);
- end;
- {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
- constructor TSWbemLastErrorProperties.Create(AServer: TSWbemLastError);
- begin
- inherited Create;
- FServer := AServer;
- end;
- function TSWbemLastErrorProperties.GetDefaultInterface: ISWbemLastError;
- begin
- Result := FServer.DefaultInterface;
- end;
- function TSWbemLastErrorProperties.Get_Qualifiers_: ISWbemQualifierSet;
- begin
- Result := DefaultInterface.Qualifiers_;
- end;
- function TSWbemLastErrorProperties.Get_Properties_: ISWbemPropertySet;
- begin
- Result := DefaultInterface.Properties_;
- end;
- function TSWbemLastErrorProperties.Get_Methods_: ISWbemMethodSet;
- begin
- Result := DefaultInterface.Methods_;
- end;
- function TSWbemLastErrorProperties.Get_Derivation_: OleVariant;
- var
- InterfaceVariant : OleVariant;
- begin
- InterfaceVariant := DefaultInterface;
- Result := InterfaceVariant.Derivation_;
- end;
- function TSWbemLastErrorProperties.Get_Path_: ISWbemObjectPath;
- begin
- Result := DefaultInterface.Path_;
- end;
- function TSWbemLastErrorProperties.Get_Security_: ISWbemSecurity;
- begin
- Result := DefaultInterface.Security_;
- end;
- {$ENDIF}
- class function CoSWbemSink.Create: ISWbemSink;
- begin
- Result := CreateComObject(CLASS_SWbemSink) as ISWbemSink;
- end;
- class function CoSWbemSink.CreateRemote(const MachineName: string): ISWbemSink;
- begin
- Result := CreateRemoteComObject(MachineName, CLASS_SWbemSink) as ISWbemSink;
- end;
- procedure TSWbemSink.InitServerData;
- const
- CServerData: TServerData = (
- ClassID: '{75718C9A-F029-11D1-A1AC-00C04FB6C223}';
- IntfIID: '{75718C9F-F029-11D1-A1AC-00C04FB6C223}';
- EventIID: '{75718CA0-F029-11D1-A1AC-00C04FB6C223}';
- LicenseKey: nil;
- Version: 500);
- begin
- ServerData := @CServerData;
- end;
- procedure TSWbemSink.Connect;
- var
- punk: IUnknown;
- begin
- if FIntf = nil then
- begin
- punk := GetServer;
- ConnectEvents(punk);
- Fintf:= punk as ISWbemSink;
- end;
- end;
- procedure TSWbemSink.ConnectTo(svrIntf: ISWbemSink);
- begin
- Disconnect;
- FIntf := svrIntf;
- ConnectEvents(FIntf);
- end;
- procedure TSWbemSink.DisConnect;
- begin
- if Fintf <> nil then
- begin
- DisconnectEvents(FIntf);
- FIntf := nil;
- end;
- end;
- function TSWbemSink.GetDefaultInterface: ISWbemSink;
- begin
- if FIntf = nil then
- Connect;
- Assert(FIntf <> nil, 'DefaultInterface is NULL. Component is not connected to Server. You must call ''Connect'' or ''ConnectTo'' before this operation');
- Result := FIntf;
- end;
- constructor TSWbemSink.Create(AOwner: TComponent);
- begin
- inherited Create(AOwner);
- {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
- FProps := TSWbemSinkProperties.Create(Self);
- {$ENDIF}
- end;
- destructor TSWbemSink.Destroy;
- begin
- {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
- FProps.Free;
- {$ENDIF}
- inherited Destroy;
- end;
- {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
- function TSWbemSink.GetServerProperties: TSWbemSinkProperties;
- begin
- Result := FProps;
- end;
- {$ENDIF}
- procedure TSWbemSink.InvokeEvent(DispID: TDispID; var Params: TVariantArray);
- begin
- case DispID of
- -1: Exit; // DISPID_UNKNOWN
- 1: if Assigned(FOnObjectReady) then
- FOnObjectReady(Self, Params[1] {const ISWbemNamedValueSet}, Params[0] {const ISWbemObject});
- 2: if Assigned(FOnCompleted) then
- FOnCompleted(Self, Params[2] {const ISWbemNamedValueSet}, Params[1] {const ISWbemObject}, Params[0] {WbemErrorEnum});
- 3: if Assigned(FOnProgress) then
- FOnProgress(Self, Params[3] {const ISWbemNamedValueSet}, Params[2] {const WideString}, Params[1] {Integer}, Params[0] {Integer});
- 4: if Assigned(FOnObjectPut) then
- FOnObjectPut(Self, Params[1] {const ISWbemNamedValueSet}, Params[0] {const ISWbemObjectPath});
- end; {case DispID}
- end;
- procedure TSWbemSink.Cancel;
- begin
- DefaultInterface.Cancel;
- end;
- {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
- constructor TSWbemSinkProperties.Create(AServer: TSWbemSink);
- begin
- inherited Create;
- FServer := AServer;
- end;
- function TSWbemSinkProperties.GetDefaultInterface: ISWbemSink;
- begin
- Result := FServer.DefaultInterface;
- end;
- {$ENDIF}
- class function CoSWbemDateTime.Create: ISWbemDateTime;
- begin
- Result := CreateComObject(CLASS_SWbemDateTime) as ISWbemDateTime;
- end;
- class function CoSWbemDateTime.CreateRemote(const MachineName: string): ISWbemDateTime;
- begin
- Result := CreateRemoteComObject(MachineName, CLASS_SWbemDateTime) as ISWbemDateTime;
- end;
- procedure TSWbemDateTime.InitServerData;
- const
- CServerData: TServerData = (
- ClassID: '{47DFBE54-CF76-11D3-B38F-00105A1F473A}';
- IntfIID: '{5E97458A-CF77-11D3-B38F-00105A1F473A}';
- EventIID: '';
- LicenseKey: nil;
- Version: 500);
- begin
- ServerData := @CServerData;
- end;
- procedure TSWbemDateTime.Connect;
- var
- punk: IUnknown;
- begin
- if FIntf = nil then
- begin
- punk := GetServer;
- Fintf:= punk as ISWbemDateTime;
- end;
- end;
- procedure TSWbemDateTime.ConnectTo(svrIntf: ISWbemDateTime);
- begin
- Disconnect;
- FIntf := svrIntf;
- end;
- procedure TSWbemDateTime.DisConnect;
- begin
- if Fintf <> nil then
- begin
- FIntf := nil;
- end;
- end;
- function TSWbemDateTime.GetDefaultInterface: ISWbemDateTime;
- begin
- if FIntf = nil then
- Connect;
- Assert(FIntf <> nil, 'DefaultInterface is NULL. Component is not connected to Server. You must call ''Connect'' or ''ConnectTo'' before this operation');
- Result := FIntf;
- end;
- constructor TSWbemDateTime.Create(AOwner: TComponent);
- begin
- inherited Create(AOwner);
- {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
- FProps := TSWbemDateTimeProperties.Create(Self);
- {$ENDIF}
- end;
- destructor TSWbemDateTime.Destroy;
- begin
- {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
- FProps.Free;
- {$ENDIF}
- inherited Destroy;
- end;
- {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
- function TSWbemDateTime.GetServerProperties: TSWbemDateTimeProperties;
- begin
- Result := FProps;
- end;
- {$ENDIF}
- function TSWbemDateTime.Get_Value: WideString;
- begin
- Result := DefaultInterface.Value;
- end;
- procedure TSWbemDateTime.Set_Value(const strValue: WideString);
- { Warning: The property Value has a setter and a getter whose
- types do not match. Delphi was unable to generate a property of
- this sort and so is using a Variant to set the property instead. }
- var
- InterfaceVariant: OleVariant;
- begin
- InterfaceVariant := DefaultInterface;
- InterfaceVariant.Value := strValue;
- end;
- function TSWbemDateTime.Get_Year: Integer;
- begin
- Result := DefaultInterface.Year;
- end;
- procedure TSWbemDateTime.Set_Year(iYear: Integer);
- begin
- Exit;
- end;
- function TSWbemDateTime.Get_YearSpecified: WordBool;
- begin
- Result := DefaultInterface.YearSpecified;
- end;
- procedure TSWbemDateTime.Set_YearSpecified(bYearSpecified: WordBool);
- begin
- Exit;
- end;
- function TSWbemDateTime.Get_Month: Integer;
- begin
- Result := DefaultInterface.Month;
- end;
- procedure TSWbemDateTime.Set_Month(iMonth: Integer);
- begin
- Exit;
- end;
- function TSWbemDateTime.Get_MonthSpecified: WordBool;
- begin
- Result := DefaultInterface.MonthSpecified;
- end;
- procedure TSWbemDateTime.Set_MonthSpecified(bMonthSpecified: WordBool);
- begin
- Exit;
- end;
- function TSWbemDateTime.Get_Day: Integer;
- begin
- Result := DefaultInterface.Day;
- end;
- procedure TSWbemDateTime.Set_Day(iDay: Integer);
- begin
- Exit;
- end;
- function TSWbemDateTime.Get_DaySpecified: WordBool;
- begin
- Result := DefaultInterface.DaySpecified;
- end;
- procedure TSWbemDateTime.Set_DaySpecified(bDaySpecified: WordBool);
- begin
- Exit;
- end;
- function TSWbemDateTime.Get_Hours: Integer;
- begin
- Result := DefaultInterface.Hours;
- end;
- procedure TSWbemDateTime.Set_Hours(iHours: Integer);
- begin
- Exit;
- end;
- function TSWbemDateTime.Get_HoursSpecified: WordBool;
- begin
- Result := DefaultInterface.HoursSpecified;
- end;
- procedure TSWbemDateTime.Set_HoursSpecified(bHoursSpecified: WordBool);
- begin
- Exit;
- end;
- function TSWbemDateTime.Get_Minutes: Integer;
- begin
- Result := DefaultInterface.Minutes;
- end;
- procedure TSWbemDateTime.Set_Minutes(iMinutes: Integer);
- begin
- Exit;
- end;
- function TSWbemDateTime.Get_MinutesSpecified: WordBool;
- begin
- Result := DefaultInterface.MinutesSpecified;
- end;
- procedure TSWbemDateTime.Set_MinutesSpecified(bMinutesSpecified: WordBool);
- begin
- Exit;
- end;
- function TSWbemDateTime.Get_Seconds: Integer;
- begin
- Result := DefaultInterface.Seconds;
- end;
- procedure TSWbemDateTime.Set_Seconds(iSeconds: Integer);
- begin
- Exit;
- end;
- function TSWbemDateTime.Get_SecondsSpecified: WordBool;
- begin
- Result := DefaultInterface.SecondsSpecified;
- end;
- procedure TSWbemDateTime.Set_SecondsSpecified(bSecondsSpecified: WordBool);
- begin
- Exit;
- end;
- function TSWbemDateTime.Get_Microseconds: Integer;
- begin
- Result := DefaultInterface.Microseconds;
- end;
- procedure TSWbemDateTime.Set_Microseconds(iMicroseconds: Integer);
- begin
- Exit;
- end;
- function TSWbemDateTime.Get_MicrosecondsSpecified: WordBool;
- begin
- Result := DefaultInterface.MicrosecondsSpecified;
- end;
- procedure TSWbemDateTime.Set_MicrosecondsSpecified(bMicrosecondsSpecified: WordBool);
- begin
- Exit;
- end;
- function TSWbemDateTime.Get_UTC: Integer;
- begin
- Result := DefaultInterface.UTC;
- end;
- procedure TSWbemDateTime.Set_UTC(iUTC: Integer);
- begin
- Exit;
- end;
- function TSWbemDateTime.Get_UTCSpecified: WordBool;
- begin
- Result := DefaultInterface.UTCSpecified;
- end;
- procedure TSWbemDateTime.Set_UTCSpecified(bUTCSpecified: WordBool);
- begin
- Exit;
- end;
- function TSWbemDateTime.Get_IsInterval: WordBool;
- begin
- Result := DefaultInterface.IsInterval;
- end;
- procedure TSWbemDateTime.Set_IsInterval(bIsInterval: WordBool);
- begin
- Exit;
- end;
- function TSWbemDateTime.GetVarDate(bIsLocal: WordBool): TDateTime;
- begin
- Result := DefaultInterface.GetVarDate(bIsLocal);
- end;
- procedure TSWbemDateTime.SetVarDate(dVarDate: TDateTime; bIsLocal: WordBool);
- begin
- DefaultInterface.SetVarDate(dVarDate, bIsLocal);
- end;
- function TSWbemDateTime.GetFileTime(bIsLocal: WordBool): WideString;
- begin
- Result := DefaultInterface.GetFileTime(bIsLocal);
- end;
- procedure TSWbemDateTime.SetFileTime(const strFileTime: WideString; bIsLocal: WordBool);
- begin
- DefaultInterface.SetFileTime(strFileTime, bIsLocal);
- end;
- {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
- constructor TSWbemDateTimeProperties.Create(AServer: TSWbemDateTime);
- begin
- inherited Create;
- FServer := AServer;
- end;
- function TSWbemDateTimeProperties.GetDefaultInterface: ISWbemDateTime;
- begin
- Result := FServer.DefaultInterface;
- end;
- function TSWbemDateTimeProperties.Get_Value: WideString;
- begin
- Result := DefaultInterface.Value;
- end;
- procedure TSWbemDateTimeProperties.Set_Value(const strValue: WideString);
- { Warning: The property Value has a setter and a getter whose
- types do not match. Delphi was unable to generate a property of
- this sort and so is using a Variant to set the property instead. }
- var
- InterfaceVariant: OleVariant;
- begin
- InterfaceVariant := DefaultInterface;
- InterfaceVariant.Value := strValue;
- end;
- function TSWbemDateTimeProperties.Get_Year: Integer;
- begin
- Result := DefaultInterface.Year;
- end;
- procedure TSWbemDateTimeProperties.Set_Year(iYear: Integer);
- begin
- Exit;
- end;
- function TSWbemDateTimeProperties.Get_YearSpecified: WordBool;
- begin
- Result := DefaultInterface.YearSpecified;
- end;
- procedure TSWbemDateTimeProperties.Set_YearSpecified(bYearSpecified: WordBool);
- begin
- Exit;
- end;
- function TSWbemDateTimeProperties.Get_Month: Integer;
- begin
- Result := DefaultInterface.Month;
- end;
- procedure TSWbemDateTimeProperties.Set_Month(iMonth: Integer);
- begin
- Exit;
- end;
- function TSWbemDateTimeProperties.Get_MonthSpecified: WordBool;
- begin
- Result := DefaultInterface.MonthSpecified;
- end;
- procedure TSWbemDateTimeProperties.Set_MonthSpecified(bMonthSpecified: WordBool);
- begin
- Exit;
- end;
- function TSWbemDateTimeProperties.Get_Day: Integer;
- begin
- Result := DefaultInterface.Day;
- end;
- procedure TSWbemDateTimeProperties.Set_Day(iDay: Integer);
- begin
- Exit;
- end;
- function TSWbemDateTimeProperties.Get_DaySpecified: WordBool;
- begin
- Result := DefaultInterface.DaySpecified;
- end;
- procedure TSWbemDateTimeProperties.Set_DaySpecified(bDaySpecified: WordBool);
- begin
- Exit;
- end;
- function TSWbemDateTimeProperties.Get_Hours: Integer;
- begin
- Result := DefaultInterface.Hours;
- end;
- procedure TSWbemDateTimeProperties.Set_Hours(iHours: Integer);
- begin
- Exit;
- end;
- function TSWbemDateTimeProperties.Get_HoursSpecified: WordBool;
- begin
- Result := DefaultInterface.HoursSpecified;
- end;
- procedure TSWbemDateTimeProperties.Set_HoursSpecified(bHoursSpecified: WordBool);
- begin
- Exit;
- end;
- function TSWbemDateTimeProperties.Get_Minutes: Integer;
- begin
- Result := DefaultInterface.Minutes;
- end;
- procedure TSWbemDateTimeProperties.Set_Minutes(iMinutes: Integer);
- begin
- Exit;
- end;
- function TSWbemDateTimeProperties.Get_MinutesSpecified: WordBool;
- begin
- Result := DefaultInterface.MinutesSpecified;
- end;
- procedure TSWbemDateTimeProperties.Set_MinutesSpecified(bMinutesSpecified: WordBool);
- begin
- Exit;
- end;
- function TSWbemDateTimeProperties.Get_Seconds: Integer;
- begin
- Result := DefaultInterface.Seconds;
- end;
- procedure TSWbemDateTimeProperties.Set_Seconds(iSeconds: Integer);
- begin
- Exit;
- end;
- function TSWbemDateTimeProperties.Get_SecondsSpecified: WordBool;
- begin
- Result := DefaultInterface.SecondsSpecified;
- end;
- procedure TSWbemDateTimeProperties.Set_SecondsSpecified(bSecondsSpecified: WordBool);
- begin
- Exit;
- end;
- function TSWbemDateTimeProperties.Get_Microseconds: Integer;
- begin
- Result := DefaultInterface.Microseconds;
- end;
- procedure TSWbemDateTimeProperties.Set_Microseconds(iMicroseconds: Integer);
- begin
- Exit;
- end;
- function TSWbemDateTimeProperties.Get_MicrosecondsSpecified: WordBool;
- begin
- Result := DefaultInterface.MicrosecondsSpecified;
- end;
- procedure TSWbemDateTimeProperties.Set_MicrosecondsSpecified(bMicrosecondsSpecified: WordBool);
- begin
- Exit;
- end;
- function TSWbemDateTimeProperties.Get_UTC: Integer;
- begin
- Result := DefaultInterface.UTC;
- end;
- procedure TSWbemDateTimeProperties.Set_UTC(iUTC: Integer);
- begin
- Exit;
- end;
- function TSWbemDateTimeProperties.Get_UTCSpecified: WordBool;
- begin
- Result := DefaultInterface.UTCSpecified;
- end;
- procedure TSWbemDateTimeProperties.Set_UTCSpecified(bUTCSpecified: WordBool);
- begin
- Exit;
- end;
- function TSWbemDateTimeProperties.Get_IsInterval: WordBool;
- begin
- Result := DefaultInterface.IsInterval;
- end;
- procedure TSWbemDateTimeProperties.Set_IsInterval(bIsInterval: WordBool);
- begin
- Exit;
- end;
- {$ENDIF}
- class function CoSWbemRefresher.Create: ISWbemRefresher;
- begin
- Result := CreateComObject(CLASS_SWbemRefresher) as ISWbemRefresher;
- end;
- class function CoSWbemRefresher.CreateRemote(const MachineName: string): ISWbemRefresher;
- begin
- Result := CreateRemoteComObject(MachineName, CLASS_SWbemRefresher) as ISWbemRefresher;
- end;
- procedure TSWbemRefresher.InitServerData;
- const
- CServerData: TServerData = (
- ClassID: '{D269BF5C-D9C1-11D3-B38F-00105A1F473A}';
- IntfIID: '{14D8250E-D9C2-11D3-B38F-00105A1F473A}';
- EventIID: '';
- LicenseKey: nil;
- Version: 500);
- begin
- ServerData := @CServerData;
- end;
- procedure TSWbemRefresher.Connect;
- var
- punk: IUnknown;
- begin
- if FIntf = nil then
- begin
- punk := GetServer;
- Fintf:= punk as ISWbemRefresher;
- end;
- end;
- procedure TSWbemRefresher.ConnectTo(svrIntf: ISWbemRefresher);
- begin
- Disconnect;
- FIntf := svrIntf;
- end;
- procedure TSWbemRefresher.DisConnect;
- begin
- if Fintf <> nil then
- begin
- FIntf := nil;
- end;
- end;
- function TSWbemRefresher.GetDefaultInterface: ISWbemRefresher;
- begin
- if FIntf = nil then
- Connect;
- Assert(FIntf <> nil, 'DefaultInterface is NULL. Component is not connected to Server. You must call ''Connect'' or ''ConnectTo'' before this operation');
- Result := FIntf;
- end;
- constructor TSWbemRefresher.Create(AOwner: TComponent);
- begin
- inherited Create(AOwner);
- {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
- FProps := TSWbemRefresherProperties.Create(Self);
- {$ENDIF}
- end;
- destructor TSWbemRefresher.Destroy;
- begin
- {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
- FProps.Free;
- {$ENDIF}
- inherited Destroy;
- end;
- {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
- function TSWbemRefresher.GetServerProperties: TSWbemRefresherProperties;
- begin
- Result := FProps;
- end;
- {$ENDIF}
- function TSWbemRefresher.Get_Count: Integer;
- begin
- Result := DefaultInterface.Count;
- end;
- function TSWbemRefresher.Get_AutoReconnect: WordBool;
- begin
- Result := DefaultInterface.AutoReconnect;
- end;
- procedure TSWbemRefresher.Set_AutoReconnect(bCount: WordBool);
- begin
- Exit;
- end;
- function TSWbemRefresher.Item(iIndex: Integer): ISWbemRefreshableItem;
- begin
- Result := DefaultInterface.Item(iIndex);
- end;
- function TSWbemRefresher.Add(const objWbemServices: ISWbemServicesEx;
- const bsInstancePath: WideString; iFlags: Integer;
- const objWbemNamedValueSet: IDispatch): ISWbemRefreshableItem;
- begin
- Result := DefaultInterface.Add(objWbemServices, bsInstancePath, iFlags, objWbemNamedValueSet);
- end;
- function TSWbemRefresher.AddEnum(const objWbemServices: ISWbemServicesEx;
- const bsClassName: WideString; iFlags: Integer;
- const objWbemNamedValueSet: IDispatch): ISWbemRefreshableItem;
- begin
- Result := DefaultInterface.AddEnum(objWbemServices, bsClassName, iFlags, objWbemNamedValueSet);
- end;
- procedure TSWbemRefresher.Remove(iIndex: Integer; iFlags: Integer);
- begin
- DefaultInterface.Remove(iIndex, iFlags);
- end;
- procedure TSWbemRefresher.Refresh(iFlags: Integer);
- begin
- DefaultInterface.Refresh(iFlags);
- end;
- procedure TSWbemRefresher.DeleteAll;
- begin
- DefaultInterface.DeleteAll;
- end;
- {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
- constructor TSWbemRefresherProperties.Create(AServer: TSWbemRefresher);
- begin
- inherited Create;
- FServer := AServer;
- end;
- function TSWbemRefresherProperties.GetDefaultInterface: ISWbemRefresher;
- begin
- Result := FServer.DefaultInterface;
- end;
- function TSWbemRefresherProperties.Get_Count: Integer;
- begin
- Result := DefaultInterface.Count;
- end;
- function TSWbemRefresherProperties.Get_AutoReconnect: WordBool;
- begin
- Result := DefaultInterface.AutoReconnect;
- end;
- procedure TSWbemRefresherProperties.Set_AutoReconnect(bCount: WordBool);
- begin
- Exit;
- end;
- {$ENDIF}
- class function CoSWbemServices.Create: ISWbemServices;
- begin
- Result := CreateComObject(CLASS_SWbemServices) as ISWbemServices;
- end;
- class function CoSWbemServices.CreateRemote(const MachineName: string): ISWbemServices;
- begin
- Result := CreateRemoteComObject(MachineName, CLASS_SWbemServices) as ISWbemServices;
- end;
- class function CoSWbemServicesEx.Create: ISWbemServicesEx;
- begin
- Result := CreateComObject(CLASS_SWbemServicesEx) as ISWbemServicesEx;
- end;
- class function CoSWbemServicesEx.CreateRemote(const MachineName: string): ISWbemServicesEx;
- begin
- Result := CreateRemoteComObject(MachineName, CLASS_SWbemServicesEx) as ISWbemServicesEx;
- end;
- class function CoSWbemObject.Create: ISWbemObject;
- begin
- Result := CreateComObject(CLASS_SWbemObject) as ISWbemObject;
- end;
- class function CoSWbemObject.CreateRemote(const MachineName: string): ISWbemObject;
- begin
- Result := CreateRemoteComObject(MachineName, CLASS_SWbemObject) as ISWbemObject;
- end;
- class function CoSWbemObjectEx.Create: ISWbemObjectEx;
- begin
- Result := CreateComObject(CLASS_SWbemObjectEx) as ISWbemObjectEx;
- end;
- class function CoSWbemObjectEx.CreateRemote(const MachineName: string): ISWbemObjectEx;
- begin
- Result := CreateRemoteComObject(MachineName, CLASS_SWbemObjectEx) as ISWbemObjectEx;
- end;
- class function CoSWbemObjectSet.Create: ISWbemObjectSet;
- begin
- Result := CreateComObject(CLASS_SWbemObjectSet) as ISWbemObjectSet;
- end;
- class function CoSWbemObjectSet.CreateRemote(const MachineName: string): ISWbemObjectSet;
- begin
- Result := CreateRemoteComObject(MachineName, CLASS_SWbemObjectSet) as ISWbemObjectSet;
- end;
- class function CoSWbemNamedValue.Create: ISWbemNamedValue;
- begin
- Result := CreateComObject(CLASS_SWbemNamedValue) as ISWbemNamedValue;
- end;
- class function CoSWbemNamedValue.CreateRemote(const MachineName: string): ISWbemNamedValue;
- begin
- Result := CreateRemoteComObject(MachineName, CLASS_SWbemNamedValue) as ISWbemNamedValue;
- end;
- class function CoSWbemQualifier.Create: ISWbemQualifier;
- begin
- Result := CreateComObject(CLASS_SWbemQualifier) as ISWbemQualifier;
- end;
- class function CoSWbemQualifier.CreateRemote(const MachineName: string): ISWbemQualifier;
- begin
- Result := CreateRemoteComObject(MachineName, CLASS_SWbemQualifier) as ISWbemQualifier;
- end;
- class function CoSWbemQualifierSet.Create: ISWbemQualifierSet;
- begin
- Result := CreateComObject(CLASS_SWbemQualifierSet) as ISWbemQualifierSet;
- end;
- class function CoSWbemQualifierSet.CreateRemote(const MachineName: string): ISWbemQualifierSet;
- begin
- Result := CreateRemoteComObject(MachineName, CLASS_SWbemQualifierSet) as ISWbemQualifierSet;
- end;
- class function CoSWbemProperty.Create: ISWbemProperty;
- begin
- Result := CreateComObject(CLASS_SWbemProperty) as ISWbemProperty;
- end;
- class function CoSWbemProperty.CreateRemote(const MachineName: string): ISWbemProperty;
- begin
- Result := CreateRemoteComObject(MachineName, CLASS_SWbemProperty) as ISWbemProperty;
- end;
- class function CoSWbemPropertySet.Create: ISWbemPropertySet;
- begin
- Result := CreateComObject(CLASS_SWbemPropertySet) as ISWbemPropertySet;
- end;
- class function CoSWbemPropertySet.CreateRemote(const MachineName: string): ISWbemPropertySet;
- begin
- Result := CreateRemoteComObject(MachineName, CLASS_SWbemPropertySet) as ISWbemPropertySet;
- end;
- class function CoSWbemMethod.Create: ISWbemMethod;
- begin
- Result := CreateComObject(CLASS_SWbemMethod) as ISWbemMethod;
- end;
- class function CoSWbemMethod.CreateRemote(const MachineName: string): ISWbemMethod;
- begin
- Result := CreateRemoteComObject(MachineName, CLASS_SWbemMethod) as ISWbemMethod;
- end;
- class function CoSWbemMethodSet.Create: ISWbemMethodSet;
- begin
- Result := CreateComObject(CLASS_SWbemMethodSet) as ISWbemMethodSet;
- end;
- class function CoSWbemMethodSet.CreateRemote(const MachineName: string): ISWbemMethodSet;
- begin
- Result := CreateRemoteComObject(MachineName, CLASS_SWbemMethodSet) as ISWbemMethodSet;
- end;
- class function CoSWbemEventSource.Create: ISWbemEventSource;
- begin
- Result := CreateComObject(CLASS_SWbemEventSource) as ISWbemEventSource;
- end;
- class function CoSWbemEventSource.CreateRemote(const MachineName: string): ISWbemEventSource;
- begin
- Result := CreateRemoteComObject(MachineName, CLASS_SWbemEventSource) as ISWbemEventSource;
- end;
- class function CoSWbemSecurity.Create: ISWbemSecurity;
- begin
- Result := CreateComObject(CLASS_SWbemSecurity) as ISWbemSecurity;
- end;
- class function CoSWbemSecurity.CreateRemote(const MachineName: string): ISWbemSecurity;
- begin
- Result := CreateRemoteComObject(MachineName, CLASS_SWbemSecurity) as ISWbemSecurity;
- end;
- class function CoSWbemPrivilege.Create: ISWbemPrivilege;
- begin
- Result := CreateComObject(CLASS_SWbemPrivilege) as ISWbemPrivilege;
- end;
- class function CoSWbemPrivilege.CreateRemote(const MachineName: string): ISWbemPrivilege;
- begin
- Result := CreateRemoteComObject(MachineName, CLASS_SWbemPrivilege) as ISWbemPrivilege;
- end;
- class function CoSWbemPrivilegeSet.Create: ISWbemPrivilegeSet;
- begin
- Result := CreateComObject(CLASS_SWbemPrivilegeSet) as ISWbemPrivilegeSet;
- end;
- class function CoSWbemPrivilegeSet.CreateRemote(const MachineName: string): ISWbemPrivilegeSet;
- begin
- Result := CreateRemoteComObject(MachineName, CLASS_SWbemPrivilegeSet) as ISWbemPrivilegeSet;
- end;
- class function CoSWbemRefreshableItem.Create: ISWbemRefreshableItem;
- begin
- Result := CreateComObject(CLASS_SWbemRefreshableItem) as ISWbemRefreshableItem;
- end;
- class function CoSWbemRefreshableItem.CreateRemote(const MachineName: string): ISWbemRefreshableItem;
- begin
- Result := CreateRemoteComObject(MachineName, CLASS_SWbemRefreshableItem) as ISWbemRefreshableItem;
- end;
- procedure Register;
- begin
- RegisterComponents(dtlServerPage, [TSWbemLocator, TSWbemNamedValueSet, TSWbemObjectPath, TSWbemLastError,
- TSWbemSink, TSWbemDateTime, TSWbemRefresher]);
- end;
- end.