Windows 10偷偷增加了几种Service类型,用处不明

老的sc里,类型选项大概只有6个,绝对不到10个

own|share|interact|kernel|filesys|rec

https://technet.microsoft.com/en-us/library/cc990289.aspx

现在Windows 10里有 

own|share|interact|kernel|filesys|rec|adapt|userown|usershare

多了

adapt|userown|usershare

adapt好理解,估计是driver里的某种类型。userown和usershare就不知道了。

古怪的是,我实验了userown,建完后,在service一览里压根不显示,只在注册表里出现了而已。

C:\Users\q\Downloads>sc create TrustedInstaller_Test binPath= "c:\windows\system32\cmd.exe /K start" type= userown obj= TrustedInstaller
[SC] CreateService SUCCESS

C:\Users\q\Downloads>sc qc TrustedInstaller_Test
[SC] QueryServiceConfig SUCCESS
SERVICE_NAME: TrustedInstaller_Test
        TYPE               : 50  USER_OWN_PROCESS TEMPLATE
        START_TYPE         : 3   DEMAND_START
        ERROR_CONTROL      : 1   NORMAL
        BINARY_PATH_NAME   : c:\windows\system32\cmd.exe /K start
        LOAD_ORDER_GROUP   :
        TAG                : 0
        DISPLAY_NAME       : TrustedInstaller_Test
        DEPENDENCIES       :
        SERVICE_START_NAME :


看来关键就是 USER_OWN_PROCESS TEMPLATE的意思了,没找到文档, msdn里CreateService的type参数说明里只写了7个:

  • The service type. This parameter can be one of the following values.

    Value Meaning
    • SERVICE_ADAPTER

    • 0x00000004

    Reserved.

    • SERVICE_FILE_SYSTEM_DRIVER

    • 0x00000002

    File system driver service.

    • SERVICE_KERNEL_DRIVER

    • 0x00000001

    Driver service.

    • SERVICE_RECOGNIZER_DRIVER

    • 0x00000008

    Reserved.

    • SERVICE_WIN32_OWN_PROCESS

    • 0x00000010

    Service that runs in its own process.

    • SERVICE_WIN32_SHARE_PROCESS

    • 0x00000020

    Service that shares a process with one or more other services. For more information, see Service Programs.

     

    If you specify either SERVICE_WIN32_OWN_PROCESS or SERVICE_WIN32_SHARE_PROCESS, and the service is running in the context of the LocalSystem account, you can also specify the following value.

    Value Meaning
    • SERVICE_INTERACTIVE_PROCESS

    • 0x00000100

    The service can interact with the desktop.

    For more information, see Interactive Services.

     

你可能感兴趣的:(windows,service,type)