Skip to content

ServiceTypeConstants

The Win32 service-type values. Read into ServiceManager.Type at configuration time and reported back by the SCM through ServiceState.Type at query time. Determines whether the service runs in its own process, in a shared host process, or is a kernel driver --- and, historically, whether it can interact with the desktop.

ConstantValueDescription
tbServiceTypeKernelDriver1A kernel-mode driver. Not applicable to twinBASIC services --- kernel drivers are written in C and built against the Windows DDK.
tbServiceTypeSystemDriver2A file-system kernel driver. Same caveat as above.
tbServiceTypeAdapter4Legacy adapter service (network-adapter binding). Not used by modern services.
tbServiceTypeRecognizerDriver8A file-system-recognizer driver. Kernel-only.
tbServiceTypeOwnProcess16The service runs in its own dedicated EXE process. The typical setting for a one-service EXE.
tbServiceTypeShareProcess32The service runs alongside other services in a shared host EXE. Used when one EXE hosts multiple distinct services (ConfigureNew called more than once); the SCM keeps a single process alive that serves all of them.
tbServiceTypeOwnProcessInteractive272tbServiceTypeOwnProcess with the interactive bit (SERVICE_INTERACTIVE_PROCESS) set. Not supported on Windows Vista and later --- see note below.
tbServiceTypeShareProcessInteractive288tbServiceTypeShareProcess with the interactive bit set. Same caveat as above.

INFO

Windows Vista and later run services in Session 0, which has no user desktop and no message-loop interaction with logged-in users --- the SERVICE_INTERACTIVE_PROCESS flag is silently ignored. The Interactive constants are kept in the enum for compatibility, but services that need user-interface elements should use a separate UI process (launched via the Services package or via inter-process communication) rather than the interactive-service mechanism.

For user-mode twinBASIC services, the only two values that matter in practice are tbServiceTypeOwnProcess and tbServiceTypeShareProcess.

twinBASIC and LOGO copyright of "WaynePhillipsEA" author