Skip to content

Incorrect type is used for Advapi32.RegisterServiceCtrlHandler callback #1510

Closed

Description

@dalle

Library.Handler is used instead of Winsvc.Handler as type for lpHandlerProc in Advapi32.RegisterServiceCtrlHandler.

public SERVICE_STATUS_HANDLE RegisterServiceCtrlHandler(String lpServiceName,
Handler lpHandlerProc);

Activity

  1. matthiasblaesing commented on Mar 16, 2023

    @matthiasblaesing
    Member

    Valid point. I tried to test this method and utterly failed. I'm currently pondering killing support for RegisterServiceCtrlHandler in favor of RegisterServiceCtrlHandlerEx, which is already in the bindings, the suggested successor and tested.

    If anyone wants to work on this, this is my test and it fails:

    https://github.com/matthiasblaesing/jna/tree/winsvc_handler

    I don't know why the codepath for RegisterServiceCtrlHandler fails, but it does.

  2. added a commit that references this issue on May 10, 2026
    bb90e20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions