Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect type is used for Advapi32.RegisterServiceCtrlHandler callback #1510

Open
dalle opened this issue Mar 14, 2023 · 2 comments
Open

Incorrect type is used for Advapi32.RegisterServiceCtrlHandler callback #1510

dalle opened this issue Mar 14, 2023 · 2 comments

Comments

@dalle
Copy link

dalle commented Mar 14, 2023

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

public SERVICE_STATUS_HANDLE RegisterServiceCtrlHandler(String lpServiceName,
Handler lpHandlerProc);

@matthiasblaesing
Copy link
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.

@matthiasblaesing
Copy link
Member

Seems I'm not alone:

https://stackoverflow.com/questions/10037654/how-can-a-windows-service-application-be-written-in-haskell

Seems RegisterServiceCtrlHandler is broken.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants