Skip to content

serviceStatus structure initialization : missing values  #36985

@pcreyssels

Description

@pcreyssels

I tried your example in , but setservicestatus (from advapi32.dll) return 0 and Get LastError = 13;
I tried to initiliaze serviceStatus.dwServiceType to 0x00000010(SERVICE_WIN32_OWN_PROCESS) and serviceStatus.dwControlsAccepted = 0x00000000 and then it works

is it mandatory to use advapi32.dll in onstart() onstop() onpause() oncontinue() ?
why not use simply override with custom code as example :
https://www.c-sharpcorner.com/article/create-windows-services-in-c-sharp/

Could you indicate the best initialization value for
dwServiceType, dwControlsAccepted, dwWin32ExitCode, dwServiceSpecificExitCode, dwCheckPoint

patrice

Document Details

Do not edit this section. It is required for learn.Microsoft.com ➟ GitHub issue linking.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions