28 messages in net.java.dev.jna.usersRe: [jna-users] Win32 Service Callbacks
FromSent OnAttachments
Thomas BörkelAug 21, 2007 6:26 am 
Thomas BörkelAug 22, 2007 12:35 am 
Wayne MeissnerAug 22, 2007 4:38 pm 
Thomas BörkelAug 22, 2007 10:36 pm 
Timothy WallAug 31, 2007 7:23 am 
Thomas BörkelAug 31, 2007 7:47 am 
Timothy WallAug 31, 2007 7:55 am 
Thomas BörkelSep 3, 2007 6:29 am 
Thomas BörkelSep 3, 2007 1:11 pm 
Timothy WallSep 6, 2007 11:21 am 
Thomas BörkelSep 7, 2007 7:08 am 
Timothy WallSep 7, 2007 7:43 am 
Thomas BörkelSep 10, 2007 12:18 am 
Thomas BörkelSep 10, 2007 4:36 am 
Timothy WallSep 10, 2007 5:43 am 
Thomas BörkelSep 10, 2007 6:49 am 
Timothy WallSep 11, 2007 4:47 am 
Thomas BörkelSep 11, 2007 6:15 am 
Timothy WallSep 11, 2007 6:47 am 
Thomas BörkelSep 11, 2007 6:52 am 
Timothy WallSep 11, 2007 8:52 am 
Thomas BörkelSep 11, 2007 10:26 pm 
Timothy WallSep 12, 2007 5:45 am 
Thomas BörkelSep 12, 2007 5:56 am 
Timothy WallSep 12, 2007 6:19 am 
Thomas BörkelSep 12, 2007 7:09 am 
Timothy WallSep 12, 2007 8:17 am 
Thomas BörkelSep 13, 2007 12:58 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [jna-users] Win32 Service CallbacksActions...
From:Thomas Börkel (tho@boerkel.de)
Date:Sep 11, 2007 6:15:01 am
List:net.java.dev.jna.users

HI!

Timothy Wall wrote:

I took a quick look at the w32 service spec an it looks like you can embed arguments in the "path" parameter when setting up the service, so you could potentially do away with the C wrapper entirely (unless the msdev docs are incorrect).

You're right. It works.

I am now looking into installing/removing a service and I have encountered a problem with LPVOID.

I have this Win32 function: /* BOOL WINAPI ChangeServiceConfig2( SC_HANDLE hService, DWORD dwInfoLevel, LPVOID lpInfo );*/ public boolean ChangeServiceConfig2(Pointer hService, int dwInfoLevel, Pointer lpInfo);

lpInfo is a pointer to a structure which type depends on the dwInfoLevel parameter. In my case, I want to pass a SERVICE_DESCRIPTION struct, defined like this: /* typedef struct _SERVICE_DESCRIPTION { LPTSTR lpDescription; } SERVICE_DESCRIPTION, *LPSERVICE_DESCRIPTION;*/ public static class SERVICE_DESCRIPTION extends Structure { public String lpDescription; }

Now, I am trying to do the call: desc = new WINSVC.SERVICE_DESCRIPTION(); desc.lpDescription = "Test";

success = advapi32.ChangeServiceConfig2(service, WINSVC.SERVICE_CONFIG_DESCRIPTION, desc.getPointer());

This returns true, but does not set the description. Am I doing something wrong?

Thanks!

Thomas