

![]() | Start a set with this search |
![]() | Include this search in one of my sets |
![]() | Exclude this search from one of my sets |
![]() | Permalink to these results Paste this link in email or IM: |
| Atom feed for tracking future search results Paste this URL into your reader: |
28 messages in net.java.dev.jna.usersRe: [jna-users] Win32 Service Callbacks| From | Sent On | Attachments |
|---|---|---|
| Thomas Börkel | Aug 21, 2007 6:26 am | |
| Thomas Börkel | Aug 22, 2007 12:35 am | |
| Wayne Meissner | Aug 22, 2007 4:38 pm | |
| Thomas Börkel | Aug 22, 2007 10:36 pm | |
| Timothy Wall | Aug 31, 2007 7:23 am | |
| Thomas Börkel | Aug 31, 2007 7:47 am | |
| Timothy Wall | Aug 31, 2007 7:55 am | |
| Thomas Börkel | Sep 3, 2007 6:29 am | |
| Thomas Börkel | Sep 3, 2007 1:11 pm | |
| Timothy Wall | Sep 6, 2007 11:21 am | |
| Thomas Börkel | Sep 7, 2007 7:08 am | |
| Timothy Wall | Sep 7, 2007 7:43 am | |
| Thomas Börkel | Sep 10, 2007 12:18 am | |
| Thomas Börkel | Sep 10, 2007 4:36 am | |
| Timothy Wall | Sep 10, 2007 5:43 am | |
| Thomas Börkel | Sep 10, 2007 6:49 am | |
| Timothy Wall | Sep 11, 2007 4:47 am | |
| Thomas Börkel | Sep 11, 2007 6:15 am | |
| Timothy Wall | Sep 11, 2007 6:47 am | |
| Thomas Börkel | Sep 11, 2007 6:52 am | |
| Timothy Wall | Sep 11, 2007 8:52 am | |
| Thomas Börkel | Sep 11, 2007 10:26 pm | |
| Timothy Wall | Sep 12, 2007 5:45 am | |
| Thomas Börkel | Sep 12, 2007 5:56 am | |
| Timothy Wall | Sep 12, 2007 6:19 am | |
| Thomas Börkel | Sep 12, 2007 7:09 am | |
| Timothy Wall | Sep 12, 2007 8:17 am | |
| Thomas Börkel | Sep 13, 2007 12:58 am |

![]() | Permalink for this message Paste this link in email or IM: |
![]() | Permalink for this thread Paste this link in email or IM: |
| Atom feed for this thread Paste this URL into your reader: |
| Subject: | Re: [jna-users] Win32 Service Callbacks | Actions... |
|---|---|---|
| From: | Thomas Börkel (tho...@boerkel.de) | |
| Date: | Sep 10, 2007 4:36:22 am | |
| List: | net.java.dev.jna.users | |
HI!
Timothy Wall wrote:
Glad to hear you made some progress. Can you run the JNA test suite without problems on Vista? Are there any service-related release notes/tech notes for Vista? You should check MSDN to see if there are any known issues.
OK, it works now with Vista, too, but I don't know why. ;-)
Before, I used this to register the callback (C definition):
SERVICE_STATUS_HANDLE WINAPI RegisterServiceCtrlHandler( LPCTSTR lpServiceName, LPHANDLER_FUNCTION lpHandlerProc );
This is the callback (C definition):
VOID WINAPI Handler( DWORD fdwControl );
This is my corresponding Java code for both:
Advapi32.java: public Pointer RegisterServiceCtrlHandler(String lpServiceName, WINSVC.HANDLER_FUNCTION lpHandlerProc);
WINSVC.java: interface HANDLER_FUNCTION extends StdCallCallback { public void callback(int fdwControl); }
Now, I use this:
C definition:
SERVICE_STATUS_HANDLE WINAPI RegisterServiceCtrlHandlerEx( LPCTSTR lpServiceName, LPHANDLER_FUNCTION_EX lpHandlerProc, LPVOID lpContext
DWORD WINAPI HandlerEx( DWORD dwControl, DWORD dwEventType, LPVOID lpEventData, LPVOID lpContext );
Java:
public Pointer RegisterServiceCtrlHandlerEx(String lpServiceName, WINSVC.HANDLER_FUNCTION_EX lpHandlerProc, Pointer lpContext);
interface HANDLER_FUNCTION_EX extends StdCallCallback { public void callback(int dwControl, int dwEventType, Pointer lpEventData, Pointer lpContext); }
And, as I wrote, the first way worked fine within a C service under Vista and also within a Java serice under Windows Server 2003.
The second way is the only way, the Java service works under Vista.
Thomas







