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

Win32 Service API and SERVICE_CONTROL_SHUTDOWN #258

Closed
wants to merge 6 commits into from
Closed

Win32 Service API and SERVICE_CONTROL_SHUTDOWN #258

wants to merge 6 commits into from

Conversation

hakanai
Copy link
Contributor

@hakanai hakanai commented Aug 8, 2013

SERVICE_CONTROL_SHUTDOWN is used from the ntservice contrib module's own copy of Winsvc, so not having it in contrib/platform blocks any plans to decommission that ntservice stuff.

I also moved out Advapi32. As far as I know, this is everything in Win32Service which wasn't already in contrib/platform, so it should be possible to remove the JNA interface stuff from contrib/ntservice now.

SERVICE_CONTROL_SHUTDOWN is used from the ntservice contrib module's
own copy of Winsvc, so not having it in core blocks any plans to
decommission that ntservice stuff.
ntservice had an Advapi32 with some methods and structures which
weren't in the main platform one. These were copied over verbatim,
though I noticed some potentially questionable things while doing so,
which should probably be fixed in following commits if they are deemed
to matter.
@dblock
Copy link
Member

dblock commented Aug 8, 2013

Can you merge this from upstream, please.

@dblock
Copy link
Member

dblock commented Aug 8, 2013

Also, do update CHANGELOG, thx.

@hakanai
Copy link
Contributor Author

hakanai commented Aug 9, 2013

I'll update the changelog but I don't know what you mean by the other thing.

@dblock
Copy link
Member

dblock commented Aug 9, 2013

See it says that this cannot be automatically merged here?

git remote add upstream git@github.com:twall/jna.git
git checkout patch-1
git pull upstream master
# merge any conflicts
git add ... any conflicts
git commit -m "Merged from master."
git push origin patch-1

@@ -9,6 +9,7 @@ Features
* Use predictable names for CPU arch prefix (namely x86, x86-64); names correspond to OSGI processor values - [@twall](https://github.com/twall).
* Avoid superfluous Structure memory allocation from native - [@twall](https://github.com/twall).
* Added `Library.OPTION_CLASSLOADER`, which enables loading native libraries from any class loader (including JNA's native library). This enables parallel dependencies on JNA (e.g. within a tomcat deployment without having to include JNA in the app server environment) - [@twall](https://github.com/twall).
* Copied Win32 service-related code from `ntservice` contrib module to `platform` - [@trejkaz](https://github.com/trejkaz)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing a dot at the end of this line (it's a sentence).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(a) It doesn't read like one.
(b) The period goes inside the parentheses in that situation (that's called Skitt's Law.)

@hakanai
Copy link
Contributor Author

hakanai commented Aug 12, 2013

Merged from upstream. Even though I thought I had already pulled all changes before I started, I apparently hadn't...

Since the changelog line conflicted too, I put the period on the end, while chuckling about the irony that your own committers aren't doing it (see the few lines around mine.)

@dblock
Copy link
Member

dblock commented Aug 26, 2013

Thanks. This looks good, but the service functions need unit tests (we keep full coverage in platform.win32). I'm happy to write those, but it will have to wait some.

@dblock
Copy link
Member

dblock commented Sep 25, 2013

Bump. I didn't get to this yet. Please don't hesitate to update with tests.

matthiasblaesing added a commit to matthiasblaesing/jna that referenced this pull request Aug 13, 2017
The ntservice poject contained additional definitions for windows
service related functionality. Unittests are added in the form of a
sample service implementation, that is installed/uninstalled and
invoked.

com.sun.jna.platform.win32.Advapi32:
- StartServiceCtrlDispatcher
- RegisterServiceCtrlHandler
- RegisterServiceCtrlHandlerEx
- SetServiceStatus
- CreateService
- DeleteService

com.sun.jna.platform.win32.Winsvc:
- Handler
- HandlerEx
- SERVICE_MAIN_FUNCTION
- SERVICE_TABLE_ENTRY
- SERVICE_DESCRIPTION
- SERVICE_STATUS_HANDLE

Closes: java-native-access#821
Closes: java-native-access#258
matthiasblaesing added a commit to matthiasblaesing/jna that referenced this pull request Aug 17, 2017
The ntservice poject contained additional definitions for windows
service related functionality. Unittests are added in the form of a
sample service implementation, that is installed/uninstalled and
invoked.

com.sun.jna.platform.win32.Advapi32:
- StartServiceCtrlDispatcher
- RegisterServiceCtrlHandler
- RegisterServiceCtrlHandlerEx
- SetServiceStatus
- CreateService
- DeleteService

com.sun.jna.platform.win32.Winsvc:
- Handler
- HandlerEx
- SERVICE_MAIN_FUNCTION
- SERVICE_TABLE_ENTRY
- SERVICE_DESCRIPTION
- SERVICE_STATUS_HANDLE

Closes: java-native-access#821
Closes: java-native-access#258
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants