Platforms to show: All Mac Windows Linux Cross-Platform

Back to WindowsWMIMBS class.

WindowsWMIMBS.InitSecurity(AuthnLevel as Integer, ImpLevel as Integer) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Windows MBS Win Plugin 13.1 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Registers security and sets the default security values for the process.

You can call this method before creating WindowsWMIMBS object, you can prepare security settings for remote connections.

AuthnLevel:
The default authentication level for the process. Both servers and clients use this parameter when they call CoInitializeSecurity. COM will fail calls that arrive with a lower authentication level. By default, all proxies will use at least this authentication level. This value should contain one of the authentication level constants. By default, all calls to IUnknown are made at this level.

ImpLevel:
The default impersonation level for proxies. The value of this parameter is used only when the process is a client. It should be a value from the impersonation level constants, except for kImpersonationLevelDefault, which is not for use with CoInitializeSecurity.
Outgoing calls from the client always use the impersonation level as specified. (It is not negotiated.) Incoming calls to the client can be at any impersonation level. By default, all IUnknown calls are made with this impersonation level, so even security-aware applications should set this level carefully. To determine which impersonation levels each authentication service supports, see the description of the authentication services in COM and Security Packages. For more information about impersonation levels, see Impersonation.

Please call in App.Constructor before Xojo can initialize COM and prevent our function from working!

See also:

Some examples using this method:

WindowsWMIMBS.InitSecurity(remote as boolean) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Windows MBS Win Plugin 12.2 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Initializes security.

You can call this method before creating WindowsWMIMBS object, you can prepare security settings for remote connections.

Calling InitSecurity with remote=true will initialize security with kImpersonationLevelImpersonate. If remote=false, we use kImpersonationLevelIdentity which is the default.

Please call in App.Constructor before Xojo can initialize COM and prevent our function from working!

See also:

The items on this page are in the following plugins: MBS Win Plugin.


The biggest plugin in space...