WESL _ UserSetting. GetCustomShellWESL_UserSetting.GetCustomShell

此方法基于 (SID) 的安全标识符检索特定用户或组的 Shell 启动器配置。This method retrieves the Shell Launcher configuration for a specific user or group, based on the security identifier (SID).

语法Syntax

[Static] uint32 GetCustomShell (
    [In, Required] string Sid,
    [Out, Required] string Shell,
    [Out, Required] sint32 CustomReturnCodes[],
    [Out, Required] sint32 CustomReturnCodesAction[],
    [Out, Required] sint32 DefaultAction
);

参数Parameters

Sid [在中,需要 ] 一个字符串,该字符串包含为其配置 Shell 启动器的用户或组的安全标识符 (SID) 。Sid [in, required] A string containing the security identifier (SID) of the user or group that Shell Launcher is configured for.

Shell [out,要求 ] Shell 启动器启动的应用程序或可执行文件以 shell 开头。Shell [out, required] The application or executable that Shell Launcher starts as the shell.

CustomReturnCodes [out,需要 ] shell 应用程序返回的一组自定义返回代码。CustomReturnCodes [out, required] An array of custom return codes returned by the shell application.

CustomReturnCodesAction [out,需要 ] 一个自定义返回代码操作的数组,这些操作可确定 Shell 启动程序在 shell 应用程序退出时所采取的操作。CustomReturnCodesAction [out, required] An array of custom return code actions that determine the action that Shell Launcher takes when the shell application exits. 自定义操作将映射到 CustomReturnCodes 的数组。The custom actions map to the array of CustomReturnCodes.

下表中定义了可能的操作:The possible actions are defined in the following table:

Value 说明Description

00

重新启动 shell。Restart the shell.

11

重启设备。Restart the device.

22

关闭设备。Shut down the device.

33

不执行任何操作。Do nothing.

DefaultAction [ out,需要 shell ] 应用程序退出时 shell 启动程序所采用的默认操作。DefaultAction [out, required] The default action that Shell Launcher takes when the shell application exits.

下表中定义了可能的操作:The possible actions are defined in the following table:

Value 说明Description

00

重新启动 shell。Restart the shell.

11

重启设备。Restart the device.

22

关闭设备。Shut down the device.

33

不执行任何操作。Do nothing.

返回值Return Value

返回一个 HRESULT 值,该值指示 wmi 状态wmi 错误Returns an HRESULT value that indicates WMI status or a WMI error.

备注Remarks

Shell 启动器根据应用程序的返回值,使用 CustomReturnCodesCustomReturnCodesAction 数组来确定 shell 应用程序退出时的系统行为。Shell Launcher uses the CustomReturnCodes and CustomReturnCodesAction arrays to determine the system behavior when the shell application exits, based on the return value of the application.

如果 CustomReturnCodes 中不存在返回值,或者在 CustomReturnCodesAction 中定义的相应操作不是有效的值,Shell 启动器将使用 DefaultAction 来确定系统行为。If the return value does not exist in CustomReturnCodes , or if the corresponding action defined in CustomReturnCodesAction is not a valid value, Shell Launcher uses DefaultAction to determine system behavior. 如果未定义 DefaultAction 或不是有效的值,shell 启动程序将重新启动 shell 应用程序。If DefaultAction is not defined, or is not a valid value, Shell Launcher restarts the shell application.

要求Requirements

Windows 版本Windows Edition 支持Supported
Windows 10 家庭版Windows 10 Home No
Windows 10 专业版Windows 10 Pro No
Windows 10 企业版Windows 10 Enterprise Yes
Windows 10 教育版Windows 10 Education Yes

WESL _ UserSettingWESL_UserSetting

Shell 启动程序Shell Launcher