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:Timothy Wall (twal@dev.java.net)
Date:Sep 11, 2007 8:52:36 am
List:net.java.dev.jna.users

On Sep 11, 2007, at 9:52 AM, Thomas Börkel wrote:

HI!

Timothy Wall wrote:

That looks correct. Remember that the services control panel doesn't update automatically; you have to force a refresh.

Yes, I know. But still the description stays empty.

I now changed it like this: public boolean ChangeServiceConfig2(Pointer hService, int dwInfoLevel, WINSVC.SERVICE_DESCRIPTION lpInfo);

desc = new WINSVC.SERVICE_DESCRIPTION(); desc.lpDescription = "Test";

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

And now I get a scrambled (chinese characters or something) description.

Do you define the structure within the library interface definition? If not, then its strings may not be encoded the same as the library. Usually it's best (at least with windows) to define the structure within the library interface to ensure that the same mapping and encoding options are used.

A structure defined within a library interface definition will take on the same type mappings as the library. In this case, if you're using W32API.UNICODE_OPTIONS, functions are looked up using the -W suffix, and java String is converted to a wide string.

You can also use WString to force a wide string to be used.