Bonjour à tous,

Alors voilà, j'ai un gros soucis de dll...

J'ai développé un programme assez conséquent qui a un moment donné utilise une DLL ou SO selon l’environnement.

J'utilise JNA pour ma manipulation de librairie sous NetBeans avec un Win 7 - 32bit.

Mon .h en c contient une enum, un union, une structure contenant des foncions de pointeur que j'implémente cotés java et que je passe en paramètre dans deux fonction implémenté en C.

Je fais des testes et cela fonctionne. Je sais utiliser des fonctions écrite en Java et les passer en paramètre d'une fonction C.

Ensuite je le fais dans mon application et là, la JVM(si je ne me trompe pas) crash à tous les coups.

Je fais plusieurs choses avant de charger et manipuler la dll...

Je vais juste vous mettre mon .h et .c et aussi l'équivalent en Java.
Mettre toute mon application ne servirait à rien ^^... Peut-être voir mon bordel :p.

Header h:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
 
#ifndef IOPROTOCOL_H_INCLUDED
#define IOPROTOCOL_H_INCLUDED
 
typedef signed char INT8;
typedef short       INT16;
typedef int         INT32;
typedef unsigned char  UINT8;
typedef unsigned short UINT16;
typedef unsigned int   UINT32;
 
/* Types d'IO */
typedef enum { IOT_U1, IOT_U2, IOT_U8, IOT_I8, IOT_U16, IOT_I16, IOT_U32, IOT_I32, IOT_F32, IOT_STRING, IOT_MAX } IoTypeE;
 
typedef union {
	INT32  i;
	UINT32 u;
	float  f;
	char * s;
} Value;
 
typedef struct {
	int (*Read) (UINT8 *rxbuf, int rxlen, UINT8 interTo);
	int (*Write) (UINT8 *txbuf,int txlen);
	int (*FunctionResponse) (int address, Value value, IoTypeE type);
	int (*SendTraceRoute) (char * trace);
} DeviceFuncT;
 
 
    int readTrame( DeviceFuncT *deviceFunct, UINT32 function, UINT32 address, UINT32 countAddress, UINT32 slave, UINT32 type);
    int writeTrame(DeviceFuncT *deviceFunct, UINT32 function, UINT32 address, Value value, UINT32 type, UINT32 slave);
 
 
#endif // IOPROTOCOL_H_INCLUDED
a.c
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
 
#include "IOProtocol.h"
#include <stdio.h>
 
 
 
    int readTrame( DeviceFuncT *deviceFunct,UINT32 function, UINT32 address, UINT32 countAddress, UINT32 slave, UINT32 typeRead){
        //deviceFunct->SendTraceRoute("Librarie Dynamic");
        printf("\n\n Salut ici la librairie : %d\n",function + address);
 
        char buffer[100];
 
        sprintf (buffer, "Number function :%d,  Number address :%d, number of address :%d, Number slave :%d, Tupe de lecture : %d", function,address,countAddress,slave, typeRead);
        deviceFunct->SendTraceRoute(buffer);
        return function + address + typeRead;
    }
 
    int writeTrame(DeviceFuncT *deviceFunct, UINT32 function, UINT32 address, Value value, UINT32 type, UINT32 slave){
        return 1;
    }
a.def
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
 
LIBRARY IOProtocol
DESCRIPTION 'Example of DLL'
EXPORTS
	readTrame @1
	writeTrame @2
IOProtocol.class
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
 
public interface IOProtocol extends com.sun.jna.Library{
 
        /**
        * 
        * Types d'IO 
        */
    public interface IoTypeE{
        public static final int IOT_U1 = 1;
        public static final int IOT_U2 = 2;
        public static final int IOT_U8 = 3;
        public static final int IOT_I8 = 4;
        public static final int IOT_U6 = 5;
        public static final int IOT_I6 = 6;
        public static final int IOT_U32 = 7;
        public static final int IOT_I32 = 8;
        public static final int IOT_F32 = 9;
        public static final int IOT_STRING = 10;
        public static final int IOT_MAX = 11;
    }
 
    public static class Value extends com.sun.jna.Union{
        public static class ByValueValue extends Value implements com.sun.jna.Union.ByValue{ };
        public int i;
        public int u;
        public float f;
        public String s;
        public static class ByReferenceValue extends Value implements com.sun.jna.Union.ByReference{ };
    }
 
    public static class DeviceFuncT extends com.sun.jna.Structure{
        public static interface ReadFunct extends com.sun.jna.Callback{
            int invoke(String rxbuf, int rxlen, byte interto);
        }
        public static interface WriteFunct extends com.sun.jna.Callback{
            int invoke(String txbuf, int rxlen);
        }
        public static interface FunctionResponseF extends com.sun.jna.Callback{
            int invoke(int address, Value value, int type);
        }
        public static interface SendTraceRouteF extends com.sun.jna.Callback{
            int invoke(String trace);
        }
 
        public ReadFunct Read;
        public WriteFunct Write;       
        public FunctionResponseF FunctionResponse;
        public SendTraceRouteF SendTraceRoute;
    }
 
    int readTrame(DeviceFuncT deviceFunct, int function, int address, int countAddress, int slave, int type );
    int writeTrame(DeviceFuncT deviceFunct, int function, int address, Value value, int type, int slave );
 
    public interface IOProtocolWin extends IOProtocol{}
}
Magement.class
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
 
public class ManagementProtocolSource {
    IOProtocol IOprotocol = null;
 
    static {       
    }
    public ManagementProtocolSource(String path, String nameProtocol){
        System.setProperty("jna.library.path",path); 
        this.IOprotocol = (IOProtocol) Native.loadLibrary(nameProtocol,Platform.isWindows() ? IOProtocolWin.class : IOProtocol.class);
        System.out.print("\n\n ¨Path : " + path + "     name :" + nameProtocol + "\n");
    }
 
    public IOProtocol getIOProtocol() {
        return IOprotocol;
    }
}
Main pour si vous voulez faire un petit test...
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
 
    public static void main(String[] args){
       // Controller c = new Controller();
       // HandleMain h = new HandleMain(c);
 
        ManagementProtocolSource m = new ManagementProtocolSource("packages/myProtocol", "MyProtocol");
        DeviceFuncT d = new DeviceFuncT();
        System.out.print("\n passe 1");
        d.FunctionResponse = new IOProtocol.DeviceFuncT.FunctionResponseF() {
 
            @Override
            public int invoke(int address, Value value, int type) {
               return 1;
            }
        };
        d.Read = new IOProtocol.DeviceFuncT.ReadFunct() {
 
            @Override
            public int invoke(String rxbuf, int rxlen, byte interto) {
                return 1;
            }
        };
 
        d.Write = new IOProtocol.DeviceFuncT.WriteFunct() {
 
            @Override
            public int invoke(String txbuf, int rxlen) {
                return 1;
            }
        };
 
        d.SendTraceRoute = new IOProtocol.DeviceFuncT.SendTraceRouteF() {
 
            @Override
            public int invoke(String trace) {
                    System.out.print("\n\n Attentiioon    :" + trace);
                return 5;
            }
        };
 
        int i = m.getIOProtocol().readTrame(d, 16, 14,16,14,2);
 
        System.out.print("\n\n Numéro ::::::::::::::::::" + i + "\n");
//                  
    }
Code quand la JVM se crash
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x6a7411e4, pid=4616, tid=4948
#
# JRE version: 6.0_25-b06
# Java VM: Java HotSpot(TM) Client VM (20.0-b11 mixed mode, sharing windows-x86 )
# Problematic frame:
# C  [MyProtocol.dll+0x11e4]
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
 
---------------  T H R E A D  ---------------
 
Current thread (0x03f0d400):  JavaThread "AWT-EventQueue-0" [_thread_in_native, id=4948, stack(0x05180000,0x051d0000)]
 
siginfo: ExceptionCode=0xc0000005, reading address 0x0000001c
 
Registers:
EAX=0x00000010, EBX=0x00000000, ECX=0x00000001, EDX=0x00000000
ESP=0x051ce750, EBP=0x051ce7e8, ESI=0x00000000, EDI=0x051ce930
EIP=0x6a7411e4, EFLAGS=0x00010206
 
Top of Stack: (sp=0x051ce750)
0x051ce750:   6a5f6e75 03fd63e8 00000001 03fd6728
0x051ce760:   051ce778 776d2c78 03fd6730 03fd6730
0x051ce770:   06a04ce0 03fd6728 051ce78c 7781c3d4
0x051ce780:   00d70000 00000000 03fd6730 051ce7d4
0x051ce790:   7c34218a 00d70000 00000000 7c34218f
0x051ce7a0:   03fd6730 03f0d528 00000004 051ce884
0x051ce7b0:   051ce7e0 06a0c5d4 051ce804 051ce958
0x051ce7c0:   00000004 051ce974 7c34240d 051ce8b8 
 
Instructions: (pc=0x6a7411e4)
0x6a7411c4:   d0 c9 c3 90 b8 00 00 00 00 eb e9 90 55 89 e5 5d
0x6a7411d4:   c3 90 90 90 55 89 e5 81 ec 98 00 00 00 8b 45 18
0x6a7411e4:   8b 40 0c c7 04 24 24 30 74 6a ff d0 c7 04 24 35
0x6a7411f4:   30 74 6a e8 c0 06 00 00 8b 45 14 89 44 24 14 8b 
 
 
Register to memory mapping:
 
EAX=0x00000010 is an unknown value
EBX=0x00000000 is an unknown value
ECX=0x00000001 is an unknown value
EDX=0x00000000 is an unknown value
ESP=0x051ce750 is pointing into the stack for thread: 0x03f0d400
EBP=0x051ce7e8 is pointing into the stack for thread: 0x03f0d400
ESI=0x00000000 is an unknown value
EDI=0x051ce930 is pointing into the stack for thread: 0x03f0d400
 
 
Stack: [0x05180000,0x051d0000],  sp=0x051ce750,  free space=313k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [MyProtocol.dll+0x11e4]  readTrame+0xc
C  [jna5862020665677741298.dll+0xcb67]  Java_com_sun_jna_Native_initialize_1ffi_1type+0x3807
C  [jna5862020665677741298.dll+0xc782]  Java_com_sun_jna_Native_initialize_1ffi_1type+0x3422
C  [jna5862020665677741298.dll+0x44ae]  Java_com_sun_jna_Native_getString+0x9de
C  [jna5862020665677741298.dll+0x4d0e]  Java_com_sun_jna_Native_invokeInt+0x2e
j  com.sun.jna.Native.invokeInt(JI[Ljava/lang/Object;)I+0
j  com.sun.jna.Function.invoke([Ljava/lang/Object;Ljava/lang/Class;Z)Ljava/lang/Object;+333
j  com.sun.jna.Function.invoke(Ljava/lang/Class;[Ljava/lang/Object;Ljava/util/Map;)Ljava/lang/Object;+214
j  com.sun.jna.Library$Handler.invoke(Ljava/lang/Object;Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object;+341
j  $Proxy12.readTrame(Lcom/gillam/bastin/myproject/models/handlelibrariesdynamics/IOProtocol$DeviceFuncT;IIIII)I+55
j  com.gillam.bastin.myproject.controllers.controls.ControllerConnection.actionRead(Lcom/gillam/bastin/myproject/models/source/Block;I)V+84
j  com.gillam.bastin.myproject.views.source.PanelBlock$ActionRead.actionPerformed(Ljava/awt/event/ActionEvent;)V+81
j  javax.swing.AbstractButton.fireActionPerformed(Ljava/awt/event/ActionEvent;)V+84
j  javax.swing.AbstractButton$Handler.actionPerformed(Ljava/awt/event/ActionEvent;)V+5
j  javax.swing.DefaultButtonModel.fireActionPerformed(Ljava/awt/event/ActionEvent;)V+35
j  javax.swing.DefaultButtonModel.setPressed(Z)V+117
j  javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Ljava/awt/event/MouseEvent;)V+35
j  java.awt.Component.processMouseEvent(Ljava/awt/event/MouseEvent;)V+64
j  javax.swing.JComponent.processMouseEvent(Ljava/awt/event/MouseEvent;)V+23
j  java.awt.Component.processEvent(Ljava/awt/AWTEvent;)V+81
j  java.awt.Container.processEvent(Ljava/awt/AWTEvent;)V+18
j  java.awt.Component.dispatchEventImpl(Ljava/awt/AWTEvent;)V+566
j  java.awt.Container.dispatchEventImpl(Ljava/awt/AWTEvent;)V+42
J  java.awt.LightweightDispatcher.retargetMouseEvent(Ljava/awt/Component;ILjava/awt/event/MouseEvent;)V
j  java.awt.LightweightDispatcher.dispatchEvent(Ljava/awt/AWTEvent;)Z+50
j  java.awt.Container.dispatchEventImpl(Ljava/awt/AWTEvent;)V+12
j  java.awt.Window.dispatchEventImpl(Ljava/awt/AWTEvent;)V+19
j  java.awt.Component.dispatchEvent(Ljava/awt/AWTEvent;)V+2
j  java.awt.EventQueue.dispatchEventImpl(Ljava/awt/AWTEvent;Ljava/lang/Object;)V+41
j  java.awt.EventQueue.access$000(Ljava/awt/EventQueue;Ljava/awt/AWTEvent;Ljava/lang/Object;)V+3
j  java.awt.EventQueue$1.run()Ljava/lang/Void;+12
j  java.awt.EventQueue$1.run()Ljava/lang/Object;+1
v  ~StubRoutines::call_stub
V  [jvm.dll+0xfad0b]
V  [jvm.dll+0x18c241]
V  [jvm.dll+0xfad8d]
V  [jvm.dll+0xbb634]
C  [java.dll+0x102f]  Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedAction_2Ljava_security_AccessControlContext_2+0x17
J  java.security.AccessControlContext$1.doIntersectionPrivilege(Ljava/security/PrivilegedAction;Ljava/security/AccessControlContext;Ljava/security/AccessControlContext;)Ljava/lang/Object;
j  java.awt.EventQueue$2.run()Ljava/lang/Void;+11
j  java.awt.EventQueue$2.run()Ljava/lang/Object;+1
v  ~StubRoutines::call_stub
V  [jvm.dll+0xfad0b]
V  [jvm.dll+0x18c241]
V  [jvm.dll+0xfad8d]
V  [jvm.dll+0xbb634]
C  [java.dll+0x102f]  Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedAction_2Ljava_security_AccessControlContext_2+0x17
J  java.security.AccessControlContext$1.doIntersectionPrivilege(Ljava/security/PrivilegedAction;Ljava/security/AccessControlContext;Ljava/security/AccessControlContext;)Ljava/lang/Object;
J  java.awt.EventDispatchThread.pumpOneEventForFilters(I)Z
j  java.awt.EventDispatchThread.pumpEventsForHierarchy(ILjava/awt/Conditional;Ljava/awt/Component;)V+11
j  java.awt.EventDispatchThread.pumpEvents(ILjava/awt/Conditional;)V+4
j  java.awt.EventDispatchThread.pumpEvents(Ljava/awt/Conditional;)V+3
j  java.awt.EventDispatchThread.run()V+9
v  ~StubRoutines::call_stub
V  [jvm.dll+0xfad0b]
V  [jvm.dll+0x18c241]
V  [jvm.dll+0xfaeb1]
V  [jvm.dll+0xfaf0b]
V  [jvm.dll+0xb5549]
V  [jvm.dll+0x118f44]
V  [jvm.dll+0x140a8c]
C  [msvcr71.dll+0x9565]  endthreadex+0xa0
C  [kernel32.dll+0x4ed6c]  BaseThreadInitThunk+0x12
C  [ntdll.dll+0x6377b]  RtlInitializeExceptionChain+0xef
C  [ntdll.dll+0x6374e]  RtlInitializeExceptionChain+0xc2
 
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  com.sun.jna.Native.invokeInt(JI[Ljava/lang/Object;)I+0
j  com.sun.jna.Function.invoke([Ljava/lang/Object;Ljava/lang/Class;Z)Ljava/lang/Object;+333
j  com.sun.jna.Function.invoke(Ljava/lang/Class;[Ljava/lang/Object;Ljava/util/Map;)Ljava/lang/Object;+214
j  com.sun.jna.Library$Handler.invoke(Ljava/lang/Object;Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object;+341
j  $Proxy12.readTrame(Lcom/gillam/bastin/myproject/models/handlelibrariesdynamics/IOProtocol$DeviceFuncT;IIIII)I+55
j  com.gillam.bastin.myproject.controllers.controls.ControllerConnection.actionRead(Lcom/gillam/bastin/myproject/models/source/Block;I)V+84
j  com.gillam.bastin.myproject.views.source.PanelBlock$ActionRead.actionPerformed(Ljava/awt/event/ActionEvent;)V+81
j  javax.swing.AbstractButton.fireActionPerformed(Ljava/awt/event/ActionEvent;)V+84
j  javax.swing.AbstractButton$Handler.actionPerformed(Ljava/awt/event/ActionEvent;)V+5
j  javax.swing.DefaultButtonModel.fireActionPerformed(Ljava/awt/event/ActionEvent;)V+35
j  javax.swing.DefaultButtonModel.setPressed(Z)V+117
j  javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Ljava/awt/event/MouseEvent;)V+35
j  java.awt.Component.processMouseEvent(Ljava/awt/event/MouseEvent;)V+64
j  javax.swing.JComponent.processMouseEvent(Ljava/awt/event/MouseEvent;)V+23
j  java.awt.Component.processEvent(Ljava/awt/AWTEvent;)V+81
j  java.awt.Container.processEvent(Ljava/awt/AWTEvent;)V+18
j  java.awt.Component.dispatchEventImpl(Ljava/awt/AWTEvent;)V+566
j  java.awt.Container.dispatchEventImpl(Ljava/awt/AWTEvent;)V+42
J  java.awt.LightweightDispatcher.retargetMouseEvent(Ljava/awt/Component;ILjava/awt/event/MouseEvent;)V
j  java.awt.LightweightDispatcher.processMouseEvent(Ljava/awt/event/MouseEvent;)Z+139
j  java.awt.LightweightDispatcher.dispatchEvent(Ljava/awt/AWTEvent;)Z+50
j  java.awt.Container.dispatchEventImpl(Ljava/awt/AWTEvent;)V+12
j  java.awt.Window.dispatchEventImpl(Ljava/awt/AWTEvent;)V+19
j  java.awt.Component.dispatchEvent(Ljava/awt/AWTEvent;)V+2
j  java.awt.EventQueue.dispatchEventImpl(Ljava/awt/AWTEvent;Ljava/lang/Object;)V+41
j  java.awt.EventQueue.access$000(Ljava/awt/EventQueue;Ljava/awt/AWTEvent;Ljava/lang/Object;)V+3
j  java.awt.EventQueue$1.run()Ljava/lang/Void;+12
j  java.awt.EventQueue$1.run()Ljava/lang/Object;+1
v  ~StubRoutines::call_stub
J  java.security.AccessController.doPrivileged(Ljava/security/PrivilegedAction;Ljava/security/AccessControlContext;)Ljava/lang/Object;
J  java.security.AccessControlContext$1.doIntersectionPrivilege(Ljava/security/PrivilegedAction;Ljava/security/AccessControlContext;Ljava/security/AccessControlContext;)Ljava/lang/Object;
j  java.security.AccessControlContext$1.doIntersectionPrivilege(Ljava/security/PrivilegedAction;Ljava/security/AccessControlContext;)Ljava/lang/Object;+6
j  java.awt.EventQueue$2.run()Ljava/lang/Void;+11
j  java.awt.EventQueue$2.run()Ljava/lang/Object;+1
v  ~StubRoutines::call_stub
J  java.security.AccessController.doPrivileged(Ljava/security/PrivilegedAction;Ljava/security/AccessControlContext;)Ljava/lang/Object;
J  java.security.AccessControlContext$1.doIntersectionPrivilege(Ljava/security/PrivilegedAction;Ljava/security/AccessControlContext;Ljava/security/AccessControlContext;)Ljava/lang/Object;
j  java.awt.EventQueue.dispatchEvent(Ljava/awt/AWTEvent;)V+73
J  java.awt.EventDispatchThread.pumpOneEventForFilters(I)Z
j  java.awt.EventDispatchThread.pumpEventsForFilter(ILjava/awt/Conditional;Ljava/awt/EventFilter;)V+30
j  java.awt.EventDispatchThread.pumpEventsForHierarchy(ILjava/awt/Conditional;Ljava/awt/Component;)V+11
j  java.awt.EventDispatchThread.pumpEvents(ILjava/awt/Conditional;)V+4
j  java.awt.EventDispatchThread.pumpEvents(Ljava/awt/Conditional;)V+3
j  java.awt.EventDispatchThread.run()V+9
v  ~StubRoutines::call_stub
 
---------------  P R O C E S S  ---------------
 
Java Threads: ( => current thread )
  0x03fa7000 JavaThread "Swing-Shell" daemon [_thread_blocked, id=4932, stack(0x05bd0000,0x05c20000)]
  0x03f96c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=5220, stack(0x05880000,0x058d0000)]
  0x00d79400 JavaThread "DestroyJavaVM" [_thread_blocked, id=808, stack(0x00d10000,0x00d60000)]
=>0x03f0d400 JavaThread "AWT-EventQueue-0" [_thread_in_native, id=4948, stack(0x05180000,0x051d0000)]
  0x01a7f400 JavaThread "AWT-Windows" daemon [_thread_in_native, id=4880, stack(0x04390000,0x043e0000)]
  0x01a7f000 JavaThread "AWT-Shutdown" [_thread_blocked, id=2784, stack(0x04340000,0x04390000)]
  0x01a7e400 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=5600, stack(0x042a0000,0x042f0000)]
  0x01a0d000 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=5512, stack(0x03e20000,0x03e70000)]
  0x01a08400 JavaThread "C1 CompilerThread0" daemon [_thread_blocked, id=3608, stack(0x03dd0000,0x03e20000)]
  0x01a07400 JavaThread "Attach Listener" daemon [_thread_blocked, id=3072, stack(0x03d80000,0x03dd0000)]
  0x01a04400 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=4644, stack(0x03d30000,0x03d80000)]
  0x019fc000 JavaThread "Finalizer" daemon [_thread_blocked, id=4092, stack(0x03ce0000,0x03d30000)]
  0x019f9800 JavaThread "Reference Handler" daemon [_thread_blocked, id=5632, stack(0x03c90000,0x03ce0000)]
 
Other Threads:
  0x019bcc00 VMThread [stack: 0x03c40000,0x03c90000] [id=1188]
  0x01a1ec00 WatcherThread [stack: 0x03e70000,0x03ec0000] [id=4912]
 
VM state:not at safepoint (normal execution)
 
VM Mutex/Monitor currently owned by a thread: None
 
Heap
 def new generation   total 4928K, used 2368K [0x27010000, 0x27560000, 0x2c560000)
  eden space 4416K,  45% used [0x27010000, 0x27205c60, 0x27460000)
  from space 512K,  70% used [0x27460000, 0x274ba740, 0x274e0000)
  to   space 512K,   0% used [0x274e0000, 0x274e0000, 0x27560000)
 tenured generation   total 10944K, used 5861K [0x2c560000, 0x2d010000, 0x37010000)
   the space 10944K,  53% used [0x2c560000, 0x2cb197e0, 0x2cb19800, 0x2d010000)
 compacting perm gen  total 12288K, used 5797K [0x37010000, 0x37c10000, 0x3b010000)
   the space 12288K,  47% used [0x37010000, 0x375b9550, 0x375b9600, 0x37c10000)
    ro space 10240K,  54% used [0x3b010000, 0x3b58e770, 0x3b58e800, 0x3ba10000)
    rw space 12288K,  55% used [0x3ba10000, 0x3c0b4ac8, 0x3c0b4c00, 0x3c610000)
 
Code Cache  [0x01a80000, 0x01bb0000, 0x03a80000)
 total_blobs=725 nmethods=513 adapters=148 free_code_cache=32314944 largest_free_block=192
 
Dynamic libraries:
0x00400000 - 0x00424000 	C:\Program Files (x86)\Java\jdk1.6.0_25\bin\java.exe
0x77680000 - 0x777bc000 	C:\Windows\SYSTEM32\ntdll.dll
0x777d0000 - 0x778a4000 	C:\Windows\system32\kernel32.dll
0x75aa0000 - 0x75aea000 	C:\Windows\system32\KERNELBASE.dll
0x75be0000 - 0x75c80000 	C:\Windows\system32\ADVAPI32.dll
0x77100000 - 0x771ac000 	C:\Windows\system32\msvcrt.dll
0x77440000 - 0x77459000 	C:\Windows\SYSTEM32\sechost.dll
0x77230000 - 0x772d1000 	C:\Windows\system32\RPCRT4.dll
0x7c340000 - 0x7c396000 	C:\Program Files (x86)\Java\jdk1.6.0_25\jre\bin\msvcr71.dll
0x6d8a0000 - 0x6db4f000 	C:\Program Files (x86)\Java\jdk1.6.0_25\jre\bin\client\jvm.dll
0x75b10000 - 0x75bd9000 	C:\Windows\system32\USER32.dll
0x761a0000 - 0x761ee000 	C:\Windows\system32\GDI32.dll
0x75c80000 - 0x75c8a000 	C:\Windows\system32\LPK.dll
0x77580000 - 0x7761d000 	C:\Windows\system32\USP10.dll
0x73c00000 - 0x73c32000 	C:\Windows\system32\WINMM.dll
0x76430000 - 0x7644f000 	C:\Windows\system32\IMM32.DLL
0x77370000 - 0x7743c000 	C:\Windows\system32\MSCTF.dll
0x75720000 - 0x7576c000 	C:\Windows\system32\apphelp.dll
0x757f0000 - 0x7580b000 	C:\Windows\system32\nvinit.dll
0x6d850000 - 0x6d85c000 	C:\Program Files (x86)\Java\jdk1.6.0_25\jre\bin\verify.dll
0x6d3d0000 - 0x6d3ef000 	C:\Program Files (x86)\Java\jdk1.6.0_25\jre\bin\java.dll
0x777c0000 - 0x777c5000 	C:\Windows\system32\PSAPI.DLL
0x6d890000 - 0x6d89f000 	C:\Program Files (x86)\Java\jdk1.6.0_25\jre\bin\zip.dll
0x6d0b0000 - 0x6d1fb000 	C:\Program Files (x86)\Java\jdk1.6.0_25\jre\bin\awt.dll
0x6fee0000 - 0x6ff31000 	C:\Windows\system32\WINSPOOL.DRV
0x75ee0000 - 0x7603c000 	C:\Windows\system32\ole32.dll
0x74730000 - 0x748ce000 	C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7601.17514_none_41e6975e2bd6f2b2\COMCTL32.dll
0x76450000 - 0x764a7000 	C:\Windows\system32\SHLWAPI.dll
0x741a0000 - 0x741b3000 	C:\Windows\system32\DWMAPI.DLL
0x74450000 - 0x74490000 	C:\Windows\system32\uxtheme.dll
0x6d2e0000 - 0x6d32f000 	C:\Program Files (x86)\Java\jdk1.6.0_25\jre\bin\fontmanager.dll
0x75770000 - 0x7577c000 	C:\Windows\system32\CRYPTBASE.dll
0x764b0000 - 0x770fa000 	C:\Windows\system32\shell32.dll
0x6d6b0000 - 0x6d6c3000 	C:\Program Files (x86)\Java\jdk1.6.0_25\jre\bin\net.dll
0x76040000 - 0x76075000 	C:\Windows\system32\WS2_32.dll
0x75ec0000 - 0x75ec6000 	C:\Windows\system32\NSI.dll
0x75230000 - 0x7526c000 	C:\Windows\system32\mswsock.dll
0x75220000 - 0x75226000 	C:\Windows\System32\wship6.dll
0x6d6d0000 - 0x6d6d9000 	C:\Program Files (x86)\Java\jdk1.6.0_25\jre\bin\nio.dll
0x75c90000 - 0x75d1f000 	C:\Windows\system32\OLEAUT32.DLL
0x75d20000 - 0x75ebd000 	C:\Windows\system32\SETUPAPI.dll
0x759e0000 - 0x75a07000 	C:\Windows\system32\CFGMGR32.dll
0x75af0000 - 0x75b02000 	C:\Windows\system32\DEVOBJ.dll
0x772e0000 - 0x77363000 	C:\Windows\system32\CLBCatQ.DLL
0x74540000 - 0x74635000 	C:\Windows\system32\propsys.dll
0x73e00000 - 0x73e21000 	C:\Windows\system32\ntmarta.dll
0x771b0000 - 0x771f5000 	C:\Windows\system32\WLDAP32.dll
0x64be0000 - 0x64d78000 	C:\Windows\system32\NetworkExplorer.dll
0x6e970000 - 0x6e99e000 	C:\Windows\System32\shdocvw.dll
0x75810000 - 0x7581b000 	C:\Windows\system32\profapi.dll
0x739f0000 - 0x739fa000 	C:\Windows\system32\slc.dll
0x72ab0000 - 0x72ac2000 	C:\Windows\system32\MPR.dll
0x744a0000 - 0x744a8000 	C:\Windows\System32\drprov.dll
0x75380000 - 0x753a9000 	C:\Windows\System32\WINSTA.dll
0x72190000 - 0x721a4000 	C:\Windows\System32\ntlanman.dll
0x720e0000 - 0x720f7000 	C:\Windows\System32\davclnt.dll
0x74510000 - 0x74518000 	C:\Windows\System32\DAVHLPR.dll
0x73f40000 - 0x73f4f000 	C:\Windows\system32\wkscli.dll
0x70df0000 - 0x70dfb000 	C:\Windows\system32\cscapi.dll
0x73f50000 - 0x73f59000 	C:\Windows\system32\netutils.dll
0x5f9f0000 - 0x5fc28000 	C:\Windows\system32\wpdshext.dll
0x742c0000 - 0x74450000 	C:\Windows\WinSxS\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.7601.17514_none_72d18a4386696c80\gdiplus.dll
0x6fa80000 - 0x6fb09000 	C:\Windows\system32\PortableDeviceApi.dll
0x759b0000 - 0x759dd000 	C:\Windows\system32\WINTRUST.dll
0x75890000 - 0x759ad000 	C:\Windows\system32\CRYPT32.dll
0x75880000 - 0x7588c000 	C:\Windows\system32\MSASN1.dll
0x6d390000 - 0x6d3cf000 	C:\Windows\system32\audiodev.dll
0x5b660000 - 0x5b8c7000 	C:\Windows\system32\WMVCore.DLL
0x6fb40000 - 0x6fb7d000 	C:\Windows\system32\WMASF.DLL
0x6eb70000 - 0x6eba1000 	C:\Windows\system32\EhStorShell.dll
0x6a0c0000 - 0x6a0e2000 	C:\Windows\system32\EhStorAPI.dll
0x6e960000 - 0x6e969000 	C:\Windows\system32\LINKINFO.dll
0x73fe0000 - 0x740db000 	C:\Windows\system32\WindowsCodecs.dll
0x10000000 - 0x10017000 	C:\Users\Entreprise\AppData\Roaming\Dropbox\bin\DropboxExt.14.dll
0x6ebb0000 - 0x6ec9b000 	C:\Windows\system32\dbghelp.dll
0x7c3a0000 - 0x7c41b000 	C:\Users\Entreprise\AppData\Roaming\Dropbox\bin\MSVCP71.dll
0x6eb00000 - 0x6eb6a000 	C:\Windows\System32\cscui.dll
0x6eaf0000 - 0x6eaf9000 	C:\Windows\System32\CSCDLL.dll
0x6ea80000 - 0x6eaf0000 	C:\Windows\system32\ntshrui.dll
0x754d0000 - 0x754e9000 	C:\Windows\system32\srvcli.dll
0x73800000 - 0x7380c000 	C:\Program Files\Common Files\Microsoft Shared\OFFICE12\MSOXEV.DLL
0x76080000 - 0x7619b000 	C:\Windows\system32\WININET.dll
0x75ed0000 - 0x75ed3000 	C:\Windows\system32\Normaliz.dll
0x761f0000 - 0x763a8000 	C:\Windows\system32\iertutil.dll
0x77460000 - 0x77571000 	C:\Windows\system32\urlmon.dll
0x70fe0000 - 0x7107b000 	C:\Windows\WinSxS\x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.4940_none_d08cc06a442b34fc\MSVCR80.dll
0x75270000 - 0x75286000 	C:\Windows\system32\CRYPTSP.dll
0x75010000 - 0x7504b000 	C:\Windows\system32\rsaenh.dll
0x74e10000 - 0x74e27000 	C:\Windows\system32\USERENV.dll
0x73bf0000 - 0x73c00000 	C:\Windows\system32\NLAapi.dll
0x6f650000 - 0x6f660000 	C:\Windows\system32\napinsp.dll
0x6f630000 - 0x6f642000 	C:\Windows\system32\pnrpnsp.dll
0x750f0000 - 0x75134000 	C:\Windows\system32\DNSAPI.dll
0x6f620000 - 0x6f628000 	C:\Windows\System32\winrnr.dll
0x6fd40000 - 0x6fd67000 	C:\Program Files\Common Files\Microsoft Shared\Windows Live\WLIDNSP.DLL
0x74d30000 - 0x74d35000 	C:\Windows\System32\wshtcpip.dll
0x73310000 - 0x7332c000 	C:\Windows\system32\IPHLPAPI.DLL
0x732f0000 - 0x732f7000 	C:\Windows\system32\WINNSI.DLL
0x6fd30000 - 0x6fd36000 	C:\Windows\system32\rasadhlp.dll
0x73190000 - 0x731c8000 	C:\Windows\System32\fwpuclnt.dll
0x06a00000 - 0x06a55000 	C:\Users\Entreprise\AppData\Local\Temp\jna5862020665677741298.dll
0x047e0000 - 0x047f2000 	E:\Entreprise\com.gillam.bastin.myproject\rxtxSerial.dll
0x6c240000 - 0x6c267000 	C:\Windows\system32\crtdll.dll
0x6a740000 - 0x6a756000 	E:\Entreprise\com.gillam.bastin.myproject\packages\myProtocol\MyProtocol.dll
 
VM Arguments:
jvm_args: -Dfile.encoding=UTF-8 
java_command: com.gillam.bastin.myproject.controllers.controls.Controller
Launcher Type: SUN_STANDARD
 
Environment Variables:
PATH=C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\MinGW32\bin;C:\Program Files\Windows Live\Shared;C:\Sun\jwsdp-2.0\jwsdp-shared\bin
USERNAME=Entreprise
OS=Windows_NT
PROCESSOR_IDENTIFIER=x86 Family 6 Model 37 Stepping 5, GenuineIntel
 
 
 
---------------  S Y S T E M  ---------------
 
OS: Windows 7 Build 7601 Service Pack 1
 
CPU:total 4 (2 cores per cpu, 2 threads per core) family 6 model 37 stepping 5, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, ht
 
Memory: 4k page, physical 3331504k(1356556k free), swap 6661252k(4518124k free)
 
vm_info: Java HotSpot(TM) Client VM (20.0-b11) for windows-x86 JRE (1.6.0_25-b06), built on Apr 14 2011 01:04:32 by "java_re" with MS VC++ 7.1 (VS2003)
 
time: Thu May 03 09:51:48 2012
elapsed time: 11 seconds

Quand je crée la librairie dynamique, j'utilise sous Windows MinGW32 comme compilateur et je fais la commande :
'gcc -Wall -shared a.c a.def -o MyProtocol.dll'

Est-ce que c'est bon comme cela?
Est-ce que mon code C est sufissant ou dois-je rajouter des précisions?
Avez-vous une idée pq cela ne fonctionne pas?

Je suis preneur de tous avis :/

Un grand merci à vous .