|
From: Richard L. <ric...@ms...> - 2004-03-01 05:32:38
|
Leif,
Thanks for your response. We have implemented a custom login dll that hooks
into the windows system. It will send the service a system event. The
service will then "respond" back to the the custom dll with a custom code.
Thereby allowing pseudo-communication between the java thread being run as a
service and the custom windows login dll.
Is that not possible with the current code? If not, do you think it would
be a hard thing for myself to implement? You are more knowledgable in this
topic than I am. But is it possible for me to edit the contolEvent method
to return back an integer to the call native code? I don't want to waste
time coding something that will not work. Is it possible for a java method
to return an integer in JNI? Thanks for your help. This seems like a great
product and I really hope I can use it.
Richard.
>From: Leif Mortenson <le...@ta...>
>Reply-To: wra...@li...
>To: wra...@li...
>Subject: Re: [Wrapper-user] How to catch other system events
>Date: Sun, 29 Feb 2004 22:05:46 +0900
>
>Richard,
> The wrapperConsoleHandler function is simply a callback registered with
>the
>Windows SetConsoleCtrlHandler function. The handler actually returns a
>BOOL.
>Even if the code allowed you to return a custom code, the Windows API would
>not know what to do with it. Am I missing something?
>| |
>Cheers,
>Leif
>
>Richard Luong wrote:
>
>>Leif,
>>
>>Thanks for your response. Sorry my response is somewhat late, however
>>this project's priority was shifted around for me.
>>
>>You are correct in that Windows doesn't throw any signal for a use login.
>>What I have is a dll, that hooks onto the windows login service and
>>basically sends my java thread custom signals. My thread will then return
>>an integer as a response. At least that's the plan.
>>
>>My question is, how do I reply to a system event? I see from your code
>>sample below, that your wrapperConsoleHandler returns an int. And that
>>int is true. That method then passes it to the JVM's controlEvent method,
>>which returns void. Is there anyway that I can return my own custom code?
>> Thanks.
>>
>>Richard.
>>
>>>Subject:
>>>Re: [Wrapper-user] How to catch other system events
>>>From:
>>>Leif Mortenson <le...@ta...>
>>>Date:
>>>Thu, 08 Jan 2004 18:59:21 +0900
>>>To:
>>>wra...@li...
>>>
>>>To:
>>>wra...@li...
>>>
>>>
>>>Richard,
>>>Sorry I never answered you did I.
>>>
>>>The Wrapper currently catches system events in the native code,
>>>Wrapper.DLL. It is taking any signal except the CTRL_BREAK_EVENT, which
>>>is used to generate thread dumps.
>>>What is the actual system signal that your card is throwing? Normally
>>>windows does not throw any signals that I know of when a user logs in. I
>>>am
>>>interesting in finding out how your card works because I have been
>>>looking
>>>for a nice clean way of telling when a user logs on for a while. The next
>>>version of the Wrapper allows you to poll for this information, but there
>>>is
>>>no signal that I could find that is fired when a user logs on to a
>>>Windows system.
>>>
>>>Here is the native code that parses the signals. Note that I am passing
>>>any
>>>unknown signals off to the JVM as well so the controlEvent method of your
>>>WrapperListener should get them if they are thrown.
>>>
>>>---
>>>int wrapperConsoleHandler(int key) {
>>>int event;
>>>
>>>/* Call the control callback in the java code */
>>>switch(key) {
>>>case CTRL_C_EVENT:
>>>event = org_tanukisoftware_wrapper_WrapperManager_WRAPPER_CTRL_C_EVENT;
>>>break;
>>>case CTRL_BREAK_EVENT:
>>>/* This is a request to do a thread dump. Let the JVM handle this. */
>>>return FALSE;
>>>case CTRL_CLOSE_EVENT:
>>>event =
>>>org_tanukisoftware_wrapper_WrapperManager_WRAPPER_CTRL_CLOSE_EVENT;
>>>break;
>>>case CTRL_LOGOFF_EVENT:
>>>event =
>>>org_tanukisoftware_wrapper_WrapperManager_WRAPPER_CTRL_LOGOFF_EVENT;
>>>break;
>>>case CTRL_SHUTDOWN_EVENT:
>>>event =
>>>org_tanukisoftware_wrapper_WrapperManager_WRAPPER_CTRL_SHUTDOWN_EVENT;
>>>break;
>>>default:
>>>event = key;
>>>}
>>>if (wrapperJNIDebugging) {
>>>printf("Got Control Signal %d->%d\n", key, event);
>>>flushall();
>>>}
>>>
>>>wrapperJNIHandleSignal(event);
>>>
>>>if (wrapperJNIDebugging) {
>>>printf("Handled signal\n");
>>>flushall();
>>>}
>>>
>>>return TRUE; /* We handled the event. */
>>>}
>>>---
>>>
>>>Please most back with as much info as you can make available even if you
>>>get this working.
>>>
>>>Cheers,
>>>Leif
>>>
>>>Richard Luong wrote:
>>>
>>>
>>>>I want to hook onto the Windows Login (Gina.dll) so that I can login
>>>>through an ID card. I can do the JNI stuff to talk from Java to the C
>>>>dll. But I would like the C code to be able to talk back to the Java
>>>>code through throwing events to my NT Service.
>>>>
>>>>My question is, does the Java Service Wrapper catch all events and
>>>>pass them on? If that's so, then problem solved.
>>>>
>>>>If not, does it only pass on specific control events such as windows
>>>>logoff, shutdown and ctr+C ?
>>>>
>>>>If so, can I modify the code to pass on all events? I know that I will
>>>>have to use Integration Method #3, which is not a problem for me.
>>>>However, any pointers to the code that is catching and possibly
>>>>ignoring/passing on events would be helpful.
>>>>
>>>>Thanks.
>>>
>
>
>
>-------------------------------------------------------
>SF.Net is sponsored by: Speed Start Your Linux Apps Now.
>Build and deploy apps & Web services for Linux with
>a free DVD software kit from IBM. Click Now!
>http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
>_______________________________________________
>Wrapper-user mailing list
>Wra...@li...
>https://lists.sourceforge.net/lists/listinfo/wrapper-user
_________________________________________________________________
Dream of owning a home? Find out how in the First-time Home Buying Guide.
http://special.msn.com/home/firsthome.armx
|